Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1262)
+++ branches/2.8.x/CHANGELOG	(revision 1263)
@@ -12,6 +12,8 @@
  
 ------------------------------------- 2.8.1 -------------------------------------
 21-Jan-2010 Dietmar Woellbrink (Luisehahne)
+!	updated YUI 2.4.1 to 2.8.0r4
+21-Jan-2010 Dietmar Woellbrink (Luisehahne)
 !	Beginning header information update
 21-Jan-2010 Dietmar Woellbrink (Luisehahne)
 #	fix login_form.php sometimes produce javascript errors in IE
Index: branches/2.8.x/wb/include/yui/connection/connection_core.js
===================================================================
--- branches/2.8.x/wb/include/yui/connection/connection_core.js	(nonexistent)
+++ branches/2.8.x/wb/include/yui/connection/connection_core.js	(revision 1263)
@@ -0,0 +1,957 @@
+/*
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.8.0r4
+*/
+/**
+ * The Connection Manager provides a simplified interface to the XMLHttpRequest
+ * object.  It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
+ * interactive states and server response, returning the results to a pre-defined
+ * callback you create.
+ *
+ * @namespace YAHOO.util
+ * @module connection
+ * @requires yahoo
+ * @requires event
+ */
+
+/**
+ * The Connection Manager singleton provides methods for creating and managing
+ * asynchronous transactions.
+ *
+ * @class Connect
+ */
+
+YAHOO.util.Connect =
+{
+  /**
+   * @description Array of MSFT ActiveX ids for XMLHttpRequest.
+   * @property _msxml_progid
+   * @private
+   * @static
+   * @type array
+   */
+	_msxml_progid:[
+		'Microsoft.XMLHTTP',
+		'MSXML2.XMLHTTP.3.0',
+		'MSXML2.XMLHTTP'
+		],
+
+  /**
+   * @description Object literal of HTTP header(s)
+   * @property _http_header
+   * @private
+   * @static
+   * @type object
+   */
+	_http_headers:{},
+
+  /**
+   * @description Determines if HTTP headers are set.
+   * @property _has_http_headers
+   * @private
+   * @static
+   * @type boolean
+   */
+	_has_http_headers:false,
+
+ /**
+  * @description Determines if a default header of
+  * Content-Type of 'application/x-www-form-urlencoded'
+  * will be added to any client HTTP headers sent for POST
+  * transactions.
+  * @property _use_default_post_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _use_default_post_header:true,
+
+ /**
+  * @description The default header used for POST transactions.
+  * @property _default_post_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',
+
+ /**
+  * @description The default header used for transactions involving the
+  * use of HTML forms.
+  * @property _default_form_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_form_header:'application/x-www-form-urlencoded',
+
+ /**
+  * @description Determines if a default header of
+  * 'X-Requested-With: XMLHttpRequest'
+  * will be added to each transaction.
+  * @property _use_default_xhr_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _use_default_xhr_header:true,
+
+ /**
+  * @description The default header value for the label
+  * "X-Requested-With".  This is sent with each
+  * transaction, by default, to identify the
+  * request as being made by YUI Connection Manager.
+  * @property _default_xhr_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_xhr_header:'XMLHttpRequest',
+
+ /**
+  * @description Determines if custom, default headers
+  * are set for each transaction.
+  * @property _has_default_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _has_default_headers:true,
+
+ /**
+  * @description Determines if custom, default headers
+  * are set for each transaction.
+  * @property _has_default_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_headers:{},
+
+ /**
+  * @description Collection of polling references to the polling mechanism in handleReadyState.
+  * @property _poll
+  * @private
+  * @static
+  * @type object
+  */
+    _poll:{},
+
+ /**
+  * @description Queue of timeout values for each transaction callback with a defined timeout value.
+  * @property _timeOut
+  * @private
+  * @static
+  * @type object
+  */
+    _timeOut:{},
+
+  /**
+   * @description The polling frequency, in milliseconds, for HandleReadyState.
+   * when attempting to determine a transaction's XHR readyState.
+   * The default is 50 milliseconds.
+   * @property _polling_interval
+   * @private
+   * @static
+   * @type int
+   */
+     _polling_interval:50,
+
+  /**
+   * @description A transaction counter that increments the transaction id for each transaction.
+   * @property _transaction_id
+   * @private
+   * @static
+   * @type int
+   */
+     _transaction_id:0,
+
+  /**
+   * @description Custom event that fires at the start of a transaction
+   * @property startEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	startEvent: new YAHOO.util.CustomEvent('start'),
+
+  /**
+   * @description Custom event that fires when a transaction response has completed.
+   * @property completeEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	completeEvent: new YAHOO.util.CustomEvent('complete'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 2xx range.
+   * @property successEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	successEvent: new YAHOO.util.CustomEvent('success'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 4xx/5xx range.
+   * @property failureEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	failureEvent: new YAHOO.util.CustomEvent('failure'),
+
+  /**
+   * @description Custom event that fires when a transaction is successfully aborted.
+   * @property abortEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	abortEvent: new YAHOO.util.CustomEvent('abort'),
+
+  /**
+   * @description A reference table that maps callback custom events members to its specific
+   * event name.
+   * @property _customEvents
+   * @private
+   * @static
+   * @type object
+   */
+	_customEvents:
+	{
+		onStart:['startEvent', 'start'],
+		onComplete:['completeEvent', 'complete'],
+		onSuccess:['successEvent', 'success'],
+		onFailure:['failureEvent', 'failure'],
+		onUpload:['uploadEvent', 'upload'],
+		onAbort:['abortEvent', 'abort']
+	},
+
+  /**
+   * @description Member to add an ActiveX id to the existing xml_progid array.
+   * In the event(unlikely) a new ActiveX id is introduced, it can be added
+   * without internal code modifications.
+   * @method setProgId
+   * @public
+   * @static
+   * @param {string} id The ActiveX id to be added to initialize the XHR object.
+   * @return void
+   */
+	setProgId:function(id)
+	{
+		this._msxml_progid.unshift(id);
+	},
+
+  /**
+   * @description Member to override the default POST header.
+   * @method setDefaultPostHeader
+   * @public
+   * @static
+   * @param {boolean} b Set and use default header - true or false .
+   * @return void
+   */
+	setDefaultPostHeader:function(b)
+	{
+		if(typeof b == 'string'){
+			this._default_post_header = b;
+		}
+		else if(typeof b == 'boolean'){
+			this._use_default_post_header = b;
+		}
+	},
+
+  /**
+   * @description Member to override the default transaction header..
+   * @method setDefaultXhrHeader
+   * @public
+   * @static
+   * @param {boolean} b Set and use default header - true or false .
+   * @return void
+   */
+	setDefaultXhrHeader:function(b)
+	{
+		if(typeof b == 'string'){
+			this._default_xhr_header = b;
+		}
+		else{
+			this._use_default_xhr_header = b;
+		}
+	},
+
+  /**
+   * @description Member to modify the default polling interval.
+   * @method setPollingInterval
+   * @public
+   * @static
+   * @param {int} i The polling interval in milliseconds.
+   * @return void
+   */
+	setPollingInterval:function(i)
+	{
+		if(typeof i == 'number' && isFinite(i)){
+			this._polling_interval = i;
+		}
+	},
+
+  /**
+   * @description Instantiates a XMLHttpRequest object and returns an object with two properties:
+   * the XMLHttpRequest instance and the transaction id.
+   * @method createXhrObject
+   * @private
+   * @static
+   * @param {int} transactionId Property containing the transaction id for this transaction.
+   * @return object
+   */
+	createXhrObject:function(transactionId)
+	{
+		var obj,http,i;
+		try
+		{
+			// Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
+			http = new XMLHttpRequest();
+			//  Object literal with http and tId properties
+			obj = { conn:http, tId:transactionId, xhr: true };
+		}
+		catch(e)
+		{
+			for(i=0; i<this._msxml_progid.length; ++i){
+				try
+				{
+					// Instantiates XMLHttpRequest for IE and assign to http
+					http = new ActiveXObject(this._msxml_progid[i]);
+					//  Object literal with conn and tId properties
+					obj = { conn:http, tId:transactionId, xhr: true };
+					break;
+				}
+				catch(e1){}
+			}
+		}
+		finally
+		{
+			return obj;
+		}
+	},
+
+  /**
+   * @description This method is called by asyncRequest to create a
+   * valid connection object for the transaction.  It also passes a
+   * transaction id and increments the transaction id counter.
+   * @method getConnectionObject
+   * @private
+   * @static
+   * @return {object}
+   */
+	getConnectionObject:function(t)
+	{
+		var o, tId = this._transaction_id;
+
+		try
+		{
+			if(!t){
+				o = this.createXhrObject(tId);
+			}
+			else{
+				o = {tId:tId};
+				if(t==='xdr'){
+					o.conn = this._transport;
+					o.xdr = true;
+				}
+				else if(t==='upload'){
+					o.upload = true;
+				}
+			}
+
+			if(o){
+				this._transaction_id++;
+			}
+		}
+		catch(e){}
+		return o;
+	},
+
+  /**
+   * @description Method for initiating an asynchronous request via the XHR object.
+   * @method asyncRequest
+   * @public
+   * @static
+   * @param {string} method HTTP transaction method
+   * @param {string} uri Fully qualified path of resource
+   * @param {callback} callback User-defined callback function or object
+   * @param {string} postData POST body
+   * @return {object} Returns the connection object
+   */
+	asyncRequest:function(method, uri, callback, postData)
+	{
+		var o,t,args = (callback && callback.argument)?callback.argument:null;
+
+		if(this._isFileUpload){
+			t = 'upload';
+		}
+		else if(callback.xdr){
+			t = 'xdr';
+		}
+
+		o = this.getConnectionObject(t);
+		if(!o){
+			return null;
+		}
+		else{
+
+			// Intialize any transaction-specific custom events, if provided.
+			if(callback && callback.customevents){
+				this.initCustomEvents(o, callback);
+			}
+
+			if(this._isFormSubmit){
+				if(this._isFileUpload){
+					this.uploadFile(o, callback, uri, postData);
+					return o;
+				}
+
+				// If the specified HTTP method is GET, setForm() will return an
+				// encoded string that is concatenated to the uri to
+				// create a querystring.
+				if(method.toUpperCase() == 'GET'){
+					if(this._sFormData.length !== 0){
+						// If the URI already contains a querystring, append an ampersand
+						// and then concatenate _sFormData to the URI.
+						uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
+					}
+				}
+				else if(method.toUpperCase() == 'POST'){
+					// If POST data exist in addition to the HTML form data,
+					// it will be concatenated to the form data.
+					postData = postData?this._sFormData + "&" + postData:this._sFormData;
+				}
+			}
+
+			if(method.toUpperCase() == 'GET' && (callback && callback.cache === false)){
+				// If callback.cache is defined and set to false, a
+				// timestamp value will be added to the querystring.
+				uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();
+			}
+
+			// Each transaction will automatically include a custom header of
+			// "X-Requested-With: XMLHttpRequest" to identify the request as
+			// having originated from Connection Manager.
+			if(this._use_default_xhr_header){
+				if(!this._default_headers['X-Requested-With']){
+					this.initHeader('X-Requested-With', this._default_xhr_header, true);
+				}
+			}
+
+			//If the transaction method is POST and the POST header value is set to true
+			//or a custom value, initalize the Content-Type header to this value.
+			if((method.toUpperCase() === 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
+				this.initHeader('Content-Type', this._default_post_header);
+			}
+
+			if(o.xdr){
+				this.xdr(o, method, uri, callback, postData);
+				return o;
+			}
+
+			o.conn.open(method, uri, true);
+			//Initialize all default and custom HTTP headers,
+			if(this._has_default_headers || this._has_http_headers){
+				this.setHeader(o);
+			}
+
+			this.handleReadyState(o, callback);
+			o.conn.send(postData || '');
+
+			// Reset the HTML form data and state properties as
+			// soon as the data are submitted.
+			if(this._isFormSubmit === true){
+				this.resetFormState();
+			}
+
+			// Fire global custom event -- startEvent
+			this.startEvent.fire(o, args);
+
+			if(o.startEvent){
+				// Fire transaction custom event -- startEvent
+				o.startEvent.fire(o, args);
+			}
+
+			return o;
+		}
+	},
+
+  /**
+   * @description This method creates and subscribes custom events,
+   * specific to each transaction
+   * @method initCustomEvents
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {callback} callback The user-defined callback object
+   * @return {void}
+   */
+	initCustomEvents:function(o, callback)
+	{
+		var prop;
+		// Enumerate through callback.customevents members and bind/subscribe
+		// events that match in the _customEvents table.
+		for(prop in callback.customevents){
+			if(this._customEvents[prop][0]){
+				// Create the custom event
+				o[this._customEvents[prop][0]] = new YAHOO.util.CustomEvent(this._customEvents[prop][1], (callback.scope)?callback.scope:null);
+
+				// Subscribe the custom event
+				o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);
+			}
+		}
+	},
+
+  /**
+   * @description This method serves as a timer that polls the XHR object's readyState
+   * property during a transaction, instead of binding a callback to the
+   * onreadystatechange event.  Upon readyState 4, handleTransactionResponse
+   * will process the response, and the timer will be cleared.
+   * @method handleReadyState
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {callback} callback The user-defined callback object
+   * @return {void}
+   */
+
+    handleReadyState:function(o, callback)
+
+    {
+		var oConn = this,
+			args = (callback && callback.argument)?callback.argument:null;
+
+		if(callback && callback.timeout){
+			this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
+		}
+
+		this._poll[o.tId] = window.setInterval(
+			function(){
+				if(o.conn && o.conn.readyState === 4){
+
+					// Clear the polling interval for the transaction
+					// and remove the reference from _poll.
+					window.clearInterval(oConn._poll[o.tId]);
+					delete oConn._poll[o.tId];
+
+					if(callback && callback.timeout){
+						window.clearTimeout(oConn._timeOut[o.tId]);
+						delete oConn._timeOut[o.tId];
+					}
+
+					// Fire global custom event -- completeEvent
+					oConn.completeEvent.fire(o, args);
+
+					if(o.completeEvent){
+						// Fire transaction custom event -- completeEvent
+						o.completeEvent.fire(o, args);
+					}
+
+					oConn.handleTransactionResponse(o, callback);
+				}
+			}
+		,this._polling_interval);
+    },
+
+  /**
+   * @description This method attempts to interpret the server response and
+   * determine whether the transaction was successful, or if an error or
+   * exception was encountered.
+   * @method handleTransactionResponse
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {object} callback The user-defined callback object
+   * @param {boolean} isAbort Determines if the transaction was terminated via abort().
+   * @return {void}
+   */
+    handleTransactionResponse:function(o, callback, isAbort)
+    {
+		var httpStatus, responseObject,
+			args = (callback && callback.argument)?callback.argument:null,
+			xdrS = (o.r && o.r.statusText === 'xdr:success')?true:false,
+			xdrF = (o.r && o.r.statusText === 'xdr:failure')?true:false,
+			xdrA = isAbort;
+
+		try
+		{
+			if((o.conn.status !== undefined && o.conn.status !== 0) || xdrS){
+				// XDR requests will not have HTTP status defined. The
+				// statusText property will define the response status
+				// set by the Flash transport.
+				httpStatus = o.conn.status;
+			}
+			else if(xdrF && !xdrA){
+				// Set XDR transaction failure to a status of 0, which
+				// resolves as an HTTP failure, instead of an exception.
+				httpStatus = 0;
+			}
+			else{
+				httpStatus = 13030;
+			}
+		}
+		catch(e){
+
+			 // 13030 is a custom code to indicate the condition -- in Mozilla/FF --
+			 // when the XHR object's status and statusText properties are
+			 // unavailable, and a query attempt throws an exception.
+			httpStatus = 13030;
+		}
+
+		if((httpStatus >= 200 && httpStatus < 300) || httpStatus === 1223 || xdrS){
+			responseObject = o.xdr ? o.r : this.createResponseObject(o, args);
+			if(callback && callback.success){
+				if(!callback.scope){
+					callback.success(responseObject);
+				}
+				else{
+					// If a scope property is defined, the callback will be fired from
+					// the context of the object.
+					callback.success.apply(callback.scope, [responseObject]);
+				}
+			}
+
+			// Fire global custom event -- successEvent
+			this.successEvent.fire(responseObject);
+
+			if(o.successEvent){
+				// Fire transaction custom event -- successEvent
+				o.successEvent.fire(responseObject);
+			}
+		}
+		else{
+			switch(httpStatus){
+				// The following cases are wininet.dll error codes that may be encountered.
+				case 12002: // Server timeout
+				case 12029: // 12029 to 12031 correspond to dropped connections.
+				case 12030:
+				case 12031:
+				case 12152: // Connection closed by server.
+				case 13030: // See above comments for variable status.
+					// XDR transactions will not resolve to this case, since the
+					// response object is already built in the xdr response.
+					responseObject = this.createExceptionObject(o.tId, args, (isAbort?isAbort:false));
+					if(callback && callback.failure){
+						if(!callback.scope){
+							callback.failure(responseObject);
+						}
+						else{
+							callback.failure.apply(callback.scope, [responseObject]);
+						}
+					}
+
+					break;
+				default:
+					responseObject = (o.xdr) ? o.response : this.createResponseObject(o, args);
+					if(callback && callback.failure){
+						if(!callback.scope){
+							callback.failure(responseObject);
+						}
+						else{
+							callback.failure.apply(callback.scope, [responseObject]);
+						}
+					}
+			}
+
+			// Fire global custom event -- failureEvent
+			this.failureEvent.fire(responseObject);
+
+			if(o.failureEvent){
+				// Fire transaction custom event -- failureEvent
+				o.failureEvent.fire(responseObject);
+			}
+
+		}
+
+		this.releaseObject(o);
+		responseObject = null;
+    },
+
+  /**
+   * @description This method evaluates the server response, creates and returns the results via
+   * its properties.  Success and failure cases will differ in the response
+   * object's property values.
+   * @method createResponseObject
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
+   * @return {object}
+   */
+    createResponseObject:function(o, callbackArg)
+    {
+		var obj = {}, headerObj = {},
+			i, headerStr, header, delimitPos;
+
+		try
+		{
+			headerStr = o.conn.getAllResponseHeaders();
+			header = headerStr.split('\n');
+			for(i=0; i<header.length; i++){
+				delimitPos = header[i].indexOf(':');
+				if(delimitPos != -1){
+					headerObj[header[i].substring(0,delimitPos)] = YAHOO.lang.trim(header[i].substring(delimitPos+2));
+				}
+			}
+		}
+		catch(e){}
+
+		obj.tId = o.tId;
+		// Normalize IE's response to HTTP 204 when Win error 1223.
+		obj.status = (o.conn.status == 1223)?204:o.conn.status;
+		// Normalize IE's statusText to "No Content" instead of "Unknown".
+		obj.statusText = (o.conn.status == 1223)?"No Content":o.conn.statusText;
+		obj.getResponseHeader = headerObj;
+		obj.getAllResponseHeaders = headerStr;
+		obj.responseText = o.conn.responseText;
+		obj.responseXML = o.conn.responseXML;
+
+		if(callbackArg){
+			obj.argument = callbackArg;
+		}
+
+		return obj;
+    },
+
+  /**
+   * @description If a transaction cannot be completed due to dropped or closed connections,
+   * there may be not be enough information to build a full response object.
+   * The failure callback will be fired and this specific condition can be identified
+   * by a status property value of 0.
+   *
+   * If an abort was successful, the status property will report a value of -1.
+   *
+   * @method createExceptionObject
+   * @private
+   * @static
+   * @param {int} tId The Transaction Id
+   * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
+   * @param {boolean} isAbort Determines if the exception case is caused by a transaction abort
+   * @return {object}
+   */
+    createExceptionObject:function(tId, callbackArg, isAbort)
+    {
+		var COMM_CODE = 0,
+			COMM_ERROR = 'communication failure',
+			ABORT_CODE = -1,
+			ABORT_ERROR = 'transaction aborted',
+			obj = {};
+
+		obj.tId = tId;
+		if(isAbort){
+			obj.status = ABORT_CODE;
+			obj.statusText = ABORT_ERROR;
+		}
+		else{
+			obj.status = COMM_CODE;
+			obj.statusText = COMM_ERROR;
+		}
+
+		if(callbackArg){
+			obj.argument = callbackArg;
+		}
+
+		return obj;
+    },
+
+  /**
+   * @description Method that initializes the custom HTTP headers for the each transaction.
+   * @method initHeader
+   * @public
+   * @static
+   * @param {string} label The HTTP header label
+   * @param {string} value The HTTP header value
+   * @param {string} isDefault Determines if the specific header is a default header
+   * automatically sent with each transaction.
+   * @return {void}
+   */
+	initHeader:function(label, value, isDefault)
+	{
+		var headerObj = (isDefault)?this._default_headers:this._http_headers;
+
+		headerObj[label] = value;
+		if(isDefault){
+			this._has_default_headers = true;
+		}
+		else{
+			this._has_http_headers = true;
+		}
+	},
+
+
+  /**
+   * @description Accessor that sets the HTTP headers for each transaction.
+   * @method setHeader
+   * @private
+   * @static
+   * @param {object} o The connection object for the transaction.
+   * @return {void}
+   */
+	setHeader:function(o)
+	{
+		var prop;
+		if(this._has_default_headers){
+			for(prop in this._default_headers){
+				if(YAHOO.lang.hasOwnProperty(this._default_headers, prop)){
+					o.conn.setRequestHeader(prop, this._default_headers[prop]);
+				}
+			}
+		}
+
+		if(this._has_http_headers){
+			for(prop in this._http_headers){
+				if(YAHOO.lang.hasOwnProperty(this._http_headers, prop)){
+					o.conn.setRequestHeader(prop, this._http_headers[prop]);
+				}
+			}
+
+			this._http_headers = {};
+			this._has_http_headers = false;
+		}
+	},
+
+  /**
+   * @description Resets the default HTTP headers object
+   * @method resetDefaultHeaders
+   * @public
+   * @static
+   * @return {void}
+   */
+	resetDefaultHeaders:function(){
+		this._default_headers = {};
+		this._has_default_headers = false;
+	},
+
+  /**
+   * @description Method to terminate a transaction, if it has not reached readyState 4.
+   * @method abort
+   * @public
+   * @static
+   * @param {object} o The connection object returned by asyncRequest.
+   * @param {object} callback  User-defined callback object.
+   * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout.
+   * @return {boolean}
+   */
+	abort:function(o, callback, isTimeout)
+	{
+		var abortStatus,
+			args = (callback && callback.argument)?callback.argument:null;
+			o = o || {};
+
+		if(o.conn){
+			if(o.xhr){
+				if(this.isCallInProgress(o)){
+					// Issue abort request
+					o.conn.abort();
+
+					window.clearInterval(this._poll[o.tId]);
+					delete this._poll[o.tId];
+
+					if(isTimeout){
+						window.clearTimeout(this._timeOut[o.tId]);
+						delete this._timeOut[o.tId];
+					}
+
+					abortStatus = true;
+				}
+			}
+			else if(o.xdr){
+				o.conn.abort(o.tId);
+				abortStatus = true;
+			}
+		}
+		else if(o.upload){
+			var frameId = 'yuiIO' + o.tId;
+			var io = document.getElementById(frameId);
+
+			if(io){
+				// Remove all listeners on the iframe prior to
+				// its destruction.
+				YAHOO.util.Event.removeListener(io, "load");
+				// Destroy the iframe facilitating the transaction.
+				document.body.removeChild(io);
+
+				if(isTimeout){
+					window.clearTimeout(this._timeOut[o.tId]);
+					delete this._timeOut[o.tId];
+				}
+
+				abortStatus = true;
+			}
+		}
+		else{
+			abortStatus = false;
+		}
+
+		if(abortStatus === true){
+			// Fire global custom event -- abortEvent
+			this.abortEvent.fire(o, args);
+
+			if(o.abortEvent){
+				// Fire transaction custom event -- abortEvent
+				o.abortEvent.fire(o, args);
+			}
+
+			this.handleTransactionResponse(o, callback, true);
+		}
+
+		return abortStatus;
+	},
+
+  /**
+   * @description Determines if the transaction is still being processed.
+   * @method isCallInProgress
+   * @public
+   * @static
+   * @param {object} o The connection object returned by asyncRequest
+   * @return {boolean}
+   */
+	isCallInProgress:function(o)
+	{
+		o = o || {};
+		// if the XHR object assigned to the transaction has not been dereferenced,
+		// then check its readyState status.  Otherwise, return false.
+		if(o.xhr && o.conn){
+			return o.conn.readyState !== 4 && o.conn.readyState !== 0;
+		}
+		else if(o.xdr && o.conn){
+			return o.conn.isCallInProgress(o.tId);
+		}
+		else if(o.upload === true){
+			return document.getElementById('yuiIO' + o.tId)?true:false;
+		}
+		else{
+			return false;
+		}
+	},
+
+  /**
+   * @description Dereference the XHR instance and the connection object after the transaction is completed.
+   * @method releaseObject
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @return {void}
+   */
+	releaseObject:function(o)
+	{
+		if(o && o.conn){
+			//dereference the XHR instance.
+			o.conn = null;
+
+
+			//dereference the connection object.
+			o = null;
+		}
+	}
+};
+
+YAHOO.register("connection_core", YAHOO.util.Connect, {version: "2.8.0r4", build: "2449"});

Property changes on: branches/2.8.x/wb/include/yui/connection/connection_core.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/2.8.x/wb/include/yui/connection/connection_core-min.js
===================================================================
--- branches/2.8.x/wb/include/yui/connection/connection_core-min.js	(nonexistent)
+++ branches/2.8.x/wb/include/yui/connection/connection_core-min.js	(revision 1263)
@@ -0,0 +1,8 @@
+/*
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.8.0r4
+*/
+YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(F){var D,A,B;try{A=new XMLHttpRequest();D={conn:A,tId:F,xhr:true};}catch(C){for(B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:F,xhr:true};break;}catch(E){}}}finally{return D;}},getConnectionObject:function(A){var C,D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={tId:D};if(A==="xdr"){C.conn=this._transport;C.xdr=true;}else{if(A==="upload"){C.upload=true;}}}if(C){this._transaction_id++;}}catch(B){}return C;},asyncRequest:function(G,D,F,A){var E,C,B=(F&&F.argument)?F.argument:null;if(this._isFileUpload){C="upload";}else{if(F.xdr){C="xdr";}}E=this.getConnectionObject(C);if(!E){return null;}else{if(F&&F.customevents){this.initCustomEvents(E,F);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(E,F,D,A);return E;}if(G.toUpperCase()=="GET"){if(this._sFormData.length!==0){D+=((D.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(G.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(G.toUpperCase()=="GET"&&(F&&F.cache===false)){D+=((D.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((G.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(E.xdr){this.xdr(E,G,D,F,A);return E;}E.conn.open(G,D,true);if(this._has_default_headers||this._has_http_headers){this.setHeader(E);}this.handleReadyState(E,F);E.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(E,B);if(E.startEvent){E.startEvent.fire(E,B);}return E;}},initCustomEvents:function(A,C){var B;for(B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B]);}}},handleReadyState:function(C,D){var B=this,A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(B,I,D){var E,A,G=(I&&I.argument)?I.argument:null,C=(B.r&&B.r.statusText==="xdr:success")?true:false,H=(B.r&&B.r.statusText==="xdr:failure")?true:false,J=D;try{if((B.conn.status!==undefined&&B.conn.status!==0)||C){E=B.conn.status;}else{if(H&&!J){E=0;}else{E=13030;}}}catch(F){E=13030;}if((E>=200&&E<300)||E===1223||C){A=B.xdr?B.r:this.createResponseObject(B,G);if(I&&I.success){if(!I.scope){I.success(A);}else{I.success.apply(I.scope,[A]);}}this.successEvent.fire(A);if(B.successEvent){B.successEvent.fire(A);}}else{switch(E){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:A=this.createExceptionObject(B.tId,G,(D?D:false));if(I&&I.failure){if(!I.scope){I.failure(A);}else{I.failure.apply(I.scope,[A]);}}break;default:A=(B.xdr)?B.response:this.createResponseObject(B,G);if(I&&I.failure){if(!I.scope){I.failure(A);}else{I.failure.apply(I.scope,[A]);}}}this.failureEvent.fire(A);if(B.failureEvent){B.failureEvent.fire(A);}}this.releaseObject(B);A=null;},createResponseObject:function(A,G){var D={},I={},E,C,F,B;try{C=A.conn.getAllResponseHeaders();F=C.split("\n");for(E=0;E<F.length;E++){B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=YAHOO.lang.trim(F[E].substring(B+2));}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0,G="communication failure",C=-1,B="transaction aborted",E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(A){var B;if(this._has_default_headers){for(B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);}}}if(this._has_http_headers){for(B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);
+}}this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){this._default_headers={};this._has_default_headers=false;},abort:function(E,G,A){var D,B=(G&&G.argument)?G.argument:null;E=E||{};if(E.conn){if(E.xhr){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E.xdr){E.conn.abort(E.tId);D=true;}}}else{if(E.upload){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(A){A=A||{};if(A.xhr&&A.conn){return A.conn.readyState!==4&&A.conn.readyState!==0;}else{if(A.xdr&&A.conn){return A.conn.isCallInProgress(A.tId);}else{if(A.upload===true){return document.getElementById("yuiIO"+A.tId)?true:false;}else{return false;}}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null;}}};YAHOO.register("connection_core",YAHOO.util.Connect,{version:"2.8.0r4",build:"2449"});
\ No newline at end of file

Property changes on: branches/2.8.x/wb/include/yui/connection/connection_core-min.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/2.8.x/wb/include/yui/connection/connection_core-debug.js
===================================================================
--- branches/2.8.x/wb/include/yui/connection/connection_core-debug.js	(nonexistent)
+++ branches/2.8.x/wb/include/yui/connection/connection_core-debug.js	(revision 1263)
@@ -0,0 +1,980 @@
+/*
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.8.0r4
+*/
+/**
+ * The Connection Manager provides a simplified interface to the XMLHttpRequest
+ * object.  It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
+ * interactive states and server response, returning the results to a pre-defined
+ * callback you create.
+ *
+ * @namespace YAHOO.util
+ * @module connection
+ * @requires yahoo
+ * @requires event
+ */
+
+/**
+ * The Connection Manager singleton provides methods for creating and managing
+ * asynchronous transactions.
+ *
+ * @class Connect
+ */
+
+YAHOO.util.Connect =
+{
+  /**
+   * @description Array of MSFT ActiveX ids for XMLHttpRequest.
+   * @property _msxml_progid
+   * @private
+   * @static
+   * @type array
+   */
+	_msxml_progid:[
+		'Microsoft.XMLHTTP',
+		'MSXML2.XMLHTTP.3.0',
+		'MSXML2.XMLHTTP'
+		],
+
+  /**
+   * @description Object literal of HTTP header(s)
+   * @property _http_header
+   * @private
+   * @static
+   * @type object
+   */
+	_http_headers:{},
+
+  /**
+   * @description Determines if HTTP headers are set.
+   * @property _has_http_headers
+   * @private
+   * @static
+   * @type boolean
+   */
+	_has_http_headers:false,
+
+ /**
+  * @description Determines if a default header of
+  * Content-Type of 'application/x-www-form-urlencoded'
+  * will be added to any client HTTP headers sent for POST
+  * transactions.
+  * @property _use_default_post_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _use_default_post_header:true,
+
+ /**
+  * @description The default header used for POST transactions.
+  * @property _default_post_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',
+
+ /**
+  * @description The default header used for transactions involving the
+  * use of HTML forms.
+  * @property _default_form_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_form_header:'application/x-www-form-urlencoded',
+
+ /**
+  * @description Determines if a default header of
+  * 'X-Requested-With: XMLHttpRequest'
+  * will be added to each transaction.
+  * @property _use_default_xhr_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _use_default_xhr_header:true,
+
+ /**
+  * @description The default header value for the label
+  * "X-Requested-With".  This is sent with each
+  * transaction, by default, to identify the
+  * request as being made by YUI Connection Manager.
+  * @property _default_xhr_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_xhr_header:'XMLHttpRequest',
+
+ /**
+  * @description Determines if custom, default headers
+  * are set for each transaction.
+  * @property _has_default_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _has_default_headers:true,
+
+ /**
+  * @description Determines if custom, default headers
+  * are set for each transaction.
+  * @property _has_default_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_headers:{},
+
+ /**
+  * @description Collection of polling references to the polling mechanism in handleReadyState.
+  * @property _poll
+  * @private
+  * @static
+  * @type object
+  */
+    _poll:{},
+
+ /**
+  * @description Queue of timeout values for each transaction callback with a defined timeout value.
+  * @property _timeOut
+  * @private
+  * @static
+  * @type object
+  */
+    _timeOut:{},
+
+  /**
+   * @description The polling frequency, in milliseconds, for HandleReadyState.
+   * when attempting to determine a transaction's XHR readyState.
+   * The default is 50 milliseconds.
+   * @property _polling_interval
+   * @private
+   * @static
+   * @type int
+   */
+     _polling_interval:50,
+
+  /**
+   * @description A transaction counter that increments the transaction id for each transaction.
+   * @property _transaction_id
+   * @private
+   * @static
+   * @type int
+   */
+     _transaction_id:0,
+
+  /**
+   * @description Custom event that fires at the start of a transaction
+   * @property startEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	startEvent: new YAHOO.util.CustomEvent('start'),
+
+  /**
+   * @description Custom event that fires when a transaction response has completed.
+   * @property completeEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	completeEvent: new YAHOO.util.CustomEvent('complete'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 2xx range.
+   * @property successEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	successEvent: new YAHOO.util.CustomEvent('success'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 4xx/5xx range.
+   * @property failureEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	failureEvent: new YAHOO.util.CustomEvent('failure'),
+
+  /**
+   * @description Custom event that fires when a transaction is successfully aborted.
+   * @property abortEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+	abortEvent: new YAHOO.util.CustomEvent('abort'),
+
+  /**
+   * @description A reference table that maps callback custom events members to its specific
+   * event name.
+   * @property _customEvents
+   * @private
+   * @static
+   * @type object
+   */
+	_customEvents:
+	{
+		onStart:['startEvent', 'start'],
+		onComplete:['completeEvent', 'complete'],
+		onSuccess:['successEvent', 'success'],
+		onFailure:['failureEvent', 'failure'],
+		onUpload:['uploadEvent', 'upload'],
+		onAbort:['abortEvent', 'abort']
+	},
+
+  /**
+   * @description Member to add an ActiveX id to the existing xml_progid array.
+   * In the event(unlikely) a new ActiveX id is introduced, it can be added
+   * without internal code modifications.
+   * @method setProgId
+   * @public
+   * @static
+   * @param {string} id The ActiveX id to be added to initialize the XHR object.
+   * @return void
+   */
+	setProgId:function(id)
+	{
+		this._msxml_progid.unshift(id);
+		YAHOO.log('ActiveX Program Id  ' + id + ' added to _msxml_progid.', 'info', 'Connection');
+	},
+
+  /**
+   * @description Member to override the default POST header.
+   * @method setDefaultPostHeader
+   * @public
+   * @static
+   * @param {boolean} b Set and use default header - true or false .
+   * @return void
+   */
+	setDefaultPostHeader:function(b)
+	{
+		if(typeof b == 'string'){
+			this._default_post_header = b;
+			YAHOO.log('Default POST header set to  ' + b, 'info', 'Connection');
+		}
+		else if(typeof b == 'boolean'){
+			this._use_default_post_header = b;
+		}
+	},
+
+  /**
+   * @description Member to override the default transaction header..
+   * @method setDefaultXhrHeader
+   * @public
+   * @static
+   * @param {boolean} b Set and use default header - true or false .
+   * @return void
+   */
+	setDefaultXhrHeader:function(b)
+	{
+		if(typeof b == 'string'){
+			this._default_xhr_header = b;
+			YAHOO.log('Default XHR header set to  ' + b, 'info', 'Connection');
+		}
+		else{
+			this._use_default_xhr_header = b;
+		}
+	},
+
+  /**
+   * @description Member to modify the default polling interval.
+   * @method setPollingInterval
+   * @public
+   * @static
+   * @param {int} i The polling interval in milliseconds.
+   * @return void
+   */
+	setPollingInterval:function(i)
+	{
+		if(typeof i == 'number' && isFinite(i)){
+			this._polling_interval = i;
+			YAHOO.log('Default polling interval set to ' + i +'ms', 'info', 'Connection');
+		}
+	},
+
+  /**
+   * @description Instantiates a XMLHttpRequest object and returns an object with two properties:
+   * the XMLHttpRequest instance and the transaction id.
+   * @method createXhrObject
+   * @private
+   * @static
+   * @param {int} transactionId Property containing the transaction id for this transaction.
+   * @return object
+   */
+	createXhrObject:function(transactionId)
+	{
+		var obj,http,i;
+		try
+		{
+			// Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
+			http = new XMLHttpRequest();
+			//  Object literal with http and tId properties
+			obj = { conn:http, tId:transactionId, xhr: true };
+			YAHOO.log('XHR object created for transaction ' + transactionId, 'info', 'Connection');
+		}
+		catch(e)
+		{
+			for(i=0; i<this._msxml_progid.length; ++i){
+				try
+				{
+					// Instantiates XMLHttpRequest for IE and assign to http
+					http = new ActiveXObject(this._msxml_progid[i]);
+					//  Object literal with conn and tId properties
+					obj = { conn:http, tId:transactionId, xhr: true };
+					YAHOO.log('ActiveX XHR object created for transaction ' + transactionId, 'info', 'Connection');
+					break;
+				}
+				catch(e1){}
+			}
+		}
+		finally
+		{
+			return obj;
+		}
+	},
+
+  /**
+   * @description This method is called by asyncRequest to create a
+   * valid connection object for the transaction.  It also passes a
+   * transaction id and increments the transaction id counter.
+   * @method getConnectionObject
+   * @private
+   * @static
+   * @return {object}
+   */
+	getConnectionObject:function(t)
+	{
+		var o, tId = this._transaction_id;
+
+		try
+		{
+			if(!t){
+				o = this.createXhrObject(tId);
+			}
+			else{
+				o = {tId:tId};
+				if(t==='xdr'){
+					o.conn = this._transport;
+					o.xdr = true;
+				}
+				else if(t==='upload'){
+					o.upload = true;
+				}
+			}
+
+			if(o){
+				this._transaction_id++;
+			}
+		}
+		catch(e){}
+		return o;
+	},
+
+  /**
+   * @description Method for initiating an asynchronous request via the XHR object.
+   * @method asyncRequest
+   * @public
+   * @static
+   * @param {string} method HTTP transaction method
+   * @param {string} uri Fully qualified path of resource
+   * @param {callback} callback User-defined callback function or object
+   * @param {string} postData POST body
+   * @return {object} Returns the connection object
+   */
+	asyncRequest:function(method, uri, callback, postData)
+	{
+		var o,t,args = (callback && callback.argument)?callback.argument:null;
+
+		if(this._isFileUpload){
+			t = 'upload';
+		}
+		else if(callback.xdr){
+			t = 'xdr';
+		}
+
+		o = this.getConnectionObject(t);
+		if(!o){
+			YAHOO.log('Unable to create connection object.', 'error', 'Connection');
+			return null;
+		}
+		else{
+
+			// Intialize any transaction-specific custom events, if provided.
+			if(callback && callback.customevents){
+				this.initCustomEvents(o, callback);
+			}
+
+			if(this._isFormSubmit){
+				if(this._isFileUpload){
+					this.uploadFile(o, callback, uri, postData);
+					return o;
+				}
+
+				// If the specified HTTP method is GET, setForm() will return an
+				// encoded string that is concatenated to the uri to
+				// create a querystring.
+				if(method.toUpperCase() == 'GET'){
+					if(this._sFormData.length !== 0){
+						// If the URI already contains a querystring, append an ampersand
+						// and then concatenate _sFormData to the URI.
+						uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
+					}
+				}
+				else if(method.toUpperCase() == 'POST'){
+					// If POST data exist in addition to the HTML form data,
+					// it will be concatenated to the form data.
+					postData = postData?this._sFormData + "&" + postData:this._sFormData;
+				}
+			}
+
+			if(method.toUpperCase() == 'GET' && (callback && callback.cache === false)){
+				// If callback.cache is defined and set to false, a
+				// timestamp value will be added to the querystring.
+				uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();
+			}
+
+			// Each transaction will automatically include a custom header of
+			// "X-Requested-With: XMLHttpRequest" to identify the request as
+			// having originated from Connection Manager.
+			if(this._use_default_xhr_header){
+				if(!this._default_headers['X-Requested-With']){
+					this.initHeader('X-Requested-With', this._default_xhr_header, true);
+					YAHOO.log('Initialize transaction header X-Request-Header to XMLHttpRequest.', 'info', 'Connection');
+				}
+			}
+
+			//If the transaction method is POST and the POST header value is set to true
+			//or a custom value, initalize the Content-Type header to this value.
+			if((method.toUpperCase() === 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
+				this.initHeader('Content-Type', this._default_post_header);
+				YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.', 'info', 'Connection');
+			}
+
+			if(o.xdr){
+				this.xdr(o, method, uri, callback, postData);
+				return o;
+			}
+
+			o.conn.open(method, uri, true);
+			//Initialize all default and custom HTTP headers,
+			if(this._has_default_headers || this._has_http_headers){
+				this.setHeader(o);
+			}
+
+			this.handleReadyState(o, callback);
+			o.conn.send(postData || '');
+			YAHOO.log('Transaction ' + o.tId + ' sent.', 'info', 'Connection');
+
+			// Reset the HTML form data and state properties as
+			// soon as the data are submitted.
+			if(this._isFormSubmit === true){
+				this.resetFormState();
+			}
+
+			// Fire global custom event -- startEvent
+			this.startEvent.fire(o, args);
+
+			if(o.startEvent){
+				// Fire transaction custom event -- startEvent
+				o.startEvent.fire(o, args);
+			}
+
+			return o;
+		}
+	},
+
+  /**
+   * @description This method creates and subscribes custom events,
+   * specific to each transaction
+   * @method initCustomEvents
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {callback} callback The user-defined callback object
+   * @return {void}
+   */
+	initCustomEvents:function(o, callback)
+	{
+		var prop;
+		// Enumerate through callback.customevents members and bind/subscribe
+		// events that match in the _customEvents table.
+		for(prop in callback.customevents){
+			if(this._customEvents[prop][0]){
+				// Create the custom event
+				o[this._customEvents[prop][0]] = new YAHOO.util.CustomEvent(this._customEvents[prop][1], (callback.scope)?callback.scope:null);
+				YAHOO.log('Transaction-specific Custom Event ' + o[this._customEvents[prop][1]] + ' created.', 'info', 'Connection');
+
+				// Subscribe the custom event
+				o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);
+				YAHOO.log('Transaction-specific Custom Event ' + o[this._customEvents[prop][1]] + ' subscribed.', 'info', 'Connection');
+			}
+		}
+	},
+
+  /**
+   * @description This method serves as a timer that polls the XHR object's readyState
+   * property during a transaction, instead of binding a callback to the
+   * onreadystatechange event.  Upon readyState 4, handleTransactionResponse
+   * will process the response, and the timer will be cleared.
+   * @method handleReadyState
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {callback} callback The user-defined callback object
+   * @return {void}
+   */
+
+    handleReadyState:function(o, callback)
+
+    {
+		var oConn = this,
+			args = (callback && callback.argument)?callback.argument:null;
+
+		if(callback && callback.timeout){
+			this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
+		}
+
+		this._poll[o.tId] = window.setInterval(
+			function(){
+				if(o.conn && o.conn.readyState === 4){
+
+					// Clear the polling interval for the transaction
+					// and remove the reference from _poll.
+					window.clearInterval(oConn._poll[o.tId]);
+					delete oConn._poll[o.tId];
+
+					if(callback && callback.timeout){
+						window.clearTimeout(oConn._timeOut[o.tId]);
+						delete oConn._timeOut[o.tId];
+					}
+
+					// Fire global custom event -- completeEvent
+					oConn.completeEvent.fire(o, args);
+
+					if(o.completeEvent){
+						// Fire transaction custom event -- completeEvent
+						o.completeEvent.fire(o, args);
+					}
+
+					oConn.handleTransactionResponse(o, callback);
+				}
+			}
+		,this._polling_interval);
+    },
+
+  /**
+   * @description This method attempts to interpret the server response and
+   * determine whether the transaction was successful, or if an error or
+   * exception was encountered.
+   * @method handleTransactionResponse
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {object} callback The user-defined callback object
+   * @param {boolean} isAbort Determines if the transaction was terminated via abort().
+   * @return {void}
+   */
+    handleTransactionResponse:function(o, callback, isAbort)
+    {
+		var httpStatus, responseObject,
+			args = (callback && callback.argument)?callback.argument:null,
+			xdrS = (o.r && o.r.statusText === 'xdr:success')?true:false,
+			xdrF = (o.r && o.r.statusText === 'xdr:failure')?true:false,
+			xdrA = isAbort;
+
+		try
+		{
+			if((o.conn.status !== undefined && o.conn.status !== 0) || xdrS){
+				// XDR requests will not have HTTP status defined. The
+				// statusText property will define the response status
+				// set by the Flash transport.
+				httpStatus = o.conn.status;
+			}
+			else if(xdrF && !xdrA){
+				// Set XDR transaction failure to a status of 0, which
+				// resolves as an HTTP failure, instead of an exception.
+				httpStatus = 0;
+			}
+			else{
+				httpStatus = 13030;
+			}
+		}
+		catch(e){
+
+			 // 13030 is a custom code to indicate the condition -- in Mozilla/FF --
+			 // when the XHR object's status and statusText properties are
+			 // unavailable, and a query attempt throws an exception.
+			httpStatus = 13030;
+		}
+
+		if((httpStatus >= 200 && httpStatus < 300) || httpStatus === 1223 || xdrS){
+			responseObject = o.xdr ? o.r : this.createResponseObject(o, args);
+			if(callback && callback.success){
+				if(!callback.scope){
+					callback.success(responseObject);
+					YAHOO.log('Success callback. HTTP code is ' + httpStatus, 'info', 'Connection');
+				}
+				else{
+					// If a scope property is defined, the callback will be fired from
+					// the context of the object.
+					callback.success.apply(callback.scope, [responseObject]);
+					YAHOO.log('Success callback with scope. HTTP code is ' + httpStatus, 'info', 'Connection');
+				}
+			}
+
+			// Fire global custom event -- successEvent
+			this.successEvent.fire(responseObject);
+
+			if(o.successEvent){
+				// Fire transaction custom event -- successEvent
+				o.successEvent.fire(responseObject);
+			}
+		}
+		else{
+			switch(httpStatus){
+				// The following cases are wininet.dll error codes that may be encountered.
+				case 12002: // Server timeout
+				case 12029: // 12029 to 12031 correspond to dropped connections.
+				case 12030:
+				case 12031:
+				case 12152: // Connection closed by server.
+				case 13030: // See above comments for variable status.
+					// XDR transactions will not resolve to this case, since the
+					// response object is already built in the xdr response.
+					responseObject = this.createExceptionObject(o.tId, args, (isAbort?isAbort:false));
+					if(callback && callback.failure){
+						if(!callback.scope){
+							callback.failure(responseObject);
+							YAHOO.log('Failure callback. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');
+						}
+						else{
+							callback.failure.apply(callback.scope, [responseObject]);
+							YAHOO.log('Failure callback with scope. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');
+						}
+					}
+
+					break;
+				default:
+					responseObject = (o.xdr) ? o.response : this.createResponseObject(o, args);
+					if(callback && callback.failure){
+						if(!callback.scope){
+							callback.failure(responseObject);
+							YAHOO.log('Failure callback. HTTP status code is ' + httpStatus, 'warn', 'Connection');
+						}
+						else{
+							callback.failure.apply(callback.scope, [responseObject]);
+							YAHOO.log('Failure callback with scope. HTTP status code is ' + httpStatus, 'warn', 'Connection');
+						}
+					}
+			}
+
+			// Fire global custom event -- failureEvent
+			this.failureEvent.fire(responseObject);
+
+			if(o.failureEvent){
+				// Fire transaction custom event -- failureEvent
+				o.failureEvent.fire(responseObject);
+			}
+
+		}
+
+		this.releaseObject(o);
+		responseObject = null;
+    },
+
+  /**
+   * @description This method evaluates the server response, creates and returns the results via
+   * its properties.  Success and failure cases will differ in the response
+   * object's property values.
+   * @method createResponseObject
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
+   * @return {object}
+   */
+    createResponseObject:function(o, callbackArg)
+    {
+		var obj = {}, headerObj = {},
+			i, headerStr, header, delimitPos;
+
+		try
+		{
+			headerStr = o.conn.getAllResponseHeaders();
+			header = headerStr.split('\n');
+			for(i=0; i<header.length; i++){
+				delimitPos = header[i].indexOf(':');
+				if(delimitPos != -1){
+					headerObj[header[i].substring(0,delimitPos)] = YAHOO.lang.trim(header[i].substring(delimitPos+2));
+				}
+			}
+		}
+		catch(e){}
+
+		obj.tId = o.tId;
+		// Normalize IE's response to HTTP 204 when Win error 1223.
+		obj.status = (o.conn.status == 1223)?204:o.conn.status;
+		// Normalize IE's statusText to "No Content" instead of "Unknown".
+		obj.statusText = (o.conn.status == 1223)?"No Content":o.conn.statusText;
+		obj.getResponseHeader = headerObj;
+		obj.getAllResponseHeaders = headerStr;
+		obj.responseText = o.conn.responseText;
+		obj.responseXML = o.conn.responseXML;
+
+		if(callbackArg){
+			obj.argument = callbackArg;
+		}
+
+		return obj;
+    },
+
+  /**
+   * @description If a transaction cannot be completed due to dropped or closed connections,
+   * there may be not be enough information to build a full response object.
+   * The failure callback will be fired and this specific condition can be identified
+   * by a status property value of 0.
+   *
+   * If an abort was successful, the status property will report a value of -1.
+   *
+   * @method createExceptionObject
+   * @private
+   * @static
+   * @param {int} tId The Transaction Id
+   * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
+   * @param {boolean} isAbort Determines if the exception case is caused by a transaction abort
+   * @return {object}
+   */
+    createExceptionObject:function(tId, callbackArg, isAbort)
+    {
+		var COMM_CODE = 0,
+			COMM_ERROR = 'communication failure',
+			ABORT_CODE = -1,
+			ABORT_ERROR = 'transaction aborted',
+			obj = {};
+
+		obj.tId = tId;
+		if(isAbort){
+			obj.status = ABORT_CODE;
+			obj.statusText = ABORT_ERROR;
+		}
+		else{
+			obj.status = COMM_CODE;
+			obj.statusText = COMM_ERROR;
+		}
+
+		if(callbackArg){
+			obj.argument = callbackArg;
+		}
+
+		return obj;
+    },
+
+  /**
+   * @description Method that initializes the custom HTTP headers for the each transaction.
+   * @method initHeader
+   * @public
+   * @static
+   * @param {string} label The HTTP header label
+   * @param {string} value The HTTP header value
+   * @param {string} isDefault Determines if the specific header is a default header
+   * automatically sent with each transaction.
+   * @return {void}
+   */
+	initHeader:function(label, value, isDefault)
+	{
+		var headerObj = (isDefault)?this._default_headers:this._http_headers;
+
+		headerObj[label] = value;
+		if(isDefault){
+			this._has_default_headers = true;
+		}
+		else{
+			this._has_http_headers = true;
+		}
+	},
+
+
+  /**
+   * @description Accessor that sets the HTTP headers for each transaction.
+   * @method setHeader
+   * @private
+   * @static
+   * @param {object} o The connection object for the transaction.
+   * @return {void}
+   */
+	setHeader:function(o)
+	{
+		var prop;
+		if(this._has_default_headers){
+			for(prop in this._default_headers){
+				if(YAHOO.lang.hasOwnProperty(this._default_headers, prop)){
+					o.conn.setRequestHeader(prop, this._default_headers[prop]);
+					YAHOO.log('Default HTTP header ' + prop + ' set with value of ' + this._default_headers[prop], 'info', 'Connection');
+				}
+			}
+		}
+
+		if(this._has_http_headers){
+			for(prop in this._http_headers){
+				if(YAHOO.lang.hasOwnProperty(this._http_headers, prop)){
+					o.conn.setRequestHeader(prop, this._http_headers[prop]);
+					YAHOO.log('HTTP header ' + prop + ' set with value of ' + this._http_headers[prop], 'info', 'Connection');
+				}
+			}
+
+			this._http_headers = {};
+			this._has_http_headers = false;
+		}
+	},
+
+  /**
+   * @description Resets the default HTTP headers object
+   * @method resetDefaultHeaders
+   * @public
+   * @static
+   * @return {void}
+   */
+	resetDefaultHeaders:function(){
+		this._default_headers = {};
+		this._has_default_headers = false;
+	},
+
+  /**
+   * @description Method to terminate a transaction, if it has not reached readyState 4.
+   * @method abort
+   * @public
+   * @static
+   * @param {object} o The connection object returned by asyncRequest.
+   * @param {object} callback  User-defined callback object.
+   * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout.
+   * @return {boolean}
+   */
+	abort:function(o, callback, isTimeout)
+	{
+		var abortStatus,
+			args = (callback && callback.argument)?callback.argument:null;
+			o = o || {};
+
+		if(o.conn){
+			if(o.xhr){
+				if(this.isCallInProgress(o)){
+					// Issue abort request
+					o.conn.abort();
+
+					window.clearInterval(this._poll[o.tId]);
+					delete this._poll[o.tId];
+
+					if(isTimeout){
+						window.clearTimeout(this._timeOut[o.tId]);
+						delete this._timeOut[o.tId];
+					}
+
+					abortStatus = true;
+				}
+			}
+			else if(o.xdr){
+				o.conn.abort(o.tId);
+				abortStatus = true;
+			}
+		}
+		else if(o.upload){
+			var frameId = 'yuiIO' + o.tId;
+			var io = document.getElementById(frameId);
+
+			if(io){
+				// Remove all listeners on the iframe prior to
+				// its destruction.
+				YAHOO.util.Event.removeListener(io, "load");
+				// Destroy the iframe facilitating the transaction.
+				document.body.removeChild(io);
+				YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
+
+				if(isTimeout){
+					window.clearTimeout(this._timeOut[o.tId]);
+					delete this._timeOut[o.tId];
+				}
+
+				abortStatus = true;
+			}
+		}
+		else{
+			abortStatus = false;
+		}
+
+		if(abortStatus === true){
+			// Fire global custom event -- abortEvent
+			this.abortEvent.fire(o, args);
+
+			if(o.abortEvent){
+				// Fire transaction custom event -- abortEvent
+				o.abortEvent.fire(o, args);
+			}
+
+			this.handleTransactionResponse(o, callback, true);
+			YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');
+		}
+
+		return abortStatus;
+	},
+
+  /**
+   * @description Determines if the transaction is still being processed.
+   * @method isCallInProgress
+   * @public
+   * @static
+   * @param {object} o The connection object returned by asyncRequest
+   * @return {boolean}
+   */
+	isCallInProgress:function(o)
+	{
+		o = o || {};
+		// if the XHR object assigned to the transaction has not been dereferenced,
+		// then check its readyState status.  Otherwise, return false.
+		if(o.xhr && o.conn){
+			return o.conn.readyState !== 4 && o.conn.readyState !== 0;
+		}
+		else if(o.xdr && o.conn){
+			return o.conn.isCallInProgress(o.tId);
+		}
+		else if(o.upload === true){
+			return document.getElementById('yuiIO' + o.tId)?true:false;
+		}
+		else{
+			return false;
+		}
+	},
+
+  /**
+   * @description Dereference the XHR instance and the connection object after the transaction is completed.
+   * @method releaseObject
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @return {void}
+   */
+	releaseObject:function(o)
+	{
+		if(o && o.conn){
+			//dereference the XHR instance.
+			o.conn = null;
+
+			YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
+
+			//dereference the connection object.
+			o = null;
+		}
+	}
+};
+
+YAHOO.register("connection_core", YAHOO.util.Connect, {version: "2.8.0r4", build: "2449"});

Property changes on: branches/2.8.x/wb/include/yui/connection/connection_core-debug.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/2.8.x/wb/include/yui/connection/connection.js
===================================================================
--- branches/2.8.x/wb/include/yui/connection/connection.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/connection/connection.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 /**
  * The Connection Manager provides a simplified interface to the XMLHttpRequest
@@ -131,46 +131,6 @@
     _default_headers:{},
 
  /**
-  * @description Property modified by setForm() to determine if the data
-  * should be submitted as an HTML form.
-  * @property _isFormSubmit
-  * @private
-  * @static
-  * @type boolean
-  */
-    _isFormSubmit:false,
-
- /**
-  * @description Property modified by setForm() to determine if a file(s)
-  * upload is expected.
-  * @property _isFileUpload
-  * @private
-  * @static
-  * @type boolean
-  */
-    _isFileUpload:false,
-
- /**
-  * @description Property modified by setForm() to set a reference to the HTML
-  * form node if the desired action is file upload.
-  * @property _formNode
-  * @private
-  * @static
-  * @type object
-  */
-    _formNode:null,
-
- /**
-  * @description Property modified by setForm() to set the HTML form data
-  * for each transaction.
-  * @property _sFormData
-  * @private
-  * @static
-  * @type string
-  */
-    _sFormData:null,
-
- /**
   * @description Collection of polling references to the polling mechanism in handleReadyState.
   * @property _poll
   * @private
@@ -209,42 +169,6 @@
      _transaction_id:0,
 
   /**
-   * @description Tracks the name-value pair of the "clicked" submit button if multiple submit
-   * buttons are present in an HTML form; and, if YAHOO.util.Event is available.
-   * @property _submitElementValue
-   * @private
-   * @static
-   * @type string
-   */
-	 _submitElementValue:null,
-
-  /**
-   * @description Determines whether YAHOO.util.Event is available and returns true or false.
-   * If true, an event listener is bound at the document level to trap click events that
-   * resolve to a target type of "Submit".  This listener will enable setForm() to determine
-   * the clicked "Submit" value in a multi-Submit button, HTML form.
-   * @property _hasSubmitListener
-   * @private
-   * @static
-   */
-	 _hasSubmitListener:(function()
-	 {
-		if(YAHOO.util.Event){
-			YAHOO.util.Event.addListener(
-				document,
-				'click',
-				function(e){
-					var obj = YAHOO.util.Event.getTarget(e);
-					if(obj.type && obj.type.toLowerCase() == 'submit'){
-						YAHOO.util.Connect._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
-					}
-				});
-			return true;
-	    }
-	    return false;
-	 })(),
-
-  /**
    * @description Custom event that fires at the start of a transaction
    * @property startEvent
    * @private
@@ -283,16 +207,6 @@
 	failureEvent: new YAHOO.util.CustomEvent('failure'),
 
   /**
-   * @description Custom event that fires when handleTransactionResponse() determines a
-   * response in the HTTP 4xx/5xx range.
-   * @property failureEvent
-   * @private
-   * @static
-   * @type CustomEvent
-   */
-	uploadEvent: new YAHOO.util.CustomEvent('upload'),
-
-  /**
    * @description Custom event that fires when a transaction is successfully aborted.
    * @property abortEvent
    * @private
@@ -396,26 +310,26 @@
    */
 	createXhrObject:function(transactionId)
 	{
-		var obj,http;
+		var obj,http,i;
 		try
 		{
 			// Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
 			http = new XMLHttpRequest();
 			//  Object literal with http and tId properties
-			obj = { conn:http, tId:transactionId };
+			obj = { conn:http, tId:transactionId, xhr: true };
 		}
 		catch(e)
 		{
-			for(var i=0; i<this._msxml_progid.length; ++i){
+			for(i=0; i<this._msxml_progid.length; ++i){
 				try
 				{
 					// Instantiates XMLHttpRequest for IE and assign to http
 					http = new ActiveXObject(this._msxml_progid[i]);
 					//  Object literal with conn and tId properties
-					obj = { conn:http, tId:transactionId };
+					obj = { conn:http, tId:transactionId, xhr: true };
 					break;
 				}
-				catch(e){}
+				catch(e1){}
 			}
 		}
 		finally
@@ -433,20 +347,24 @@
    * @static
    * @return {object}
    */
-	getConnectionObject:function(isFileUpload)
+	getConnectionObject:function(t)
 	{
-		var o;
-		var tId = this._transaction_id;
+		var o, tId = this._transaction_id;
 
 		try
 		{
-			if(!isFileUpload){
+			if(!t){
 				o = this.createXhrObject(tId);
 			}
 			else{
-				o = {};
-				o.tId = tId;
-				o.isUpload = true;
+				o = {tId:tId};
+				if(t==='xdr'){
+					o.conn = this._transport;
+					o.xdr = true;
+				}
+				else if(t==='upload'){
+					o.upload = true;
+				}
 			}
 
 			if(o){
@@ -454,10 +372,7 @@
 			}
 		}
 		catch(e){}
-		finally
-		{
-			return o;
-		}
+		return o;
 	},
 
   /**
@@ -473,9 +388,16 @@
    */
 	asyncRequest:function(method, uri, callback, postData)
 	{
-		var o = (this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();
-		var args = (callback && callback.argument)?callback.argument:null;
+		var o,t,args = (callback && callback.argument)?callback.argument:null;
 
+		if(this._isFileUpload){
+			t = 'upload';
+		}
+		else if(callback.xdr){
+			t = 'xdr';
+		}
+
+		o = this.getConnectionObject(t);
 		if(!o){
 			return null;
 		}
@@ -515,8 +437,6 @@
 				uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();
 			}
 
-			o.conn.open(method, uri, true);
-
 			// Each transaction will automatically include a custom header of
 			// "X-Requested-With: XMLHttpRequest" to identify the request as
 			// having originated from Connection Manager.
@@ -528,10 +448,16 @@
 
 			//If the transaction method is POST and the POST header value is set to true
 			//or a custom value, initalize the Content-Type header to this value.
-			if((method.toUpperCase() == 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
+			if((method.toUpperCase() === 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
 				this.initHeader('Content-Type', this._default_post_header);
 			}
 
+			if(o.xdr){
+				this.xdr(o, method, uri, callback, postData);
+				return o;
+			}
+
+			o.conn.open(method, uri, true);
 			//Initialize all default and custom HTTP headers,
 			if(this._has_default_headers || this._has_http_headers){
 				this.setHeader(o);
@@ -538,9 +464,8 @@
 			}
 
 			this.handleReadyState(o, callback);
-			o.conn.send(postData || null);
+			o.conn.send(postData || '');
 
-
 			// Reset the HTML form data and state properties as
 			// soon as the data are submitted.
 			if(this._isFormSubmit === true){
@@ -571,9 +496,10 @@
    */
 	initCustomEvents:function(o, callback)
 	{
+		var prop;
 		// Enumerate through callback.customevents members and bind/subscribe
 		// events that match in the _customEvents table.
-		for(var prop in callback.customevents){
+		for(prop in callback.customevents){
 			if(this._customEvents[prop][0]){
 				// Create the custom event
 				o[this._customEvents[prop][0]] = new YAHOO.util.CustomEvent(this._customEvents[prop][1], (callback.scope)?callback.scope:null);
@@ -600,8 +526,8 @@
     handleReadyState:function(o, callback)
 
     {
-		var oConn = this;
-		var args = (callback && callback.argument)?callback.argument:null;
+		var oConn = this,
+			args = (callback && callback.argument)?callback.argument:null;
 
 		if(callback && callback.timeout){
 			this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
@@ -649,14 +575,25 @@
    */
     handleTransactionResponse:function(o, callback, isAbort)
     {
-		var httpStatus, responseObject;
-		var args = (callback && callback.argument)?callback.argument:null;
+		var httpStatus, responseObject,
+			args = (callback && callback.argument)?callback.argument:null,
+			xdrS = (o.r && o.r.statusText === 'xdr:success')?true:false,
+			xdrF = (o.r && o.r.statusText === 'xdr:failure')?true:false,
+			xdrA = isAbort;
 
 		try
 		{
-			if(o.conn.status !== undefined && o.conn.status !== 0){
+			if((o.conn.status !== undefined && o.conn.status !== 0) || xdrS){
+				// XDR requests will not have HTTP status defined. The
+				// statusText property will define the response status
+				// set by the Flash transport.
 				httpStatus = o.conn.status;
 			}
+			else if(xdrF && !xdrA){
+				// Set XDR transaction failure to a status of 0, which
+				// resolves as an HTTP failure, instead of an exception.
+				httpStatus = 0;
+			}
 			else{
 				httpStatus = 13030;
 			}
@@ -669,8 +606,8 @@
 			httpStatus = 13030;
 		}
 
-		if(httpStatus >= 200 && httpStatus < 300 || httpStatus === 1223){
-			responseObject = this.createResponseObject(o, args);
+		if((httpStatus >= 200 && httpStatus < 300) || httpStatus === 1223 || xdrS){
+			responseObject = o.xdr ? o.r : this.createResponseObject(o, args);
 			if(callback && callback.success){
 				if(!callback.scope){
 					callback.success(responseObject);
@@ -699,6 +636,8 @@
 				case 12031:
 				case 12152: // Connection closed by server.
 				case 13030: // See above comments for variable status.
+					// XDR transactions will not resolve to this case, since the
+					// response object is already built in the xdr response.
 					responseObject = this.createExceptionObject(o.tId, args, (isAbort?isAbort:false));
 					if(callback && callback.failure){
 						if(!callback.scope){
@@ -711,7 +650,7 @@
 
 					break;
 				default:
-					responseObject = this.createResponseObject(o, args);
+					responseObject = (o.xdr) ? o.response : this.createResponseObject(o, args);
 					if(callback && callback.failure){
 						if(!callback.scope){
 							callback.failure(responseObject);
@@ -749,17 +688,17 @@
    */
     createResponseObject:function(o, callbackArg)
     {
-		var obj = {};
-		var headerObj = {};
+		var obj = {}, headerObj = {},
+			i, headerStr, header, delimitPos;
 
 		try
 		{
-			var headerStr = o.conn.getAllResponseHeaders();
-			var header = headerStr.split('\n');
-			for(var i=0; i<header.length; i++){
-				var delimitPos = header[i].indexOf(':');
+			headerStr = o.conn.getAllResponseHeaders();
+			header = headerStr.split('\n');
+			for(i=0; i<header.length; i++){
+				delimitPos = header[i].indexOf(':');
 				if(delimitPos != -1){
-					headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+2);
+					headerObj[header[i].substring(0,delimitPos)] = YAHOO.lang.trim(header[i].substring(delimitPos+2));
 				}
 			}
 		}
@@ -800,13 +739,12 @@
    */
     createExceptionObject:function(tId, callbackArg, isAbort)
     {
-		var COMM_CODE = 0;
-		var COMM_ERROR = 'communication failure';
-		var ABORT_CODE = -1;
-		var ABORT_ERROR = 'transaction aborted';
+		var COMM_CODE = 0,
+			COMM_ERROR = 'communication failure',
+			ABORT_CODE = -1,
+			ABORT_ERROR = 'transaction aborted',
+			obj = {};
 
-		var obj = {};
-
 		obj.tId = tId;
 		if(isAbort){
 			obj.status = ABORT_CODE;
@@ -838,8 +776,8 @@
 	initHeader:function(label, value, isDefault)
 	{
 		var headerObj = (isDefault)?this._default_headers:this._http_headers;
+
 		headerObj[label] = value;
-
 		if(isDefault){
 			this._has_default_headers = true;
 		}
@@ -859,8 +797,9 @@
    */
 	setHeader:function(o)
 	{
+		var prop;
 		if(this._has_default_headers){
-			for(var prop in this._default_headers){
+			for(prop in this._default_headers){
 				if(YAHOO.lang.hasOwnProperty(this._default_headers, prop)){
 					o.conn.setRequestHeader(prop, this._default_headers[prop]);
 				}
@@ -868,12 +807,11 @@
 		}
 
 		if(this._has_http_headers){
-			for(var prop in this._http_headers){
+			for(prop in this._http_headers){
 				if(YAHOO.lang.hasOwnProperty(this._http_headers, prop)){
 					o.conn.setRequestHeader(prop, this._http_headers[prop]);
 				}
 			}
-			delete this._http_headers;
 
 			this._http_headers = {};
 			this._has_http_headers = false;
@@ -888,12 +826,356 @@
    * @return {void}
    */
 	resetDefaultHeaders:function(){
-		delete this._default_headers;
 		this._default_headers = {};
 		this._has_default_headers = false;
 	},
 
   /**
+   * @description Method to terminate a transaction, if it has not reached readyState 4.
+   * @method abort
+   * @public
+   * @static
+   * @param {object} o The connection object returned by asyncRequest.
+   * @param {object} callback  User-defined callback object.
+   * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout.
+   * @return {boolean}
+   */
+	abort:function(o, callback, isTimeout)
+	{
+		var abortStatus,
+			args = (callback && callback.argument)?callback.argument:null;
+			o = o || {};
+
+		if(o.conn){
+			if(o.xhr){
+				if(this.isCallInProgress(o)){
+					// Issue abort request
+					o.conn.abort();
+
+					window.clearInterval(this._poll[o.tId]);
+					delete this._poll[o.tId];
+
+					if(isTimeout){
+						window.clearTimeout(this._timeOut[o.tId]);
+						delete this._timeOut[o.tId];
+					}
+
+					abortStatus = true;
+				}
+			}
+			else if(o.xdr){
+				o.conn.abort(o.tId);
+				abortStatus = true;
+			}
+		}
+		else if(o.upload){
+			var frameId = 'yuiIO' + o.tId;
+			var io = document.getElementById(frameId);
+
+			if(io){
+				// Remove all listeners on the iframe prior to
+				// its destruction.
+				YAHOO.util.Event.removeListener(io, "load");
+				// Destroy the iframe facilitating the transaction.
+				document.body.removeChild(io);
+
+				if(isTimeout){
+					window.clearTimeout(this._timeOut[o.tId]);
+					delete this._timeOut[o.tId];
+				}
+
+				abortStatus = true;
+			}
+		}
+		else{
+			abortStatus = false;
+		}
+
+		if(abortStatus === true){
+			// Fire global custom event -- abortEvent
+			this.abortEvent.fire(o, args);
+
+			if(o.abortEvent){
+				// Fire transaction custom event -- abortEvent
+				o.abortEvent.fire(o, args);
+			}
+
+			this.handleTransactionResponse(o, callback, true);
+		}
+
+		return abortStatus;
+	},
+
+  /**
+   * @description Determines if the transaction is still being processed.
+   * @method isCallInProgress
+   * @public
+   * @static
+   * @param {object} o The connection object returned by asyncRequest
+   * @return {boolean}
+   */
+	isCallInProgress:function(o)
+	{
+		o = o || {};
+		// if the XHR object assigned to the transaction has not been dereferenced,
+		// then check its readyState status.  Otherwise, return false.
+		if(o.xhr && o.conn){
+			return o.conn.readyState !== 4 && o.conn.readyState !== 0;
+		}
+		else if(o.xdr && o.conn){
+			return o.conn.isCallInProgress(o.tId);
+		}
+		else if(o.upload === true){
+			return document.getElementById('yuiIO' + o.tId)?true:false;
+		}
+		else{
+			return false;
+		}
+	},
+
+  /**
+   * @description Dereference the XHR instance and the connection object after the transaction is completed.
+   * @method releaseObject
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @return {void}
+   */
+	releaseObject:function(o)
+	{
+		if(o && o.conn){
+			//dereference the XHR instance.
+			o.conn = null;
+
+
+			//dereference the connection object.
+			o = null;
+		}
+	}
+};
+
+/**
+  * @for Connect
+  */
+(function() {
+	var YCM = YAHOO.util.Connect, _fn = {};
+
+   /**
+    * @description This method creates and instantiates the Flash transport.
+    * @method _swf
+    * @private
+    * @static
+    * @param {string} URI to connection.swf.
+    * @return {void}
+    */
+	function _swf(uri) {
+		var o = '<object id="YUIConnectionSwf" type="application/x-shockwave-flash" data="' +
+		        uri + '" width="0" height="0">' +
+		     	'<param name="movie" value="' + uri + '">' +
+                '<param name="allowScriptAccess" value="always">' +
+		    	'</object>',
+		    c = document.createElement('div');
+
+		document.body.appendChild(c);
+		c.innerHTML = o;
+	}
+
+   /**
+    * @description This method calls the public method on the
+    * Flash transport to start the XDR transaction.  It is analogous
+    * to Connection Manager's asyncRequest method.
+    * @method xdr
+    * @private
+    * @static
+    * @param {object} The transaction object.
+    * @param {string} HTTP request method.
+    * @param {string} URI for the transaction.
+    * @param {object} The transaction's callback object.
+    * @param {object} The JSON object used as HTTP POST data.
+    * @return {void}
+    */
+	function _xdr(o, m, u, c, d) {
+		_fn[parseInt(o.tId)] = { 'o':o, 'c':c };
+		if (d) {
+			c.method = m;
+			c.data = d;
+		}
+
+		o.conn.send(u, c, o.tId);
+	}
+
+   /**
+    * @description This method instantiates the Flash transport and
+    * establishes a static reference to it, used for all XDR requests.
+    * @method transport
+    * @public
+    * @static
+    * @param {string} URI to connection.swf.
+    * @return {void}
+    */
+	function _init(uri) {
+		_swf(uri);
+		YCM._transport = document.getElementById('YUIConnectionSwf');
+	}
+
+	function _xdrReady() {
+		YCM.xdrReadyEvent.fire();
+	}
+
+   /**
+    * @description This method fires the global and transaction start
+    * events.
+    * @method _xdrStart
+    * @private
+    * @static
+    * @param {object} The transaction object.
+    * @param {string} The transaction's callback object.
+    * @return {void}
+    */
+	function _xdrStart(o, cb) {
+		if (o) {
+			// Fire global custom event -- startEvent
+			YCM.startEvent.fire(o, cb.argument);
+
+			if(o.startEvent){
+				// Fire transaction custom event -- startEvent
+				o.startEvent.fire(o, cb.argument);
+			}
+		}
+	}
+
+   /**
+    * @description This method is the initial response handler
+    * for XDR transactions.  The Flash transport calls this
+    * function and sends the response payload.
+    * @method handleXdrResponse
+    * @private
+    * @static
+    * @param {object} The response object sent from the Flash transport.
+    * @return {void}
+    */
+	function _handleXdrResponse(r) {
+		var o = _fn[r.tId].o,
+			cb = _fn[r.tId].c;
+
+		if (r.statusText === 'xdr:start') {
+			_xdrStart(o, cb);
+			return;
+		}
+
+		r.responseText = decodeURI(r.responseText);
+		o.r = r;
+		if (cb.argument) {
+			o.r.argument = cb.argument;
+		}
+
+		this.handleTransactionResponse(o, cb, r.statusText === 'xdr:abort' ? true : false);
+		delete _fn[r.tId];
+	}
+
+	// Bind the functions to Connection Manager as static fields.
+	YCM.xdr = _xdr;
+	YCM.swf = _swf;
+	YCM.transport = _init;
+	YCM.xdrReadyEvent = new YAHOO.util.CustomEvent('xdrReady');
+	YCM.xdrReady = _xdrReady;
+	YCM.handleXdrResponse = _handleXdrResponse;
+})();
+
+/**
+  * @for Connect
+  */
+(function(){
+	var YCM = YAHOO.util.Connect,
+		YE = YAHOO.util.Event;
+   /**
+	* @description Property modified by setForm() to determine if the data
+	* should be submitted as an HTML form.
+	* @property _isFormSubmit
+	* @private
+	* @static
+	* @type boolean
+	*/
+	YCM._isFormSubmit = false;
+
+   /**
+	* @description Property modified by setForm() to determine if a file(s)
+	* upload is expected.
+	* @property _isFileUpload
+	* @private
+	* @static
+	* @type boolean
+	*/
+	YCM._isFileUpload = false;
+
+   /**
+	* @description Property modified by setForm() to set a reference to the HTML
+	* form node if the desired action is file upload.
+	* @property _formNode
+	* @private
+	* @static
+	* @type object
+	*/
+	YCM._formNode = null;
+
+   /**
+	* @description Property modified by setForm() to set the HTML form data
+	* for each transaction.
+	* @property _sFormData
+	* @private
+	* @static
+	* @type string
+	*/
+	YCM._sFormData = null;
+
+   /**
+	* @description Tracks the name-value pair of the "clicked" submit button if multiple submit
+	* buttons are present in an HTML form; and, if YAHOO.util.Event is available.
+	* @property _submitElementValue
+	* @private
+	* @static
+	* @type string
+	*/
+	YCM._submitElementValue = null;
+
+   /**
+    * @description Custom event that fires when handleTransactionResponse() determines a
+    * response in the HTTP 4xx/5xx range.
+    * @property failureEvent
+    * @private
+    * @static
+    * @type CustomEvent
+    */
+	YCM.uploadEvent = new YAHOO.util.CustomEvent('upload'),
+
+   /**
+	* @description Determines whether YAHOO.util.Event is available and returns true or false.
+	* If true, an event listener is bound at the document level to trap click events that
+	* resolve to a target type of "Submit".  This listener will enable setForm() to determine
+	* the clicked "Submit" value in a multi-Submit button, HTML form.
+	* @property _hasSubmitListener
+	* @private
+	* @static
+	*/
+	YCM._hasSubmitListener = function() {
+		if(YE){
+			YE.addListener(
+				document,
+				'click',
+				function(e){
+					var obj = YE.getTarget(e),
+						name = obj.nodeName.toLowerCase();
+
+					if((name === 'input' || name === 'button') && (obj.type && obj.type.toLowerCase() == 'submit')){
+						YCM._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
+					}
+				});
+			return true;
+		}
+		return false;
+	}();
+
+  /**
    * @description This method assembles the form label and value pairs and
    * constructs an encoded string.
    * asyncRequest() will automatically initialize the transaction with a
@@ -906,16 +1188,19 @@
    * @param {boolean} optional enable file upload over SSL in IE only.
    * @return {string} string of the HTML form field name and value pairs..
    */
-	setForm:function(formId, isUpload, secureUri)
+	function _setForm(formId, isUpload, secureUri)
 	{
-		// reset the HTML form data and state properties
+		var oForm, oElement, oName, oValue, oDisabled,
+			hasSubmit = false,
+			data = [], item = 0,
+			i,len,j,jlen,opt;
+
 		this.resetFormState();
 
-		var oForm;
 		if(typeof formId == 'string'){
 			// Determine if the argument is a form id or a form name.
-			// Note form name usage is deprecated, but supported
-			// here for backward compatibility.
+			// Note form name usage is deprecated by supported
+			// here for legacy reasons.
 			oForm = (document.getElementById(formId) || document.forms[formId]);
 		}
 		else if(typeof formId == 'object'){
@@ -935,7 +1220,8 @@
 		if(isUpload){
 
 			// Create iframe in preparation for file upload.
-			var io = this.createFrame(secureUri?secureUri:null);
+			this.createFrame(secureUri?secureUri:null);
+
 			// Set form reference and file upload properties to true.
 			this._isFormSubmit = true;
 			this._isFileUpload = true;
@@ -942,36 +1228,41 @@
 			this._formNode = oForm;
 
 			return;
-
 		}
 
-		var oElement, oName, oValue, oDisabled;
-		var hasSubmit = false;
-
 		// Iterate over the form elements collection to construct the
 		// label-value pairs.
-		for (var i=0; i<oForm.elements.length; i++){
-			oElement = oForm.elements[i];
+		for (i=0,len=oForm.elements.length; i<len; ++i){
+			oElement  = oForm.elements[i];
 			oDisabled = oElement.disabled;
-			oName = oElement.name;
-			oValue = oElement.value;
+			oName     = oElement.name;
 
 			// Do not submit fields that are disabled or
 			// do not have a name attribute value.
 			if(!oDisabled && oName)
 			{
+				oName  = encodeURIComponent(oName)+'=';
+				oValue = encodeURIComponent(oElement.value);
+
 				switch(oElement.type)
 				{
+					// Safari, Opera, FF all default opt.value from .text if
+					// value attribute not specified in markup
 					case 'select-one':
+						if (oElement.selectedIndex > -1) {
+							opt = oElement.options[oElement.selectedIndex];
+							data[item++] = oName + encodeURIComponent(
+								(opt.attributes.value && opt.attributes.value.specified) ? opt.value : opt.text);
+						}
+						break;
 					case 'select-multiple':
-						for(var j=0; j<oElement.options.length; j++){
-							if(oElement.options[j].selected){
-								if(window.ActiveXObject){
-									this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text) + '&';
+						if (oElement.selectedIndex > -1) {
+							for(j=oElement.selectedIndex, jlen=oElement.options.length; j<jlen; ++j){
+								opt = oElement.options[j];
+								if (opt.selected) {
+									data[item++] = oName + encodeURIComponent(
+										(opt.attributes.value && opt.attributes.value.specified) ? opt.value : opt.text);
 								}
-								else{
-									this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';
-								}
 							}
 						}
 						break;
@@ -978,7 +1269,7 @@
 					case 'radio':
 					case 'checkbox':
 						if(oElement.checked){
-							this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
+							data[item++] = oName + oValue;
 						}
 						break;
 					case 'file':
@@ -993,62 +1284,59 @@
 					case 'submit':
 						if(hasSubmit === false){
 							if(this._hasSubmitListener && this._submitElementValue){
-								this._sFormData += this._submitElementValue + '&';
+								data[item++] = this._submitElementValue;
 							}
-							else{
-								this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
-							}
-
 							hasSubmit = true;
 						}
 						break;
 					default:
-						this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
+						data[item++] = oName + oValue;
 				}
 			}
 		}
 
 		this._isFormSubmit = true;
-		this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
+		this._sFormData = data.join('&');
 
 
 		this.initHeader('Content-Type', this._default_form_header);
 
 		return this._sFormData;
-	},
+	}
 
-  /**
-   * @description Resets HTML form properties when an HTML form or HTML form
-   * with file upload transaction is sent.
-   * @method resetFormState
-   * @private
-   * @static
-   * @return {void}
-   */
-	resetFormState:function(){
+   /**
+    * @description Resets HTML form properties when an HTML form or HTML form
+    * with file upload transaction is sent.
+    * @method resetFormState
+    * @private
+    * @static
+    * @return {void}
+    */
+	function _resetFormState(){
 		this._isFormSubmit = false;
 		this._isFileUpload = false;
 		this._formNode = null;
 		this._sFormData = "";
-	},
+	}
 
-  /**
-   * @description Creates an iframe to be used for form file uploads.  It is remove from the
-   * document upon completion of the upload transaction.
-   * @method createFrame
-   * @private
-   * @static
-   * @param {string} optional qualified path of iframe resource for SSL in IE.
-   * @return {void}
-   */
-	createFrame:function(secureUri){
 
+   /**
+    * @description Creates an iframe to be used for form file uploads.  It is remove from the
+    * document upon completion of the upload transaction.
+    * @method createFrame
+    * @private
+    * @static
+    * @param {string} optional qualified path of iframe resource for SSL in IE.
+    * @return {void}
+    */
+	function _createFrame(secureUri){
+
 		// IE does not allow the setting of id and name attributes as object
 		// properties via createElement().  A different iframe creation
 		// pattern is required for IE.
-		var frameId = 'yuiIO' + this._transaction_id;
-		var io;
-		if(window.ActiveXObject){
+		var frameId = 'yuiIO' + this._transaction_id,
+			io;
+		if(YAHOO.env.ua.ie){
 			io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
 
 			// IE will throw a security exception in an SSL environment if the
@@ -1056,10 +1344,6 @@
 			if(typeof secureUri == 'boolean'){
 				io.src = 'javascript:false';
 			}
-			else if(typeof secureURI == 'string'){
-				// Deprecated
-				io.src = secureUri;
-			}
 		}
 		else{
 			io = document.createElement('iframe');
@@ -1072,60 +1356,61 @@
 		io.style.left = '-1000px';
 
 		document.body.appendChild(io);
-	},
+	}
 
-  /**
-   * @description Parses the POST data and creates hidden form elements
-   * for each key-value, and appends them to the HTML form object.
-   * @method appendPostData
-   * @private
-   * @static
-   * @param {string} postData The HTTP POST data
-   * @return {array} formElements Collection of hidden fields.
-   */
-	appendPostData:function(postData)
-	{
-		var formElements = [];
-		var postMessage = postData.split('&');
-		for(var i=0; i < postMessage.length; i++){
-			var delimitPos = postMessage[i].indexOf('=');
+   /**
+    * @description Parses the POST data and creates hidden form elements
+    * for each key-value, and appends them to the HTML form object.
+    * @method appendPostData
+    * @private
+    * @static
+    * @param {string} postData The HTTP POST data
+    * @return {array} formElements Collection of hidden fields.
+    */
+	function _appendPostData(postData){
+		var formElements = [],
+			postMessage = postData.split('&'),
+			i, delimitPos;
+
+		for(i=0; i < postMessage.length; i++){
+			delimitPos = postMessage[i].indexOf('=');
 			if(delimitPos != -1){
 				formElements[i] = document.createElement('input');
 				formElements[i].type = 'hidden';
-				formElements[i].name = postMessage[i].substring(0,delimitPos);
-				formElements[i].value = postMessage[i].substring(delimitPos+1);
+				formElements[i].name = decodeURIComponent(postMessage[i].substring(0,delimitPos));
+				formElements[i].value = decodeURIComponent(postMessage[i].substring(delimitPos+1));
 				this._formNode.appendChild(formElements[i]);
 			}
 		}
 
 		return formElements;
-	},
+	}
 
-  /**
-   * @description Uploads HTML form, inclusive of files/attachments, using the
-   * iframe created in createFrame to facilitate the transaction.
-   * @method uploadFile
-   * @private
-   * @static
-   * @param {int} id The transaction id.
-   * @param {object} callback User-defined callback object.
-   * @param {string} uri Fully qualified path of resource.
-   * @param {string} postData POST data to be submitted in addition to HTML form.
-   * @return {void}
-   */
-	uploadFile:function(o, callback, uri, postData){
-
+   /**
+    * @description Uploads HTML form, inclusive of files/attachments, using the
+    * iframe created in createFrame to facilitate the transaction.
+    * @method uploadFile
+    * @private
+    * @static
+    * @param {int} id The transaction id.
+    * @param {object} callback User-defined callback object.
+    * @param {string} uri Fully qualified path of resource.
+    * @param {string} postData POST data to be submitted in addition to HTML form.
+    * @return {void}
+    */
+	function _uploadFile(o, callback, uri, postData){
 		// Each iframe has an id prefix of "yuiIO" followed
 		// by the unique transaction id.
-		var oConn = this;
-		var frameId = 'yuiIO' + o.tId;
-		var uploadEncoding = 'multipart/form-data';
-		var io = document.getElementById(frameId);
-		var args = (callback && callback.argument)?callback.argument:null;
+		var frameId = 'yuiIO' + o.tId,
+		    uploadEncoding = 'multipart/form-data',
+		    io = document.getElementById(frameId),
+		    ie8 = (document.documentMode && document.documentMode === 8) ? true : false,
+		    oConn = this,
+			args = (callback && callback.argument)?callback.argument:null,
+            oElements,i,prop,obj, rawFormAttributes, uploadCallback;
 
 		// Track original HTML form attribute values.
-		var rawFormAttributes =
-		{
+		rawFormAttributes = {
 			action:this._formNode.getAttribute('action'),
 			method:this._formNode.getAttribute('method'),
 			target:this._formNode.getAttribute('target')
@@ -1137,7 +1422,7 @@
 		this._formNode.setAttribute('method', 'POST');
 		this._formNode.setAttribute('target', frameId);
 
-		if(this._formNode.encoding){
+		if(YAHOO.env.ua.ie && !ie8){
 			// IE does not respect property enctype for HTML forms.
 			// Instead it uses the property - "encoding".
 			this._formNode.setAttribute('encoding', uploadEncoding);
@@ -1147,7 +1432,7 @@
 		}
 
 		if(postData){
-			var oElements = this.appendPostData(postData);
+			oElements = this.appendPostData(postData);
 		}
 
 		// Start file upload.
@@ -1169,7 +1454,7 @@
 
 		// Remove HTML elements created by appendPostData
 		if(oElements && oElements.length > 0){
-			for(var i=0; i < oElements.length; i++){
+			for(i=0; i < oElements.length; i++){
 				this._formNode.removeChild(oElements[i]);
 			}
 		}
@@ -1176,7 +1461,7 @@
 
 		// Restore HTML form attributes to their original
 		// values prior to file upload.
-		for(var prop in rawFormAttributes){
+		for(prop in rawFormAttributes){
 			if(YAHOO.lang.hasOwnProperty(rawFormAttributes, prop)){
 				if(rawFormAttributes[prop]){
 					this._formNode.setAttribute(prop, rawFormAttributes[prop]);
@@ -1193,8 +1478,7 @@
 		// Create the upload callback handler that fires when the iframe
 		// receives the load event.  Subsequently, the event handler is detached
 		// and the iframe removed from the document.
-		var uploadCallback = function()
-		{
+		uploadCallback = function() {
 			if(callback && callback.timeout){
 				window.clearTimeout(oConn._timeOut[o.tId]);
 				delete oConn._timeOut[o.tId];
@@ -1208,9 +1492,10 @@
 				o.completeEvent.fire(o, args);
 			}
 
-			var obj = {};
-			obj.tId = o.tId;
-			obj.argument = callback.argument;
+			obj = {
+			    tId : o.tId,
+			    argument : callback.argument
+            };
 
 			try
 			{
@@ -1238,7 +1523,7 @@
 				o.uploadEvent.fire(obj);
 			}
 
-			YAHOO.util.Event.removeListener(io, "load", uploadCallback);
+			YE.removeListener(io, "load", uploadCallback);
 
 			setTimeout(
 				function(){
@@ -1248,122 +1533,14 @@
 		};
 
 		// Bind the onload handler to the iframe to detect the file upload response.
-		YAHOO.util.Event.addListener(io, "load", uploadCallback);
-	},
+		YE.addListener(io, "load", uploadCallback);
+	}
 
-  /**
-   * @description Method to terminate a transaction, if it has not reached readyState 4.
-   * @method abort
-   * @public
-   * @static
-   * @param {object} o The connection object returned by asyncRequest.
-   * @param {object} callback  User-defined callback object.
-   * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout.
-   * @return {boolean}
-   */
-	abort:function(o, callback, isTimeout)
-	{
-		var abortStatus;
-		var args = (callback && callback.argument)?callback.argument:null;
+	YCM.setForm = _setForm;
+	YCM.resetFormState = _resetFormState;
+	YCM.createFrame = _createFrame;
+	YCM.appendPostData = _appendPostData;
+	YCM.uploadFile = _uploadFile;
+})();
 
-
-		if(o && o.conn){
-			if(this.isCallInProgress(o)){
-				// Issue abort request
-				o.conn.abort();
-
-				window.clearInterval(this._poll[o.tId]);
-				delete this._poll[o.tId];
-
-				if(isTimeout){
-					window.clearTimeout(this._timeOut[o.tId]);
-					delete this._timeOut[o.tId];
-				}
-
-				abortStatus = true;
-			}
-		}
-		else if(o && o.isUpload === true){
-			var frameId = 'yuiIO' + o.tId;
-			var io = document.getElementById(frameId);
-
-			if(io){
-				// Remove all listeners on the iframe prior to
-				// its destruction.
-				YAHOO.util.Event.removeListener(io, "load");
-				// Destroy the iframe facilitating the transaction.
-				document.body.removeChild(io);
-
-				if(isTimeout){
-					window.clearTimeout(this._timeOut[o.tId]);
-					delete this._timeOut[o.tId];
-				}
-
-				abortStatus = true;
-			}
-		}
-		else{
-			abortStatus = false;
-		}
-
-		if(abortStatus === true){
-			// Fire global custom event -- abortEvent
-			this.abortEvent.fire(o, args);
-
-			if(o.abortEvent){
-				// Fire transaction custom event -- abortEvent
-				o.abortEvent.fire(o, args);
-			}
-
-			this.handleTransactionResponse(o, callback, true);
-		}
-
-		return abortStatus;
-	},
-
-  /**
-   * @description Determines if the transaction is still being processed.
-   * @method isCallInProgress
-   * @public
-   * @static
-   * @param {object} o The connection object returned by asyncRequest
-   * @return {boolean}
-   */
-	isCallInProgress:function(o)
-	{
-		// if the XHR object assigned to the transaction has not been dereferenced,
-		// then check its readyState status.  Otherwise, return false.
-		if(o && o.conn){
-			return o.conn.readyState !== 4 && o.conn.readyState !== 0;
-		}
-		else if(o && o.isUpload === true){
-			var frameId = 'yuiIO' + o.tId;
-			return document.getElementById(frameId)?true:false;
-		}
-		else{
-			return false;
-		}
-	},
-
-  /**
-   * @description Dereference the XHR instance and the connection object after the transaction is completed.
-   * @method releaseObject
-   * @private
-   * @static
-   * @param {object} o The connection object
-   * @return {void}
-   */
-	releaseObject:function(o)
-	{
-		if(o && o.conn){
-			//dereference the XHR instance.
-			o.conn = null;
-
-
-			//dereference the connection object.
-			o = null;
-		}
-	}
-};
-
-YAHOO.register("connection", YAHOO.util.Connect, {version: "2.4.1", build: "742"});
+YAHOO.register("connection", YAHOO.util.Connect, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/connection/connection-min.js
===================================================================
--- branches/2.8.x/wb/include/yui/connection/connection-min.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/connection/connection-min.js	(revision 1263)
@@ -1,8 +1,9 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
-YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.type&&A.type.toLowerCase()=="submit"){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};}catch(C){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:E};break;}catch(C){}}}finally{return D;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||null);if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){for(var B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B]);}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);}else{G.success.apply(G.scope,[C]);}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(A){if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);
-}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(K,E,B){this.resetFormState();var J;if(typeof K=="string"){J=(document.getElementById(K)||document.forms[K]);}else{if(typeof K=="object"){J=K;}else{return ;}}if(E){var F=this.createFrame(B?B:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return ;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A=J.elements[D];L=A.disabled;I=A.name;G=A.value;if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if(A.options[C].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].attributes["value"].specified?A.options[C].value:A.options[C].text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].hasAttribute("value")?A.options[C].value:A.options[C].text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);this.initHeader("Content-Type",this._default_form_header);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(window.ActiveXObject){C=document.createElement("<iframe id=\""+B+"\" name=\""+B+"\" />");if(typeof A=="boolean"){C.src="javascript:false";}else{if(typeof secureURI=="string"){C.src=A;}}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=B[C].substring(0,E);D[C].value=B[C].substring(E+1);this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,M,E,C){var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K=document.getElementById(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",H);if(this._formNode.encoding){this._formNode.setAttribute("encoding",I);}else{this._formNode.setAttribute("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){this._timeOut[D.tId]=window.setTimeout(function(){N.abort(D,M,true);},M.timeout);}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild(L[G]);}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if(B[A]){this._formNode.setAttribute(A,B[A]);}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function(){if(M&&M.timeout){window.clearTimeout(N._timeOut[D.tId]);delete N._timeOut[D.tId];}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText=K.contentWindow.document.body?K.contentWindow.document.body.innerHTML:K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);}else{M.upload.apply(M.scope,[P]);}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F);setTimeout(function(){document.body.removeChild(K);N.releaseObject(D);},100);};YAHOO.util.Event.addListener(K,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.4.1",build:"742"});
\ No newline at end of file
+YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(F){var D,A,B;try{A=new XMLHttpRequest();D={conn:A,tId:F,xhr:true};}catch(C){for(B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:F,xhr:true};break;}catch(E){}}}finally{return D;}},getConnectionObject:function(A){var C,D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={tId:D};if(A==="xdr"){C.conn=this._transport;C.xdr=true;}else{if(A==="upload"){C.upload=true;}}}if(C){this._transaction_id++;}}catch(B){}return C;},asyncRequest:function(G,D,F,A){var E,C,B=(F&&F.argument)?F.argument:null;if(this._isFileUpload){C="upload";}else{if(F.xdr){C="xdr";}}E=this.getConnectionObject(C);if(!E){return null;}else{if(F&&F.customevents){this.initCustomEvents(E,F);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(E,F,D,A);return E;}if(G.toUpperCase()=="GET"){if(this._sFormData.length!==0){D+=((D.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(G.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(G.toUpperCase()=="GET"&&(F&&F.cache===false)){D+=((D.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((G.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(E.xdr){this.xdr(E,G,D,F,A);return E;}E.conn.open(G,D,true);if(this._has_default_headers||this._has_http_headers){this.setHeader(E);}this.handleReadyState(E,F);E.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(E,B);if(E.startEvent){E.startEvent.fire(E,B);}return E;}},initCustomEvents:function(A,C){var B;for(B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B]);}}},handleReadyState:function(C,D){var B=this,A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(B,I,D){var E,A,G=(I&&I.argument)?I.argument:null,C=(B.r&&B.r.statusText==="xdr:success")?true:false,H=(B.r&&B.r.statusText==="xdr:failure")?true:false,J=D;try{if((B.conn.status!==undefined&&B.conn.status!==0)||C){E=B.conn.status;}else{if(H&&!J){E=0;}else{E=13030;}}}catch(F){E=13030;}if((E>=200&&E<300)||E===1223||C){A=B.xdr?B.r:this.createResponseObject(B,G);if(I&&I.success){if(!I.scope){I.success(A);}else{I.success.apply(I.scope,[A]);}}this.successEvent.fire(A);if(B.successEvent){B.successEvent.fire(A);}}else{switch(E){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:A=this.createExceptionObject(B.tId,G,(D?D:false));if(I&&I.failure){if(!I.scope){I.failure(A);}else{I.failure.apply(I.scope,[A]);}}break;default:A=(B.xdr)?B.response:this.createResponseObject(B,G);if(I&&I.failure){if(!I.scope){I.failure(A);}else{I.failure.apply(I.scope,[A]);}}}this.failureEvent.fire(A);if(B.failureEvent){B.failureEvent.fire(A);}}this.releaseObject(B);A=null;},createResponseObject:function(A,G){var D={},I={},E,C,F,B;try{C=A.conn.getAllResponseHeaders();F=C.split("\n");for(E=0;E<F.length;E++){B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=YAHOO.lang.trim(F[E].substring(B+2));}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0,G="communication failure",C=-1,B="transaction aborted",E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(A){var B;if(this._has_default_headers){for(B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);}}}if(this._has_http_headers){for(B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);
+}}this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){this._default_headers={};this._has_default_headers=false;},abort:function(E,G,A){var D,B=(G&&G.argument)?G.argument:null;E=E||{};if(E.conn){if(E.xhr){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E.xdr){E.conn.abort(E.tId);D=true;}}}else{if(E.upload){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(A){A=A||{};if(A.xhr&&A.conn){return A.conn.readyState!==4&&A.conn.readyState!==0;}else{if(A.xdr&&A.conn){return A.conn.isCallInProgress(A.tId);}else{if(A.upload===true){return document.getElementById("yuiIO"+A.tId)?true:false;}else{return false;}}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null;}}};(function(){var G=YAHOO.util.Connect,H={};function D(I){var J='<object id="YUIConnectionSwf" type="application/x-shockwave-flash" data="'+I+'" width="0" height="0">'+'<param name="movie" value="'+I+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",K=document.createElement("div");document.body.appendChild(K);K.innerHTML=J;}function B(L,I,J,M,K){H[parseInt(L.tId)]={"o":L,"c":M};if(K){M.method=I;M.data=K;}L.conn.send(J,M,L.tId);}function E(I){D(I);G._transport=document.getElementById("YUIConnectionSwf");}function C(){G.xdrReadyEvent.fire();}function A(J,I){if(J){G.startEvent.fire(J,I.argument);if(J.startEvent){J.startEvent.fire(J,I.argument);}}}function F(J){var K=H[J.tId].o,I=H[J.tId].c;if(J.statusText==="xdr:start"){A(K,I);return;}J.responseText=decodeURI(J.responseText);K.r=J;if(I.argument){K.r.argument=I.argument;}this.handleTransactionResponse(K,I,J.statusText==="xdr:abort"?true:false);delete H[J.tId];}G.xdr=B;G.swf=D;G.transport=E;G.xdrReadyEvent=new YAHOO.util.CustomEvent("xdrReady");G.xdrReady=C;G.handleXdrResponse=F;})();(function(){var D=YAHOO.util.Connect,F=YAHOO.util.Event;D._isFormSubmit=false;D._isFileUpload=false;D._formNode=null;D._sFormData=null;D._submitElementValue=null;D.uploadEvent=new YAHOO.util.CustomEvent("upload"),D._hasSubmitListener=function(){if(F){F.addListener(document,"click",function(J){var I=F.getTarget(J),H=I.nodeName.toLowerCase();if((H==="input"||H==="button")&&(I.type&&I.type.toLowerCase()=="submit")){D._submitElementValue=encodeURIComponent(I.name)+"="+encodeURIComponent(I.value);}});return true;}return false;}();function G(T,O,J){var S,I,R,P,W,Q=false,M=[],V=0,L,N,K,U,H;this.resetFormState();if(typeof T=="string"){S=(document.getElementById(T)||document.forms[T]);}else{if(typeof T=="object"){S=T;}else{return;}}if(O){this.createFrame(J?J:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=S;return;}for(L=0,N=S.elements.length;L<N;++L){I=S.elements[L];W=I.disabled;R=I.name;if(!W&&R){R=encodeURIComponent(R)+"=";P=encodeURIComponent(I.value);switch(I.type){case"select-one":if(I.selectedIndex>-1){H=I.options[I.selectedIndex];M[V++]=R+encodeURIComponent((H.attributes.value&&H.attributes.value.specified)?H.value:H.text);}break;case"select-multiple":if(I.selectedIndex>-1){for(K=I.selectedIndex,U=I.options.length;K<U;++K){H=I.options[K];if(H.selected){M[V++]=R+encodeURIComponent((H.attributes.value&&H.attributes.value.specified)?H.value:H.text);}}}break;case"radio":case"checkbox":if(I.checked){M[V++]=R+P;}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(Q===false){if(this._hasSubmitListener&&this._submitElementValue){M[V++]=this._submitElementValue;}Q=true;}break;default:M[V++]=R+P;}}}this._isFormSubmit=true;this._sFormData=M.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData;}function C(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";}function B(H){var I="yuiIO"+this._transaction_id,J;if(YAHOO.env.ua.ie){J=document.createElement('<iframe id="'+I+'" name="'+I+'" />');if(typeof H=="boolean"){J.src="javascript:false";}}else{J=document.createElement("iframe");J.id=I;J.name=I;}J.style.position="absolute";J.style.top="-1000px";J.style.left="-1000px";document.body.appendChild(J);}function E(H){var K=[],I=H.split("&"),J,L;for(J=0;J<I.length;J++){L=I[J].indexOf("=");if(L!=-1){K[J]=document.createElement("input");K[J].type="hidden";K[J].name=decodeURIComponent(I[J].substring(0,L));K[J].value=decodeURIComponent(I[J].substring(L+1));this._formNode.appendChild(K[J]);}}return K;}function A(K,V,L,J){var Q="yuiIO"+K.tId,R="multipart/form-data",T=document.getElementById(Q),M=(document.documentMode&&document.documentMode===8)?true:false,W=this,S=(V&&V.argument)?V.argument:null,U,P,I,O,H,N;H={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",L);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",Q);if(YAHOO.env.ua.ie&&!M){this._formNode.setAttribute("encoding",R);}else{this._formNode.setAttribute("enctype",R);}if(J){U=this.appendPostData(J);}this._formNode.submit();this.startEvent.fire(K,S);if(K.startEvent){K.startEvent.fire(K,S);}if(V&&V.timeout){this._timeOut[K.tId]=window.setTimeout(function(){W.abort(K,V,true);},V.timeout);}if(U&&U.length>0){for(P=0;P<U.length;P++){this._formNode.removeChild(U[P]);}}for(I in H){if(YAHOO.lang.hasOwnProperty(H,I)){if(H[I]){this._formNode.setAttribute(I,H[I]);}else{this._formNode.removeAttribute(I);}}}this.resetFormState();N=function(){if(V&&V.timeout){window.clearTimeout(W._timeOut[K.tId]);delete W._timeOut[K.tId];}W.completeEvent.fire(K,S);if(K.completeEvent){K.completeEvent.fire(K,S);
+}O={tId:K.tId,argument:V.argument};try{O.responseText=T.contentWindow.document.body?T.contentWindow.document.body.innerHTML:T.contentWindow.document.documentElement.textContent;O.responseXML=T.contentWindow.document.XMLDocument?T.contentWindow.document.XMLDocument:T.contentWindow.document;}catch(X){}if(V&&V.upload){if(!V.scope){V.upload(O);}else{V.upload.apply(V.scope,[O]);}}W.uploadEvent.fire(O);if(K.uploadEvent){K.uploadEvent.fire(O);}F.removeListener(T,"load",N);setTimeout(function(){document.body.removeChild(T);W.releaseObject(K);},100);};F.addListener(T,"load",N);}D.setForm=G;D.resetFormState=C;D.createFrame=B;D.appendPostData=E;D.uploadFile=A;})();YAHOO.register("connection",YAHOO.util.Connect,{version:"2.8.0r4",build:"2449"});
\ No newline at end of file
Index: branches/2.8.x/wb/include/yui/connection/index.php
===================================================================
--- branches/2.8.x/wb/include/yui/connection/index.php	(revision 1262)
+++ branches/2.8.x/wb/include/yui/connection/index.php	(revision 1263)
@@ -1,28 +1,55 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-header("Location: ../../../index.php");
-
+<?php
+/*
+*
+*                       About WebsiteBaker
+*
+* Website Baker is a PHP-based Content Management System (CMS)
+* designed with one goal in mind: to enable its users to produce websites
+* with ease.
+*
+*                       LICENSE INFORMATION
+*
+* WebsiteBaker is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* WebsiteBaker is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*
+*                   WebsiteBaker Extra Information
+*
+*
+*/
+/**
+ *
+ * @category        backend
+ * @package         yui
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @filesource		$HeadURL$
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ *
+ * @author          WebsiteBaker Project
+ * @link			http://www.websitebaker2.org/
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @link			http://start.websitebaker2.org/impressum-datenschutz.php
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @version         $Id$
+ * @platform        WebsiteBaker 2.8.x
+ * @requirements    PHP 4.3.4 and higher
+ * @lastmodified    $Date$
+ *
+ */
+
+header("Location: ../../../index.php");
+
 ?>
\ No newline at end of file

Property changes on: branches/2.8.x/wb/include/yui/connection/index.php
___________________________________________________________________
Modified: svn:keywords
## -1 +1,4 ##
-Id
\ No newline at end of property
+Id
+Revision
+HeadURL
+Date
\ No newline at end of property
Index: branches/2.8.x/wb/include/yui/connection/connection.swf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: branches/2.8.x/wb/include/yui/connection/connection.swf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: branches/2.8.x/wb/include/yui/connection/connection-debug.js
===================================================================
--- branches/2.8.x/wb/include/yui/connection/connection-debug.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/connection/connection-debug.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 /**
  * The Connection Manager provides a simplified interface to the XMLHttpRequest
@@ -131,46 +131,6 @@
     _default_headers:{},
 
  /**
-  * @description Property modified by setForm() to determine if the data
-  * should be submitted as an HTML form.
-  * @property _isFormSubmit
-  * @private
-  * @static
-  * @type boolean
-  */
-    _isFormSubmit:false,
-
- /**
-  * @description Property modified by setForm() to determine if a file(s)
-  * upload is expected.
-  * @property _isFileUpload
-  * @private
-  * @static
-  * @type boolean
-  */
-    _isFileUpload:false,
-
- /**
-  * @description Property modified by setForm() to set a reference to the HTML
-  * form node if the desired action is file upload.
-  * @property _formNode
-  * @private
-  * @static
-  * @type object
-  */
-    _formNode:null,
-
- /**
-  * @description Property modified by setForm() to set the HTML form data
-  * for each transaction.
-  * @property _sFormData
-  * @private
-  * @static
-  * @type string
-  */
-    _sFormData:null,
-
- /**
   * @description Collection of polling references to the polling mechanism in handleReadyState.
   * @property _poll
   * @private
@@ -209,42 +169,6 @@
      _transaction_id:0,
 
   /**
-   * @description Tracks the name-value pair of the "clicked" submit button if multiple submit
-   * buttons are present in an HTML form; and, if YAHOO.util.Event is available.
-   * @property _submitElementValue
-   * @private
-   * @static
-   * @type string
-   */
-	 _submitElementValue:null,
-
-  /**
-   * @description Determines whether YAHOO.util.Event is available and returns true or false.
-   * If true, an event listener is bound at the document level to trap click events that
-   * resolve to a target type of "Submit".  This listener will enable setForm() to determine
-   * the clicked "Submit" value in a multi-Submit button, HTML form.
-   * @property _hasSubmitListener
-   * @private
-   * @static
-   */
-	 _hasSubmitListener:(function()
-	 {
-		if(YAHOO.util.Event){
-			YAHOO.util.Event.addListener(
-				document,
-				'click',
-				function(e){
-					var obj = YAHOO.util.Event.getTarget(e);
-					if(obj.type && obj.type.toLowerCase() == 'submit'){
-						YAHOO.util.Connect._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
-					}
-				});
-			return true;
-	    }
-	    return false;
-	 })(),
-
-  /**
    * @description Custom event that fires at the start of a transaction
    * @property startEvent
    * @private
@@ -283,16 +207,6 @@
 	failureEvent: new YAHOO.util.CustomEvent('failure'),
 
   /**
-   * @description Custom event that fires when handleTransactionResponse() determines a
-   * response in the HTTP 4xx/5xx range.
-   * @property failureEvent
-   * @private
-   * @static
-   * @type CustomEvent
-   */
-	uploadEvent: new YAHOO.util.CustomEvent('upload'),
-
-  /**
    * @description Custom event that fires when a transaction is successfully aborted.
    * @property abortEvent
    * @private
@@ -400,28 +314,28 @@
    */
 	createXhrObject:function(transactionId)
 	{
-		var obj,http;
+		var obj,http,i;
 		try
 		{
 			// Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
 			http = new XMLHttpRequest();
 			//  Object literal with http and tId properties
-			obj = { conn:http, tId:transactionId };
+			obj = { conn:http, tId:transactionId, xhr: true };
 			YAHOO.log('XHR object created for transaction ' + transactionId, 'info', 'Connection');
 		}
 		catch(e)
 		{
-			for(var i=0; i<this._msxml_progid.length; ++i){
+			for(i=0; i<this._msxml_progid.length; ++i){
 				try
 				{
 					// Instantiates XMLHttpRequest for IE and assign to http
 					http = new ActiveXObject(this._msxml_progid[i]);
 					//  Object literal with conn and tId properties
-					obj = { conn:http, tId:transactionId };
+					obj = { conn:http, tId:transactionId, xhr: true };
 					YAHOO.log('ActiveX XHR object created for transaction ' + transactionId, 'info', 'Connection');
 					break;
 				}
-				catch(e){}
+				catch(e1){}
 			}
 		}
 		finally
@@ -439,20 +353,24 @@
    * @static
    * @return {object}
    */
-	getConnectionObject:function(isFileUpload)
+	getConnectionObject:function(t)
 	{
-		var o;
-		var tId = this._transaction_id;
+		var o, tId = this._transaction_id;
 
 		try
 		{
-			if(!isFileUpload){
+			if(!t){
 				o = this.createXhrObject(tId);
 			}
 			else{
-				o = {};
-				o.tId = tId;
-				o.isUpload = true;
+				o = {tId:tId};
+				if(t==='xdr'){
+					o.conn = this._transport;
+					o.xdr = true;
+				}
+				else if(t==='upload'){
+					o.upload = true;
+				}
 			}
 
 			if(o){
@@ -460,10 +378,7 @@
 			}
 		}
 		catch(e){}
-		finally
-		{
-			return o;
-		}
+		return o;
 	},
 
   /**
@@ -479,9 +394,16 @@
    */
 	asyncRequest:function(method, uri, callback, postData)
 	{
-		var o = (this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();
-		var args = (callback && callback.argument)?callback.argument:null;
+		var o,t,args = (callback && callback.argument)?callback.argument:null;
 
+		if(this._isFileUpload){
+			t = 'upload';
+		}
+		else if(callback.xdr){
+			t = 'xdr';
+		}
+
+		o = this.getConnectionObject(t);
 		if(!o){
 			YAHOO.log('Unable to create connection object.', 'error', 'Connection');
 			return null;
@@ -522,8 +444,6 @@
 				uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();
 			}
 
-			o.conn.open(method, uri, true);
-
 			// Each transaction will automatically include a custom header of
 			// "X-Requested-With: XMLHttpRequest" to identify the request as
 			// having originated from Connection Manager.
@@ -536,11 +456,17 @@
 
 			//If the transaction method is POST and the POST header value is set to true
 			//or a custom value, initalize the Content-Type header to this value.
-			if((method.toUpperCase() == 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
+			if((method.toUpperCase() === 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
 				this.initHeader('Content-Type', this._default_post_header);
 				YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.', 'info', 'Connection');
 			}
 
+			if(o.xdr){
+				this.xdr(o, method, uri, callback, postData);
+				return o;
+			}
+
+			o.conn.open(method, uri, true);
 			//Initialize all default and custom HTTP headers,
 			if(this._has_default_headers || this._has_http_headers){
 				this.setHeader(o);
@@ -547,10 +473,9 @@
 			}
 
 			this.handleReadyState(o, callback);
-			o.conn.send(postData || null);
+			o.conn.send(postData || '');
 			YAHOO.log('Transaction ' + o.tId + ' sent.', 'info', 'Connection');
 
-
 			// Reset the HTML form data and state properties as
 			// soon as the data are submitted.
 			if(this._isFormSubmit === true){
@@ -581,9 +506,10 @@
    */
 	initCustomEvents:function(o, callback)
 	{
+		var prop;
 		// Enumerate through callback.customevents members and bind/subscribe
 		// events that match in the _customEvents table.
-		for(var prop in callback.customevents){
+		for(prop in callback.customevents){
 			if(this._customEvents[prop][0]){
 				// Create the custom event
 				o[this._customEvents[prop][0]] = new YAHOO.util.CustomEvent(this._customEvents[prop][1], (callback.scope)?callback.scope:null);
@@ -612,8 +538,8 @@
     handleReadyState:function(o, callback)
 
     {
-		var oConn = this;
-		var args = (callback && callback.argument)?callback.argument:null;
+		var oConn = this,
+			args = (callback && callback.argument)?callback.argument:null;
 
 		if(callback && callback.timeout){
 			this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
@@ -661,14 +587,25 @@
    */
     handleTransactionResponse:function(o, callback, isAbort)
     {
-		var httpStatus, responseObject;
-		var args = (callback && callback.argument)?callback.argument:null;
+		var httpStatus, responseObject,
+			args = (callback && callback.argument)?callback.argument:null,
+			xdrS = (o.r && o.r.statusText === 'xdr:success')?true:false,
+			xdrF = (o.r && o.r.statusText === 'xdr:failure')?true:false,
+			xdrA = isAbort;
 
 		try
 		{
-			if(o.conn.status !== undefined && o.conn.status !== 0){
+			if((o.conn.status !== undefined && o.conn.status !== 0) || xdrS){
+				// XDR requests will not have HTTP status defined. The
+				// statusText property will define the response status
+				// set by the Flash transport.
 				httpStatus = o.conn.status;
 			}
+			else if(xdrF && !xdrA){
+				// Set XDR transaction failure to a status of 0, which
+				// resolves as an HTTP failure, instead of an exception.
+				httpStatus = 0;
+			}
 			else{
 				httpStatus = 13030;
 			}
@@ -681,8 +618,8 @@
 			httpStatus = 13030;
 		}
 
-		if(httpStatus >= 200 && httpStatus < 300 || httpStatus === 1223){
-			responseObject = this.createResponseObject(o, args);
+		if((httpStatus >= 200 && httpStatus < 300) || httpStatus === 1223 || xdrS){
+			responseObject = o.xdr ? o.r : this.createResponseObject(o, args);
 			if(callback && callback.success){
 				if(!callback.scope){
 					callback.success(responseObject);
@@ -713,6 +650,8 @@
 				case 12031:
 				case 12152: // Connection closed by server.
 				case 13030: // See above comments for variable status.
+					// XDR transactions will not resolve to this case, since the
+					// response object is already built in the xdr response.
 					responseObject = this.createExceptionObject(o.tId, args, (isAbort?isAbort:false));
 					if(callback && callback.failure){
 						if(!callback.scope){
@@ -727,7 +666,7 @@
 
 					break;
 				default:
-					responseObject = this.createResponseObject(o, args);
+					responseObject = (o.xdr) ? o.response : this.createResponseObject(o, args);
 					if(callback && callback.failure){
 						if(!callback.scope){
 							callback.failure(responseObject);
@@ -767,17 +706,17 @@
    */
     createResponseObject:function(o, callbackArg)
     {
-		var obj = {};
-		var headerObj = {};
+		var obj = {}, headerObj = {},
+			i, headerStr, header, delimitPos;
 
 		try
 		{
-			var headerStr = o.conn.getAllResponseHeaders();
-			var header = headerStr.split('\n');
-			for(var i=0; i<header.length; i++){
-				var delimitPos = header[i].indexOf(':');
+			headerStr = o.conn.getAllResponseHeaders();
+			header = headerStr.split('\n');
+			for(i=0; i<header.length; i++){
+				delimitPos = header[i].indexOf(':');
 				if(delimitPos != -1){
-					headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+2);
+					headerObj[header[i].substring(0,delimitPos)] = YAHOO.lang.trim(header[i].substring(delimitPos+2));
 				}
 			}
 		}
@@ -818,13 +757,12 @@
    */
     createExceptionObject:function(tId, callbackArg, isAbort)
     {
-		var COMM_CODE = 0;
-		var COMM_ERROR = 'communication failure';
-		var ABORT_CODE = -1;
-		var ABORT_ERROR = 'transaction aborted';
+		var COMM_CODE = 0,
+			COMM_ERROR = 'communication failure',
+			ABORT_CODE = -1,
+			ABORT_ERROR = 'transaction aborted',
+			obj = {};
 
-		var obj = {};
-
 		obj.tId = tId;
 		if(isAbort){
 			obj.status = ABORT_CODE;
@@ -856,8 +794,8 @@
 	initHeader:function(label, value, isDefault)
 	{
 		var headerObj = (isDefault)?this._default_headers:this._http_headers;
+
 		headerObj[label] = value;
-
 		if(isDefault){
 			this._has_default_headers = true;
 		}
@@ -877,8 +815,9 @@
    */
 	setHeader:function(o)
 	{
+		var prop;
 		if(this._has_default_headers){
-			for(var prop in this._default_headers){
+			for(prop in this._default_headers){
 				if(YAHOO.lang.hasOwnProperty(this._default_headers, prop)){
 					o.conn.setRequestHeader(prop, this._default_headers[prop]);
 					YAHOO.log('Default HTTP header ' + prop + ' set with value of ' + this._default_headers[prop], 'info', 'Connection');
@@ -887,13 +826,12 @@
 		}
 
 		if(this._has_http_headers){
-			for(var prop in this._http_headers){
+			for(prop in this._http_headers){
 				if(YAHOO.lang.hasOwnProperty(this._http_headers, prop)){
 					o.conn.setRequestHeader(prop, this._http_headers[prop]);
 					YAHOO.log('HTTP header ' + prop + ' set with value of ' + this._http_headers[prop], 'info', 'Connection');
 				}
 			}
-			delete this._http_headers;
 
 			this._http_headers = {};
 			this._has_http_headers = false;
@@ -908,12 +846,359 @@
    * @return {void}
    */
 	resetDefaultHeaders:function(){
-		delete this._default_headers;
 		this._default_headers = {};
 		this._has_default_headers = false;
 	},
 
   /**
+   * @description Method to terminate a transaction, if it has not reached readyState 4.
+   * @method abort
+   * @public
+   * @static
+   * @param {object} o The connection object returned by asyncRequest.
+   * @param {object} callback  User-defined callback object.
+   * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout.
+   * @return {boolean}
+   */
+	abort:function(o, callback, isTimeout)
+	{
+		var abortStatus,
+			args = (callback && callback.argument)?callback.argument:null;
+			o = o || {};
+
+		if(o.conn){
+			if(o.xhr){
+				if(this.isCallInProgress(o)){
+					// Issue abort request
+					o.conn.abort();
+
+					window.clearInterval(this._poll[o.tId]);
+					delete this._poll[o.tId];
+
+					if(isTimeout){
+						window.clearTimeout(this._timeOut[o.tId]);
+						delete this._timeOut[o.tId];
+					}
+
+					abortStatus = true;
+				}
+			}
+			else if(o.xdr){
+				o.conn.abort(o.tId);
+				abortStatus = true;
+			}
+		}
+		else if(o.upload){
+			var frameId = 'yuiIO' + o.tId;
+			var io = document.getElementById(frameId);
+
+			if(io){
+				// Remove all listeners on the iframe prior to
+				// its destruction.
+				YAHOO.util.Event.removeListener(io, "load");
+				// Destroy the iframe facilitating the transaction.
+				document.body.removeChild(io);
+				YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
+
+				if(isTimeout){
+					window.clearTimeout(this._timeOut[o.tId]);
+					delete this._timeOut[o.tId];
+				}
+
+				abortStatus = true;
+			}
+		}
+		else{
+			abortStatus = false;
+		}
+
+		if(abortStatus === true){
+			// Fire global custom event -- abortEvent
+			this.abortEvent.fire(o, args);
+
+			if(o.abortEvent){
+				// Fire transaction custom event -- abortEvent
+				o.abortEvent.fire(o, args);
+			}
+
+			this.handleTransactionResponse(o, callback, true);
+			YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');
+		}
+
+		return abortStatus;
+	},
+
+  /**
+   * @description Determines if the transaction is still being processed.
+   * @method isCallInProgress
+   * @public
+   * @static
+   * @param {object} o The connection object returned by asyncRequest
+   * @return {boolean}
+   */
+	isCallInProgress:function(o)
+	{
+		o = o || {};
+		// if the XHR object assigned to the transaction has not been dereferenced,
+		// then check its readyState status.  Otherwise, return false.
+		if(o.xhr && o.conn){
+			return o.conn.readyState !== 4 && o.conn.readyState !== 0;
+		}
+		else if(o.xdr && o.conn){
+			return o.conn.isCallInProgress(o.tId);
+		}
+		else if(o.upload === true){
+			return document.getElementById('yuiIO' + o.tId)?true:false;
+		}
+		else{
+			return false;
+		}
+	},
+
+  /**
+   * @description Dereference the XHR instance and the connection object after the transaction is completed.
+   * @method releaseObject
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @return {void}
+   */
+	releaseObject:function(o)
+	{
+		if(o && o.conn){
+			//dereference the XHR instance.
+			o.conn = null;
+
+			YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
+
+			//dereference the connection object.
+			o = null;
+		}
+	}
+};
+
+/**
+  * @for Connect
+  */
+(function() {
+	var YCM = YAHOO.util.Connect, _fn = {};
+
+   /**
+    * @description This method creates and instantiates the Flash transport.
+    * @method _swf
+    * @private
+    * @static
+    * @param {string} URI to connection.swf.
+    * @return {void}
+    */
+	function _swf(uri) {
+		var o = '<object id="YUIConnectionSwf" type="application/x-shockwave-flash" data="' +
+		        uri + '" width="0" height="0">' +
+		     	'<param name="movie" value="' + uri + '">' +
+                '<param name="allowScriptAccess" value="always">' +
+		    	'</object>',
+		    c = document.createElement('div');
+
+		document.body.appendChild(c);
+		c.innerHTML = o;
+	}
+
+   /**
+    * @description This method calls the public method on the
+    * Flash transport to start the XDR transaction.  It is analogous
+    * to Connection Manager's asyncRequest method.
+    * @method xdr
+    * @private
+    * @static
+    * @param {object} The transaction object.
+    * @param {string} HTTP request method.
+    * @param {string} URI for the transaction.
+    * @param {object} The transaction's callback object.
+    * @param {object} The JSON object used as HTTP POST data.
+    * @return {void}
+    */
+	function _xdr(o, m, u, c, d) {
+		_fn[parseInt(o.tId)] = { 'o':o, 'c':c };
+		if (d) {
+			c.method = m;
+			c.data = d;
+		}
+
+		o.conn.send(u, c, o.tId);
+	}
+
+   /**
+    * @description This method instantiates the Flash transport and
+    * establishes a static reference to it, used for all XDR requests.
+    * @method transport
+    * @public
+    * @static
+    * @param {string} URI to connection.swf.
+    * @return {void}
+    */
+	function _init(uri) {
+		_swf(uri);
+		YCM._transport = document.getElementById('YUIConnectionSwf');
+	}
+
+	function _xdrReady() {
+		YCM.xdrReadyEvent.fire();
+	}
+
+   /**
+    * @description This method fires the global and transaction start
+    * events.
+    * @method _xdrStart
+    * @private
+    * @static
+    * @param {object} The transaction object.
+    * @param {string} The transaction's callback object.
+    * @return {void}
+    */
+	function _xdrStart(o, cb) {
+		if (o) {
+			// Fire global custom event -- startEvent
+			YCM.startEvent.fire(o, cb.argument);
+
+			if(o.startEvent){
+				// Fire transaction custom event -- startEvent
+				o.startEvent.fire(o, cb.argument);
+			}
+		}
+	}
+
+   /**
+    * @description This method is the initial response handler
+    * for XDR transactions.  The Flash transport calls this
+    * function and sends the response payload.
+    * @method handleXdrResponse
+    * @private
+    * @static
+    * @param {object} The response object sent from the Flash transport.
+    * @return {void}
+    */
+	function _handleXdrResponse(r) {
+		var o = _fn[r.tId].o,
+			cb = _fn[r.tId].c;
+
+		if (r.statusText === 'xdr:start') {
+			_xdrStart(o, cb);
+			return;
+		}
+
+		r.responseText = decodeURI(r.responseText);
+		o.r = r;
+		if (cb.argument) {
+			o.r.argument = cb.argument;
+		}
+
+		this.handleTransactionResponse(o, cb, r.statusText === 'xdr:abort' ? true : false);
+		delete _fn[r.tId];
+	}
+
+	// Bind the functions to Connection Manager as static fields.
+	YCM.xdr = _xdr;
+	YCM.swf = _swf;
+	YCM.transport = _init;
+	YCM.xdrReadyEvent = new YAHOO.util.CustomEvent('xdrReady');
+	YCM.xdrReady = _xdrReady;
+	YCM.handleXdrResponse = _handleXdrResponse;
+})();
+
+/**
+  * @for Connect
+  */
+(function(){
+	var YCM = YAHOO.util.Connect,
+		YE = YAHOO.util.Event;
+   /**
+	* @description Property modified by setForm() to determine if the data
+	* should be submitted as an HTML form.
+	* @property _isFormSubmit
+	* @private
+	* @static
+	* @type boolean
+	*/
+	YCM._isFormSubmit = false;
+
+   /**
+	* @description Property modified by setForm() to determine if a file(s)
+	* upload is expected.
+	* @property _isFileUpload
+	* @private
+	* @static
+	* @type boolean
+	*/
+	YCM._isFileUpload = false;
+
+   /**
+	* @description Property modified by setForm() to set a reference to the HTML
+	* form node if the desired action is file upload.
+	* @property _formNode
+	* @private
+	* @static
+	* @type object
+	*/
+	YCM._formNode = null;
+
+   /**
+	* @description Property modified by setForm() to set the HTML form data
+	* for each transaction.
+	* @property _sFormData
+	* @private
+	* @static
+	* @type string
+	*/
+	YCM._sFormData = null;
+
+   /**
+	* @description Tracks the name-value pair of the "clicked" submit button if multiple submit
+	* buttons are present in an HTML form; and, if YAHOO.util.Event is available.
+	* @property _submitElementValue
+	* @private
+	* @static
+	* @type string
+	*/
+	YCM._submitElementValue = null;
+
+   /**
+    * @description Custom event that fires when handleTransactionResponse() determines a
+    * response in the HTTP 4xx/5xx range.
+    * @property failureEvent
+    * @private
+    * @static
+    * @type CustomEvent
+    */
+	YCM.uploadEvent = new YAHOO.util.CustomEvent('upload'),
+
+   /**
+	* @description Determines whether YAHOO.util.Event is available and returns true or false.
+	* If true, an event listener is bound at the document level to trap click events that
+	* resolve to a target type of "Submit".  This listener will enable setForm() to determine
+	* the clicked "Submit" value in a multi-Submit button, HTML form.
+	* @property _hasSubmitListener
+	* @private
+	* @static
+	*/
+	YCM._hasSubmitListener = function() {
+		if(YE){
+			YE.addListener(
+				document,
+				'click',
+				function(e){
+					var obj = YE.getTarget(e),
+						name = obj.nodeName.toLowerCase();
+
+					if((name === 'input' || name === 'button') && (obj.type && obj.type.toLowerCase() == 'submit')){
+						YCM._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
+					}
+				});
+			return true;
+		}
+		return false;
+	}();
+
+  /**
    * @description This method assembles the form label and value pairs and
    * constructs an encoded string.
    * asyncRequest() will automatically initialize the transaction with a
@@ -926,16 +1211,19 @@
    * @param {boolean} optional enable file upload over SSL in IE only.
    * @return {string} string of the HTML form field name and value pairs..
    */
-	setForm:function(formId, isUpload, secureUri)
+	function _setForm(formId, isUpload, secureUri)
 	{
-		// reset the HTML form data and state properties
+		var oForm, oElement, oName, oValue, oDisabled,
+			hasSubmit = false,
+			data = [], item = 0,
+			i,len,j,jlen,opt;
+
 		this.resetFormState();
 
-		var oForm;
 		if(typeof formId == 'string'){
 			// Determine if the argument is a form id or a form name.
-			// Note form name usage is deprecated, but supported
-			// here for backward compatibility.
+			// Note form name usage is deprecated by supported
+			// here for legacy reasons.
 			oForm = (document.getElementById(formId) || document.forms[formId]);
 		}
 		else if(typeof formId == 'object'){
@@ -956,7 +1244,8 @@
 		if(isUpload){
 
 			// Create iframe in preparation for file upload.
-			var io = this.createFrame(secureUri?secureUri:null);
+			this.createFrame(secureUri?secureUri:null);
+
 			// Set form reference and file upload properties to true.
 			this._isFormSubmit = true;
 			this._isFileUpload = true;
@@ -963,36 +1252,41 @@
 			this._formNode = oForm;
 
 			return;
-
 		}
 
-		var oElement, oName, oValue, oDisabled;
-		var hasSubmit = false;
-
 		// Iterate over the form elements collection to construct the
 		// label-value pairs.
-		for (var i=0; i<oForm.elements.length; i++){
-			oElement = oForm.elements[i];
+		for (i=0,len=oForm.elements.length; i<len; ++i){
+			oElement  = oForm.elements[i];
 			oDisabled = oElement.disabled;
-			oName = oElement.name;
-			oValue = oElement.value;
+			oName     = oElement.name;
 
 			// Do not submit fields that are disabled or
 			// do not have a name attribute value.
 			if(!oDisabled && oName)
 			{
+				oName  = encodeURIComponent(oName)+'=';
+				oValue = encodeURIComponent(oElement.value);
+
 				switch(oElement.type)
 				{
+					// Safari, Opera, FF all default opt.value from .text if
+					// value attribute not specified in markup
 					case 'select-one':
+						if (oElement.selectedIndex > -1) {
+							opt = oElement.options[oElement.selectedIndex];
+							data[item++] = oName + encodeURIComponent(
+								(opt.attributes.value && opt.attributes.value.specified) ? opt.value : opt.text);
+						}
+						break;
 					case 'select-multiple':
-						for(var j=0; j<oElement.options.length; j++){
-							if(oElement.options[j].selected){
-								if(window.ActiveXObject){
-									this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text) + '&';
+						if (oElement.selectedIndex > -1) {
+							for(j=oElement.selectedIndex, jlen=oElement.options.length; j<jlen; ++j){
+								opt = oElement.options[j];
+								if (opt.selected) {
+									data[item++] = oName + encodeURIComponent(
+										(opt.attributes.value && opt.attributes.value.specified) ? opt.value : opt.text);
 								}
-								else{
-									this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';
-								}
 							}
 						}
 						break;
@@ -999,7 +1293,7 @@
 					case 'radio':
 					case 'checkbox':
 						if(oElement.checked){
-							this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
+							data[item++] = oName + oValue;
 						}
 						break;
 					case 'file':
@@ -1014,23 +1308,19 @@
 					case 'submit':
 						if(hasSubmit === false){
 							if(this._hasSubmitListener && this._submitElementValue){
-								this._sFormData += this._submitElementValue + '&';
+								data[item++] = this._submitElementValue;
 							}
-							else{
-								this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
-							}
-
 							hasSubmit = true;
 						}
 						break;
 					default:
-						this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
+						data[item++] = oName + oValue;
 				}
 			}
 		}
 
 		this._isFormSubmit = true;
-		this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
+		this._sFormData = data.join('&');
 
 		YAHOO.log('Form initialized for transaction. HTML form POST message is: ' + this._sFormData, 'info', 'Connection');
 
@@ -1038,40 +1328,41 @@
 		YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded for setForm() transaction.', 'info', 'Connection');
 
 		return this._sFormData;
-	},
+	}
 
-  /**
-   * @description Resets HTML form properties when an HTML form or HTML form
-   * with file upload transaction is sent.
-   * @method resetFormState
-   * @private
-   * @static
-   * @return {void}
-   */
-	resetFormState:function(){
+   /**
+    * @description Resets HTML form properties when an HTML form or HTML form
+    * with file upload transaction is sent.
+    * @method resetFormState
+    * @private
+    * @static
+    * @return {void}
+    */
+	function _resetFormState(){
 		this._isFormSubmit = false;
 		this._isFileUpload = false;
 		this._formNode = null;
 		this._sFormData = "";
-	},
+	}
 
-  /**
-   * @description Creates an iframe to be used for form file uploads.  It is remove from the
-   * document upon completion of the upload transaction.
-   * @method createFrame
-   * @private
-   * @static
-   * @param {string} optional qualified path of iframe resource for SSL in IE.
-   * @return {void}
-   */
-	createFrame:function(secureUri){
 
+   /**
+    * @description Creates an iframe to be used for form file uploads.  It is remove from the
+    * document upon completion of the upload transaction.
+    * @method createFrame
+    * @private
+    * @static
+    * @param {string} optional qualified path of iframe resource for SSL in IE.
+    * @return {void}
+    */
+	function _createFrame(secureUri){
+
 		// IE does not allow the setting of id and name attributes as object
 		// properties via createElement().  A different iframe creation
 		// pattern is required for IE.
-		var frameId = 'yuiIO' + this._transaction_id;
-		var io;
-		if(window.ActiveXObject){
+		var frameId = 'yuiIO' + this._transaction_id,
+			io;
+		if(YAHOO.env.ua.ie){
 			io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
 
 			// IE will throw a security exception in an SSL environment if the
@@ -1079,10 +1370,6 @@
 			if(typeof secureUri == 'boolean'){
 				io.src = 'javascript:false';
 			}
-			else if(typeof secureURI == 'string'){
-				// Deprecated
-				io.src = secureUri;
-			}
 		}
 		else{
 			io = document.createElement('iframe');
@@ -1096,60 +1383,61 @@
 
 		document.body.appendChild(io);
 		YAHOO.log('File upload iframe created. Id is:' + frameId, 'info', 'Connection');
-	},
+	}
 
-  /**
-   * @description Parses the POST data and creates hidden form elements
-   * for each key-value, and appends them to the HTML form object.
-   * @method appendPostData
-   * @private
-   * @static
-   * @param {string} postData The HTTP POST data
-   * @return {array} formElements Collection of hidden fields.
-   */
-	appendPostData:function(postData)
-	{
-		var formElements = [];
-		var postMessage = postData.split('&');
-		for(var i=0; i < postMessage.length; i++){
-			var delimitPos = postMessage[i].indexOf('=');
+   /**
+    * @description Parses the POST data and creates hidden form elements
+    * for each key-value, and appends them to the HTML form object.
+    * @method appendPostData
+    * @private
+    * @static
+    * @param {string} postData The HTTP POST data
+    * @return {array} formElements Collection of hidden fields.
+    */
+	function _appendPostData(postData){
+		var formElements = [],
+			postMessage = postData.split('&'),
+			i, delimitPos;
+
+		for(i=0; i < postMessage.length; i++){
+			delimitPos = postMessage[i].indexOf('=');
 			if(delimitPos != -1){
 				formElements[i] = document.createElement('input');
 				formElements[i].type = 'hidden';
-				formElements[i].name = postMessage[i].substring(0,delimitPos);
-				formElements[i].value = postMessage[i].substring(delimitPos+1);
+				formElements[i].name = decodeURIComponent(postMessage[i].substring(0,delimitPos));
+				formElements[i].value = decodeURIComponent(postMessage[i].substring(delimitPos+1));
 				this._formNode.appendChild(formElements[i]);
 			}
 		}
 
 		return formElements;
-	},
+	}
 
-  /**
-   * @description Uploads HTML form, inclusive of files/attachments, using the
-   * iframe created in createFrame to facilitate the transaction.
-   * @method uploadFile
-   * @private
-   * @static
-   * @param {int} id The transaction id.
-   * @param {object} callback User-defined callback object.
-   * @param {string} uri Fully qualified path of resource.
-   * @param {string} postData POST data to be submitted in addition to HTML form.
-   * @return {void}
-   */
-	uploadFile:function(o, callback, uri, postData){
-
+   /**
+    * @description Uploads HTML form, inclusive of files/attachments, using the
+    * iframe created in createFrame to facilitate the transaction.
+    * @method uploadFile
+    * @private
+    * @static
+    * @param {int} id The transaction id.
+    * @param {object} callback User-defined callback object.
+    * @param {string} uri Fully qualified path of resource.
+    * @param {string} postData POST data to be submitted in addition to HTML form.
+    * @return {void}
+    */
+	function _uploadFile(o, callback, uri, postData){
 		// Each iframe has an id prefix of "yuiIO" followed
 		// by the unique transaction id.
-		var oConn = this;
-		var frameId = 'yuiIO' + o.tId;
-		var uploadEncoding = 'multipart/form-data';
-		var io = document.getElementById(frameId);
-		var args = (callback && callback.argument)?callback.argument:null;
+		var frameId = 'yuiIO' + o.tId,
+		    uploadEncoding = 'multipart/form-data',
+		    io = document.getElementById(frameId),
+		    ie8 = (document.documentMode && document.documentMode === 8) ? true : false,
+		    oConn = this,
+			args = (callback && callback.argument)?callback.argument:null,
+            oElements,i,prop,obj, rawFormAttributes, uploadCallback;
 
 		// Track original HTML form attribute values.
-		var rawFormAttributes =
-		{
+		rawFormAttributes = {
 			action:this._formNode.getAttribute('action'),
 			method:this._formNode.getAttribute('method'),
 			target:this._formNode.getAttribute('target')
@@ -1161,7 +1449,7 @@
 		this._formNode.setAttribute('method', 'POST');
 		this._formNode.setAttribute('target', frameId);
 
-		if(this._formNode.encoding){
+		if(YAHOO.env.ua.ie && !ie8){
 			// IE does not respect property enctype for HTML forms.
 			// Instead it uses the property - "encoding".
 			this._formNode.setAttribute('encoding', uploadEncoding);
@@ -1171,7 +1459,7 @@
 		}
 
 		if(postData){
-			var oElements = this.appendPostData(postData);
+			oElements = this.appendPostData(postData);
 		}
 
 		// Start file upload.
@@ -1193,7 +1481,7 @@
 
 		// Remove HTML elements created by appendPostData
 		if(oElements && oElements.length > 0){
-			for(var i=0; i < oElements.length; i++){
+			for(i=0; i < oElements.length; i++){
 				this._formNode.removeChild(oElements[i]);
 			}
 		}
@@ -1200,7 +1488,7 @@
 
 		// Restore HTML form attributes to their original
 		// values prior to file upload.
-		for(var prop in rawFormAttributes){
+		for(prop in rawFormAttributes){
 			if(YAHOO.lang.hasOwnProperty(rawFormAttributes, prop)){
 				if(rawFormAttributes[prop]){
 					this._formNode.setAttribute(prop, rawFormAttributes[prop]);
@@ -1217,8 +1505,7 @@
 		// Create the upload callback handler that fires when the iframe
 		// receives the load event.  Subsequently, the event handler is detached
 		// and the iframe removed from the document.
-		var uploadCallback = function()
-		{
+		uploadCallback = function() {
 			if(callback && callback.timeout){
 				window.clearTimeout(oConn._timeOut[o.tId]);
 				delete oConn._timeOut[o.tId];
@@ -1232,9 +1519,10 @@
 				o.completeEvent.fire(o, args);
 			}
 
-			var obj = {};
-			obj.tId = o.tId;
-			obj.argument = callback.argument;
+			obj = {
+			    tId : o.tId,
+			    argument : callback.argument
+            };
 
 			try
 			{
@@ -1264,7 +1552,7 @@
 				o.uploadEvent.fire(obj);
 			}
 
-			YAHOO.util.Event.removeListener(io, "load", uploadCallback);
+			YE.removeListener(io, "load", uploadCallback);
 
 			setTimeout(
 				function(){
@@ -1275,125 +1563,14 @@
 		};
 
 		// Bind the onload handler to the iframe to detect the file upload response.
-		YAHOO.util.Event.addListener(io, "load", uploadCallback);
-	},
+		YE.addListener(io, "load", uploadCallback);
+	}
 
-  /**
-   * @description Method to terminate a transaction, if it has not reached readyState 4.
-   * @method abort
-   * @public
-   * @static
-   * @param {object} o The connection object returned by asyncRequest.
-   * @param {object} callback  User-defined callback object.
-   * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout.
-   * @return {boolean}
-   */
-	abort:function(o, callback, isTimeout)
-	{
-		var abortStatus;
-		var args = (callback && callback.argument)?callback.argument:null;
+	YCM.setForm = _setForm;
+	YCM.resetFormState = _resetFormState;
+	YCM.createFrame = _createFrame;
+	YCM.appendPostData = _appendPostData;
+	YCM.uploadFile = _uploadFile;
+})();
 
-
-		if(o && o.conn){
-			if(this.isCallInProgress(o)){
-				// Issue abort request
-				o.conn.abort();
-
-				window.clearInterval(this._poll[o.tId]);
-				delete this._poll[o.tId];
-
-				if(isTimeout){
-					window.clearTimeout(this._timeOut[o.tId]);
-					delete this._timeOut[o.tId];
-				}
-
-				abortStatus = true;
-			}
-		}
-		else if(o && o.isUpload === true){
-			var frameId = 'yuiIO' + o.tId;
-			var io = document.getElementById(frameId);
-
-			if(io){
-				// Remove all listeners on the iframe prior to
-				// its destruction.
-				YAHOO.util.Event.removeListener(io, "load");
-				// Destroy the iframe facilitating the transaction.
-				document.body.removeChild(io);
-				YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
-
-				if(isTimeout){
-					window.clearTimeout(this._timeOut[o.tId]);
-					delete this._timeOut[o.tId];
-				}
-
-				abortStatus = true;
-			}
-		}
-		else{
-			abortStatus = false;
-		}
-
-		if(abortStatus === true){
-			// Fire global custom event -- abortEvent
-			this.abortEvent.fire(o, args);
-
-			if(o.abortEvent){
-				// Fire transaction custom event -- abortEvent
-				o.abortEvent.fire(o, args);
-			}
-
-			this.handleTransactionResponse(o, callback, true);
-			YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');
-		}
-
-		return abortStatus;
-	},
-
-  /**
-   * @description Determines if the transaction is still being processed.
-   * @method isCallInProgress
-   * @public
-   * @static
-   * @param {object} o The connection object returned by asyncRequest
-   * @return {boolean}
-   */
-	isCallInProgress:function(o)
-	{
-		// if the XHR object assigned to the transaction has not been dereferenced,
-		// then check its readyState status.  Otherwise, return false.
-		if(o && o.conn){
-			return o.conn.readyState !== 4 && o.conn.readyState !== 0;
-		}
-		else if(o && o.isUpload === true){
-			var frameId = 'yuiIO' + o.tId;
-			return document.getElementById(frameId)?true:false;
-		}
-		else{
-			return false;
-		}
-	},
-
-  /**
-   * @description Dereference the XHR instance and the connection object after the transaction is completed.
-   * @method releaseObject
-   * @private
-   * @static
-   * @param {object} o The connection object
-   * @return {void}
-   */
-	releaseObject:function(o)
-	{
-		if(o && o.conn){
-			//dereference the XHR instance.
-			o.conn = null;
-
-			YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
-
-			//dereference the connection object.
-			o = null;
-		}
-	}
-};
-
-YAHOO.register("connection", YAHOO.util.Connect, {version: "2.4.1", build: "742"});
+YAHOO.register("connection", YAHOO.util.Connect, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/dom/dom.js
===================================================================
--- branches/2.8.x/wb/include/yui/dom/dom.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/dom/dom.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 /**
  * The dom module provides helper methods for manipulating Dom elements.
@@ -11,136 +11,80 @@
  */
 
 (function() {
-    var Y = YAHOO.util,     // internal shorthand
-        getStyle,           // for load time browser branching
-        setStyle,           // ditto
-        id_counter = 0,     // for use with generateId
+    // for use with generateId (global to save state if Dom is overwritten)
+    YAHOO.env._id_counter = YAHOO.env._id_counter || 0;
+
+    // internal shorthand
+    var Y = YAHOO.util,
+        lang = YAHOO.lang,
+        UA = YAHOO.env.ua,
+        trim = YAHOO.lang.trim,
         propertyCache = {}, // for faster hyphen converts
-        reClassNameCache = {},          // cache regexes for className
-        document = window.document;     // cache for faster lookups
+        reCache = {}, // cache className regexes
+        RE_TABLE = /^t(?:able|d|h)$/i, // for _calcBorders
+        RE_COLOR = /color$/i,
+
+        // DOM aliases 
+        document = window.document,     
+        documentElement = document.documentElement,
+
+        // string constants
+        OWNER_DOCUMENT = 'ownerDocument',
+        DEFAULT_VIEW = 'defaultView',
+        DOCUMENT_ELEMENT = 'documentElement',
+        COMPAT_MODE = 'compatMode',
+        OFFSET_LEFT = 'offsetLeft',
+        OFFSET_TOP = 'offsetTop',
+        OFFSET_PARENT = 'offsetParent',
+        PARENT_NODE = 'parentNode',
+        NODE_TYPE = 'nodeType',
+        TAG_NAME = 'tagName',
+        SCROLL_LEFT = 'scrollLeft',
+        SCROLL_TOP = 'scrollTop',
+        GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect',
+        GET_COMPUTED_STYLE = 'getComputedStyle',
+        CURRENT_STYLE = 'currentStyle',
+        CSS1_COMPAT = 'CSS1Compat',
+        _BACK_COMPAT = 'BackCompat',
+        _CLASS = 'class', // underscore due to reserved word
+        CLASS_NAME = 'className',
+        EMPTY = '',
+        SPACE = ' ',
+        C_START = '(?:^|\\s)',
+        C_END = '(?= |$)',
+        G = 'g',
+        POSITION = 'position',
+        FIXED = 'fixed',
+        RELATIVE = 'relative',
+        LEFT = 'left',
+        TOP = 'top',
+        MEDIUM = 'medium',
+        BORDER_LEFT_WIDTH = 'borderLeftWidth',
+        BORDER_TOP_WIDTH = 'borderTopWidth',
     
     // brower detection
-    var isOpera = YAHOO.env.ua.opera,
-        isSafari = YAHOO.env.ua.webkit, 
-        isGecko = YAHOO.env.ua.gecko,
-        isIE = YAHOO.env.ua.ie; 
+        isOpera = UA.opera,
+        isSafari = UA.webkit, 
+        isGecko = UA.gecko, 
+        isIE = UA.ie; 
     
-    // regex cache
-    var patterns = {
-        HYPHEN: /(-[a-z])/i, // to normalize get/setStyle
-        ROOT_TAG: /^body|html$/i // body for quirks mode, html for standards
-    };
-
-    var toCamel = function(property) {
-        if ( !patterns.HYPHEN.test(property) ) {
-            return property; // no hyphens
-        }
-        
-        if (propertyCache[property]) { // already converted
-            return propertyCache[property];
-        }
-       
-        var converted = property;
- 
-        while( patterns.HYPHEN.exec(converted) ) {
-            converted = converted.replace(RegExp.$1,
-                    RegExp.$1.substr(1).toUpperCase());
-        }
-        
-        propertyCache[property] = converted;
-        return converted;
-        //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug
-    };
-    
-    var getClassRegEx = function(className) {
-        var re = reClassNameCache[className];
-        if (!re) {
-            re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
-            reClassNameCache[className] = re;
-        }
-        return re;
-    };
-
-    // branching at load instead of runtime
-    if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method
-        getStyle = function(el, property) {
-            var value = null;
-            
-            if (property == 'float') { // fix reserved word
-                property = 'cssFloat';
-            }
-
-            var computed = document.defaultView.getComputedStyle(el, '');
-            if (computed) { // test computed before touching for safari
-                value = computed[toCamel(property)];
-            }
-            
-            return el.style[property] || value;
-        };
-    } else if (document.documentElement.currentStyle && isIE) { // IE method
-        getStyle = function(el, property) {                         
-            switch( toCamel(property) ) {
-                case 'opacity' :// IE opacity uses filter
-                    var val = 100;
-                    try { // will error if no DXImageTransform
-                        val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;
-
-                    } catch(e) {
-                        try { // make sure its in the document
-                            val = el.filters('alpha').opacity;
-                        } catch(e) {
-                        }
-                    }
-                    return val / 100;
-                case 'float': // fix reserved word
-                    property = 'styleFloat'; // fall through
-                default: 
-                    // test currentStyle before touching
-                    var value = el.currentStyle ? el.currentStyle[property] : null;
-                    return ( el.style[property] || value );
-            }
-        };
-    } else { // default to inline only
-        getStyle = function(el, property) { return el.style[property]; };
-    }
-    
-    if (isIE) {
-        setStyle = function(el, property, val) {
-            switch (property) {
-                case 'opacity':
-                    if ( YAHOO.lang.isString(el.style.filter) ) { // in case not appended
-                        el.style.filter = 'alpha(opacity=' + val * 100 + ')';
-                        
-                        if (!el.currentStyle || !el.currentStyle.hasLayout) {
-                            el.style.zoom = 1; // when no layout or cant tell
-                        }
-                    }
-                    break;
-                case 'float':
-                    property = 'styleFloat';
-                default:
-                el.style[property] = val;
-            }
-        };
-    } else {
-        setStyle = function(el, property, val) {
-            if (property == 'float') {
-                property = 'cssFloat';
-            }
-            el.style[property] = val;
-        };
-    }
-
-    var testElement = function(node, method) {
-        return node && node.nodeType == 1 && ( !method || method(node) );
-    };
-
     /**
      * Provides helper methods for DOM elements.
      * @namespace YAHOO.util
      * @class Dom
+     * @requires yahoo, event
      */
-    YAHOO.util.Dom = {
+    Y.Dom = {
+        CUSTOM_ATTRIBUTES: (!documentElement.hasAttribute) ? { // IE < 8
+            'for': 'htmlFor',
+            'class': CLASS_NAME
+        } : { // w3c
+            'htmlFor': 'for',
+            'className': _CLASS
+        },
+
+        DOT_ATTRIBUTES: {},
+
         /**
          * Returns an HTMLElement reference.
          * @method get
@@ -148,26 +92,58 @@
          * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.
          */
         get: function(el) {
-            if (el && (el.tagName || el.item)) { // HTMLElement, or HTMLCollection
-                return el;
-            }
+            var id, nodes, c, i, len, attr;
 
-            if (YAHOO.lang.isString(el) || !el) { // HTMLElement or null
-                return document.getElementById(el);
-            }
-            
-            if (el.length !== undefined) { // array-like 
-                var c = [];
-                for (var i = 0, len = el.length; i < len; ++i) {
-                    c[c.length] = Y.Dom.get(el[i]);
+            if (el) {
+                if (el[NODE_TYPE] || el.item) { // Node, or NodeList
+                    return el;
                 }
+
+                if (typeof el === 'string') { // id
+                    id = el;
+                    el = document.getElementById(el);
+                    attr = (el) ? el.attributes : null;
+                    if (el && attr && attr.id && attr.id.value === id) { // IE: avoid false match on "name" attribute
+                        return el;
+                    } else if (el && document.all) { // filter by name
+                        el = null;
+                        nodes = document.all[id];
+                        for (i = 0, len = nodes.length; i < len; ++i) {
+                            if (nodes[i].id === id) {
+                                return nodes[i];
+                            }
+                        }
+                    }
+                    return el;
+                }
                 
-                return c;
+                if (YAHOO.util.Element && el instanceof YAHOO.util.Element) {
+                    el = el.get('element');
+                }
+
+                if ('length' in el) { // array-like 
+                    c = [];
+                    for (i = 0, len = el.length; i < len; ++i) {
+                        c[c.length] = Y.Dom.get(el[i]);
+                    }
+                    
+                    return c;
+                }
+
+                return el; // some other object, just pass it back
             }
 
-            return el; // some other object, just pass it back
+            return null;
         },
     
+        getComputedStyle: function(el, property) {
+            if (window[GET_COMPUTED_STYLE]) {
+                return el[OWNER_DOCUMENT][DEFAULT_VIEW][GET_COMPUTED_STYLE](el, null)[property];
+            } else if (el[CURRENT_STYLE]) {
+                return Y.Dom.IE_ComputedStyle.get(el, property);
+            }
+        },
+
         /**
          * Normalizes currentStyle and ComputedStyle.
          * @method getStyle
@@ -176,14 +152,55 @@
          * @return {String | Array} The current value of the style property for the element(s).
          */
         getStyle: function(el, property) {
-            property = toCamel(property);
-            
-            var f = function(element) {
-                return getStyle(element, property);
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, Y.Dom._getStyle, property);
         },
+
+        // branching at load instead of runtime
+        _getStyle: function() {
+            if (window[GET_COMPUTED_STYLE]) { // W3C DOM method
+                return function(el, property) {
+                    property = (property === 'float') ? property = 'cssFloat' :
+                            Y.Dom._toCamel(property);
+
+                    var value = el.style[property],
+                        computed;
+                    
+                    if (!value) {
+                        computed = el[OWNER_DOCUMENT][DEFAULT_VIEW][GET_COMPUTED_STYLE](el, null);
+                        if (computed) { // test computed before touching for safari
+                            value = computed[property];
+                        }
+                    }
+                    
+                    return value;
+                };
+            } else if (documentElement[CURRENT_STYLE]) {
+                return function(el, property) {                         
+                    var value;
+
+                    switch(property) {
+                        case 'opacity' :// IE opacity uses filter
+                            value = 100;
+                            try { // will error if no DXImageTransform
+                                value = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;
+
+                            } catch(e) {
+                                try { // make sure its in the document
+                                    value = el.filters('alpha').opacity;
+                                } catch(err) {
+                                }
+                            }
+                            return value / 100;
+                        case 'float': // fix reserved word
+                            property = 'styleFloat'; // fall through
+                        default: 
+                            property = Y.Dom._toCamel(property);
+                            value = el[CURRENT_STYLE] ? el[CURRENT_STYLE][property] : null;
+                            return ( el.style[property] || value );
+                    }
+                };
+            }
+        }(),
     
         /**
          * Wrapper for setting style properties of HTMLElements.  Normalizes "opacity" across modern browsers.
@@ -193,35 +210,187 @@
          * @param {String} val The value to apply to the given property.
          */
         setStyle: function(el, property, val) {
-            property = toCamel(property);
-            
-            var f = function(element) {
-                setStyle(element, property, val);
-                
-            };
-            
-            Y.Dom.batch(el, f, Y.Dom, true);
+            Y.Dom.batch(el, Y.Dom._setStyle, { prop: property, val: val });
         },
+
+        _setStyle: function() {
+            if (isIE) {
+                return function(el, args) {
+                    var property = Y.Dom._toCamel(args.prop),
+                        val = args.val;
+
+                    if (el) {
+                        switch (property) {
+                            case 'opacity':
+                                if ( lang.isString(el.style.filter) ) { // in case not appended
+                                    el.style.filter = 'alpha(opacity=' + val * 100 + ')';
+                                    
+                                    if (!el[CURRENT_STYLE] || !el[CURRENT_STYLE].hasLayout) {
+                                        el.style.zoom = 1; // when no layout or cant tell
+                                    }
+                                }
+                                break;
+                            case 'float':
+                                property = 'styleFloat';
+                            default:
+                            el.style[property] = val;
+                        }
+                    } else {
+                    }
+                };
+            } else {
+                return function(el, args) {
+                    var property = Y.Dom._toCamel(args.prop),
+                        val = args.val;
+                    if (el) {
+                        if (property == 'float') {
+                            property = 'cssFloat';
+                        }
+                        el.style[property] = val;
+                    } else {
+                    }
+                };
+            }
+
+        }(),
         
         /**
-         * Gets the current position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+         * Gets the current position of an element based on page coordinates. 
+         * Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
          * @method getXY
-         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM
+         * reference, or an Array of IDs and/or HTMLElements
          * @return {Array} The XY position of the element(s)
          */
         getXY: function(el) {
-            var f = function(el) {
-                // has to be part of document to have pageXY
-                if ( (el.parentNode === null || el.offsetParent === null ||
-                        this.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) {
-                    return false;
-                }
-                
-                return getXY(el);
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, Y.Dom._getXY);
         },
+
+        _canPosition: function(el) {
+            return ( Y.Dom._getStyle(el, 'display') !== 'none' && Y.Dom._inDoc(el) );
+        },
+
+        _getXY: function() {
+            if (document[DOCUMENT_ELEMENT][GET_BOUNDING_CLIENT_RECT]) {
+                return function(node) {
+                    var scrollLeft, scrollTop, box, doc,
+                        off1, off2, mode, bLeft, bTop,
+                        floor = Math.floor, // TODO: round?
+                        xy = false;
+
+                    if (Y.Dom._canPosition(node)) {
+                        box = node[GET_BOUNDING_CLIENT_RECT]();
+                        doc = node[OWNER_DOCUMENT];
+                        scrollLeft = Y.Dom.getDocumentScrollLeft(doc);
+                        scrollTop = Y.Dom.getDocumentScrollTop(doc);
+                        xy = [floor(box[LEFT]), floor(box[TOP])];
+
+                        if (isIE && UA.ie < 8) { // IE < 8: viewport off by 2
+                            off1 = 2;
+                            off2 = 2;
+                            mode = doc[COMPAT_MODE];
+
+                            if (UA.ie === 6) {
+                                if (mode !== _BACK_COMPAT) {
+                                    off1 = 0;
+                                    off2 = 0;
+                                }
+                            }
+                            
+                            if ((mode === _BACK_COMPAT)) {
+                                bLeft = _getComputedStyle(doc[DOCUMENT_ELEMENT], BORDER_LEFT_WIDTH);
+                                bTop = _getComputedStyle(doc[DOCUMENT_ELEMENT], BORDER_TOP_WIDTH);
+                                if (bLeft !== MEDIUM) {
+                                    off1 = parseInt(bLeft, 10);
+                                }
+                                if (bTop !== MEDIUM) {
+                                    off2 = parseInt(bTop, 10);
+                                }
+                            }
+                            
+                            xy[0] -= off1;
+                            xy[1] -= off2;
+
+                        }
+
+                        if ((scrollTop || scrollLeft)) {
+                            xy[0] += scrollLeft;
+                            xy[1] += scrollTop;
+                        }
+
+                        // gecko may return sub-pixel (non-int) values
+                        xy[0] = floor(xy[0]);
+                        xy[1] = floor(xy[1]);
+                    } else {
+                    }
+
+                    return xy;
+                };
+            } else {
+                return function(node) { // ff2, safari: manually calculate by crawling up offsetParents
+                    var docScrollLeft, docScrollTop,
+                        scrollTop, scrollLeft,
+                        bCheck,
+                        xy = false,
+                        parentNode = node;
+
+                    if  (Y.Dom._canPosition(node) ) {
+                        xy = [node[OFFSET_LEFT], node[OFFSET_TOP]];
+                        docScrollLeft = Y.Dom.getDocumentScrollLeft(node[OWNER_DOCUMENT]);
+                        docScrollTop = Y.Dom.getDocumentScrollTop(node[OWNER_DOCUMENT]);
+
+                        // TODO: refactor with !! or just falsey
+                        bCheck = ((isGecko || UA.webkit > 519) ? true : false);
+
+                        // TODO: worth refactoring for TOP/LEFT only?
+                        while ((parentNode = parentNode[OFFSET_PARENT])) {
+                            xy[0] += parentNode[OFFSET_LEFT];
+                            xy[1] += parentNode[OFFSET_TOP];
+                            if (bCheck) {
+                                xy = Y.Dom._calcBorders(parentNode, xy);
+                            }
+                        }
+
+                        // account for any scrolled ancestors
+                        if (Y.Dom._getStyle(node, POSITION) !== FIXED) {
+                            parentNode = node;
+
+                            while ((parentNode = parentNode[PARENT_NODE]) && parentNode[TAG_NAME]) {
+                                scrollTop = parentNode[SCROLL_TOP];
+                                scrollLeft = parentNode[SCROLL_LEFT];
+
+                                //Firefox does something funky with borders when overflow is not visible.
+                                if (isGecko && (Y.Dom._getStyle(parentNode, 'overflow') !== 'visible')) {
+                                        xy = Y.Dom._calcBorders(parentNode, xy);
+                                }
+
+                                if (scrollTop || scrollLeft) {
+                                    xy[0] -= scrollLeft;
+                                    xy[1] -= scrollTop;
+                                }
+                            }
+                            xy[0] += docScrollLeft;
+                            xy[1] += docScrollTop;
+
+                        } else {
+                            //Fix FIXED position -- add scrollbars
+                            if (isOpera) {
+                                xy[0] -= docScrollLeft;
+                                xy[1] -= docScrollTop;
+                            } else if (isSafari || isGecko) {
+                                xy[0] += docScrollLeft;
+                                xy[1] += docScrollTop;
+                            }
+                        }
+                        //Round the numbers so we get sane data back
+                        xy[0] = Math.floor(xy[0]);
+                        xy[1] = Math.floor(xy[1]);
+                    } else {
+                    }
+                    return xy;                
+                };
+            }
+        }(), // NOTE: Executing for loadtime branching
         
         /**
          * Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
@@ -260,46 +429,59 @@
          * @param {Boolean} noRetry By default we try and set the position a second time if the first fails
          */
         setXY: function(el, pos, noRetry) {
-            var f = function(el) {
-                var style_pos = this.getStyle(el, 'position');
-                if (style_pos == 'static') { // default to relative
-                    this.setStyle(el, 'position', 'relative');
-                    style_pos = 'relative';
-                }
+            Y.Dom.batch(el, Y.Dom._setXY, { pos: pos, noRetry: noRetry });
+        },
 
-                var pageXY = this.getXY(el);
-                if (pageXY === false) { // has to be part of doc to have pageXY
-                    return false; 
-                }
-                
-                var delta = [ // assuming pixels; if not we will have to retry
-                    parseInt( this.getStyle(el, 'left'), 10 ),
-                    parseInt( this.getStyle(el, 'top'), 10 )
-                ];
-            
-                if ( isNaN(delta[0]) ) {// in case of 'auto'
-                    delta[0] = (style_pos == 'relative') ? 0 : el.offsetLeft;
-                } 
-                if ( isNaN(delta[1]) ) { // in case of 'auto'
-                    delta[1] = (style_pos == 'relative') ? 0 : el.offsetTop;
-                } 
+        _setXY: function(node, args) {
+            var pos = Y.Dom._getStyle(node, POSITION),
+                setStyle = Y.Dom.setStyle,
+                xy = args.pos,
+                noRetry = args.noRetry,
+
+                delta = [ // assuming pixels; if not we will have to retry
+                    parseInt( Y.Dom.getComputedStyle(node, LEFT), 10 ),
+                    parseInt( Y.Dom.getComputedStyle(node, TOP), 10 )
+                ],
+
+                currentXY,
+                newXY;
         
-                if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }
-                if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }
-              
-                if (!noRetry) {
-                    var newXY = this.getXY(el);
+            if (pos == 'static') { // default to relative
+                pos = RELATIVE;
+                setStyle(node, POSITION, pos);
+            }
 
-                    // if retry is true, try one more time if we miss 
-                   if ( (pos[0] !== null && newXY[0] != pos[0]) || 
-                        (pos[1] !== null && newXY[1] != pos[1]) ) {
-                       this.setXY(el, pos, true);
-                   }
-                }        
-        
-            };
+            currentXY = Y.Dom._getXY(node);
+
+            if (!xy || currentXY === false) { // has to be part of doc to have xy
+                return false; 
+            }
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            if ( isNaN(delta[0]) ) {// in case of 'auto'
+                delta[0] = (pos == RELATIVE) ? 0 : node[OFFSET_LEFT];
+            } 
+            if ( isNaN(delta[1]) ) { // in case of 'auto'
+                delta[1] = (pos == RELATIVE) ? 0 : node[OFFSET_TOP];
+            } 
+
+            if (xy[0] !== null) { // from setX
+                setStyle(node, LEFT, xy[0] - currentXY[0] + delta[0] + 'px');
+            }
+
+            if (xy[1] !== null) { // from setY
+                setStyle(node, TOP, xy[1] - currentXY[1] + delta[1] + 'px');
+            }
+          
+            if (!noRetry) {
+                newXY = Y.Dom._getXY(node);
+
+                // if retry is true, try one more time if we miss 
+               if ( (xy[0] !== null && newXY[0] != xy[0]) || 
+                    (xy[1] !== null && newXY[1] != xy[1]) ) {
+                   Y.Dom._setXY(node, { pos: xy, noRetry: true });
+               }
+            }        
+
         },
         
         /**
@@ -333,12 +515,12 @@
          */
         getRegion: function(el) {
             var f = function(el) {
-                if ( (el.parentNode === null || el.offsetParent === null ||
-                        this.getStyle(el, 'display') == 'none') && el != document.body) {
-                    return false;
+                var region = false;
+                if ( Y.Dom._canPosition(el) ) {
+                    region = Y.Region.getRegion(el);
+                } else {
                 }
 
-                var region = Y.Region.getRegion(el);
                 return region;
             };
             
@@ -366,16 +548,23 @@
         },
 
         /**
-         * Returns a array of HTMLElements with the given class.
+         * Returns an array of HTMLElements with the given class.
          * For optimized performance, include a tag and/or root node when possible.
+         * Note: This method operates against a live collection, so modifying the 
+         * collection in the callback (removing/appending nodes, etc.) will have
+         * side effects.  Instead you should iterate the returned nodes array,
+         * as you would with the native "getElementsByTagName" method. 
          * @method getElementsByClassName
          * @param {String} className The class name to match against
          * @param {String} tag (optional) The tag name of the elements being collected
-         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point.
+         * This element is not included in the className scan.
          * @param {Function} apply (optional) A function to apply to each element when found 
+         * @param {Any} o (optional) An optional arg that is passed to the supplied method
+         * @param {Boolean} overrides (optional) Whether or not to override the scope of "method" with "o"
          * @return {Array} An array of elements that have the given class name
          */
-        getElementsByClassName: function(className, tag, root, apply) {
+        getElementsByClassName: function(className, tag, root, apply, o, overrides) {
             tag = tag || '*';
             root = (root) ? Y.Dom.get(root) : null || document; 
             if (!root) {
@@ -384,17 +573,18 @@
 
             var nodes = [],
                 elements = root.getElementsByTagName(tag),
-                re = getClassRegEx(className);
+                hasClass = Y.Dom.hasClass;
 
             for (var i = 0, len = elements.length; i < len; ++i) {
-                if ( re.test(elements[i].className) ) {
+                if ( hasClass(elements[i], className) ) {
                     nodes[nodes.length] = elements[i];
-                    if (apply) {
-                        apply.call(elements[i], elements[i]);
-                    }
                 }
             }
             
+            if (apply) {
+                Y.Dom.batch(nodes, apply, o, overrides);
+            }
+
             return nodes;
         },
 
@@ -406,13 +596,25 @@
          * @return {Boolean | Array} A boolean value or array of boolean values
          */
         hasClass: function(el, className) {
-            var re = getClassRegEx(className);
+            return Y.Dom.batch(el, Y.Dom._hasClass, className);
+        },
 
-            var f = function(el) {
-                return re.test(el.className);
-            };
+        _hasClass: function(el, className) {
+            var ret = false,
+                current;
             
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            if (el && className) {
+                current = Y.Dom._getAttribute(el, CLASS_NAME) || EMPTY;
+                if (className.exec) {
+                    ret = className.test(current);
+                } else {
+                    ret = className && (SPACE + current + SPACE).
+                        indexOf(SPACE + className + SPACE) > -1;
+                }
+            } else {
+            }
+
+            return ret;
         },
     
         /**
@@ -423,17 +625,23 @@
          * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         addClass: function(el, className) {
-            var f = function(el) {
-                if (this.hasClass(el, className)) {
-                    return false; // already present
+            return Y.Dom.batch(el, Y.Dom._addClass, className);
+        },
+
+        _addClass: function(el, className) {
+            var ret = false,
+                current;
+
+            if (el && className) {
+                current = Y.Dom._getAttribute(el, CLASS_NAME) || EMPTY;
+                if ( !Y.Dom._hasClass(el, className) ) {
+                    Y.Dom.setAttribute(el, CLASS_NAME, trim(current + SPACE + className));
+                    ret = true;
                 }
-                
-                
-                el.className = YAHOO.lang.trim([el.className, className].join(' '));
-                return true;
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            } else {
+            }
+
+            return ret;
         },
     
         /**
@@ -444,25 +652,34 @@
          * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         removeClass: function(el, className) {
-            var re = getClassRegEx(className);
-            
-            var f = function(el) {
-                if (!this.hasClass(el, className)) {
-                    return false; // not present
-                }                 
+            return Y.Dom.batch(el, Y.Dom._removeClass, className);
+        },
+        
+        _removeClass: function(el, className) {
+            var ret = false,
+                current,
+                newClass,
+                attr;
 
-                
-                var c = el.className;
-                el.className = c.replace(re, ' ');
-                if ( this.hasClass(el, className) ) { // in case of multiple adjacent
-                    this.removeClass(el, className);
+            if (el && className) {
+                current = Y.Dom._getAttribute(el, CLASS_NAME) || EMPTY;
+                Y.Dom.setAttribute(el, CLASS_NAME, current.replace(Y.Dom._getClassRegex(className), EMPTY));
+
+                newClass = Y.Dom._getAttribute(el, CLASS_NAME);
+                if (current !== newClass) { // else nothing changed
+                    Y.Dom.setAttribute(el, CLASS_NAME, trim(newClass)); // trim after comparing to current class
+                    ret = true;
+
+                    if (Y.Dom._getAttribute(el, CLASS_NAME) === '') { // remove class attribute if empty
+                        attr = (el.hasAttribute && el.hasAttribute(_CLASS)) ? _CLASS : CLASS_NAME;
+                        el.removeAttribute(attr);
+                    }
                 }
 
-                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
-                return true;
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            } else {
+            }
+
+            return ret;
         },
         
         /**
@@ -475,30 +692,39 @@
          * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         replaceClass: function(el, oldClassName, newClassName) {
-            if (!newClassName || oldClassName === newClassName) { // avoid infinite loop
-                return false;
-            }
-            
-            var re = getClassRegEx(oldClassName);
+            return Y.Dom.batch(el, Y.Dom._replaceClass, { from: oldClassName, to: newClassName });
+        },
 
-            var f = function(el) {
-            
-                if ( !this.hasClass(el, oldClassName) ) {
-                    this.addClass(el, newClassName); // just add it if nothing to replace
-                    return true; // NOTE: return
-                }
-            
-                el.className = el.className.replace(re, ' ' + newClassName + ' ');
+        _replaceClass: function(el, classObj) {
+            var className,
+                from,
+                to,
+                ret = false,
+                current;
 
-                if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent
-                    this.replaceClass(el, oldClassName, newClassName);
+            if (el && classObj) {
+                from = classObj.from;
+                to = classObj.to;
+
+                if (!to) {
+                    ret = false;
+                }  else if (!from) { // just add if no "from"
+                    ret = Y.Dom._addClass(el, classObj.to);
+                } else if (from !== to) { // else nothing to replace
+                    // May need to lead with DBLSPACE?
+                    current = Y.Dom._getAttribute(el, CLASS_NAME) || EMPTY;
+                    className = (SPACE + current.replace(Y.Dom._getClassRegex(from), SPACE + to)).
+                               split(Y.Dom._getClassRegex(to));
+
+                    // insert to into what would have been the first occurrence slot
+                    className.splice(1, 0, SPACE + to);
+                    Y.Dom.setAttribute(el, CLASS_NAME, trim(className.join(EMPTY)));
+                    ret = true;
                 }
+            } else {
+            }
 
-                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
-                return true;
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            return ret;
         },
         
         /**
@@ -514,11 +740,15 @@
             var f = function(el) {
                 if (el && el.id) { // do not override existing ID
                     return el.id;
-                } 
+                }
 
-                var id = prefix + id_counter++;
+                var id = prefix + YAHOO.env._id_counter++;
 
                 if (el) {
+                    if (el[OWNER_DOCUMENT] && el[OWNER_DOCUMENT].getElementById(id)) { // in case one already exists
+                        // use failed id plus prefix to help ensure uniqueness
+                        return Y.Dom.generateId(el, id + prefix);
+                    }
                     el.id = id;
                 }
                 
@@ -540,22 +770,18 @@
             haystack = Y.Dom.get(haystack);
             needle = Y.Dom.get(needle);
             
-            if (!haystack || !needle) {
-                return false;
-            }
+            var ret = false;
 
-            if (haystack.contains && needle.nodeType && !isSafari) { // safari contains is broken
-                return haystack.contains(needle);
+            if ( (haystack && needle) && (haystack[NODE_TYPE] && needle[NODE_TYPE]) ) {
+                if (haystack.contains && haystack !== needle) { // contains returns true when equal
+                    ret = haystack.contains(needle);
+                }
+                else if (haystack.compareDocumentPosition) { // gecko
+                    ret = !!(haystack.compareDocumentPosition(needle) & 16);
+                }
+            } else {
             }
-            else if ( haystack.compareDocumentPosition && needle.nodeType ) {
-                return !!(haystack.compareDocumentPosition(needle) & 16);
-            } else if (needle.nodeType) {
-                // fallback to crawling up (safari)
-                return !!this.getAncestorBy(needle, function(el) {
-                    return el == haystack; 
-                }); 
-            }
-            return false;
+            return ret;
         },
         
         /**
@@ -562,23 +788,40 @@
          * Determines whether an HTMLElement is present in the current document.
          * @method inDocument         
          * @param {String | HTMLElement} el The element to search for
+         * @param {Object} doc An optional document to search, defaults to element's owner document 
          * @return {Boolean} Whether or not the element is present in the current document
          */
-        inDocument: function(el) {
-            return this.isAncestor(document.documentElement, el);
+        inDocument: function(el, doc) {
+            return Y.Dom._inDoc(Y.Dom.get(el), doc);
         },
+
+        _inDoc: function(el, doc) {
+            var ret = false;
+            if (el && el[TAG_NAME]) {
+                doc = doc || el[OWNER_DOCUMENT]; 
+                ret = Y.Dom.isAncestor(doc[DOCUMENT_ELEMENT], el);
+            } else {
+            }
+            return ret;
+        },
         
         /**
-         * Returns a array of HTMLElements that pass the test applied by supplied boolean method.
+         * Returns an array of HTMLElements that pass the test applied by supplied boolean method.
          * For optimized performance, include a tag and/or root node when possible.
+         * Note: This method operates against a live collection, so modifying the 
+         * collection in the callback (removing/appending nodes, etc.) will have
+         * side effects.  Instead you should iterate the returned nodes array,
+         * as you would with the native "getElementsByTagName" method. 
          * @method getElementsBy
          * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
          * @param {String} tag (optional) The tag name of the elements being collected
          * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
          * @param {Function} apply (optional) A function to apply to each element when found 
+         * @param {Any} o (optional) An optional arg that is passed to the supplied method
+         * @param {Boolean} overrides (optional) Whether or not to override the scope of "method" with "o"
          * @return {Array} Array of HTMLElements
          */
-        getElementsBy: function(method, tag, root, apply) {
+        getElementsBy: function(method, tag, root, apply, o, overrides, firstOnly) {
             tag = tag || '*';
             root = (root) ? Y.Dom.get(root) : null || document; 
 
@@ -591,18 +834,36 @@
             
             for (var i = 0, len = elements.length; i < len; ++i) {
                 if ( method(elements[i]) ) {
-                    nodes[nodes.length] = elements[i];
-                    if (apply) {
-                        apply(elements[i]);
+                    if (firstOnly) {
+                        nodes = elements[i]; 
+                        break;
+                    } else {
+                        nodes[nodes.length] = elements[i];
                     }
                 }
             }
 
+            if (apply) {
+                Y.Dom.batch(nodes, apply, o, overrides);
+            }
+
             
             return nodes;
         },
         
         /**
+         * Returns the first HTMLElement that passes the test applied by the supplied boolean method.
+         * @method getElementBy
+         * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
+         * @param {String} tag (optional) The tag name of the elements being collected
+         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @return {HTMLElement}
+         */
+        getElementBy: function(method, tag, root) {
+            return Y.Dom.getElementsBy(method, tag, root, null, null, null, true); 
+        },
+
+        /**
          * Runs the supplied method against each item in the Collection/Array.
          * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).
          * @method batch
@@ -609,27 +870,25 @@
          * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to
          * @param {Function} method The method to apply to the element(s)
          * @param {Any} o (optional) An optional arg that is passed to the supplied method
-         * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"
+         * @param {Boolean} overrides (optional) Whether or not to override the scope of "method" with "o"
          * @return {Any | Array} The return value(s) from the supplied method
          */
-        batch: function(el, method, o, override) {
-            el = (el && (el.tagName || el.item)) ? el : Y.Dom.get(el); // skip get() when possible
+        batch: function(el, method, o, overrides) {
+            var collection = [],
+                scope = (overrides) ? o : window;
+                
+            el = (el && (el[TAG_NAME] || el.item)) ? el : Y.Dom.get(el); // skip get() when possible
+            if (el && method) {
+                if (el[TAG_NAME] || el.length === undefined) { // element or not array-like 
+                    return method.call(scope, el, o);
+                } 
 
-            if (!el || !method) {
+                for (var i = 0; i < el.length; ++i) {
+                    collection[collection.length] = method.call(scope, el[i], o);
+                }
+            } else {
                 return false;
             } 
-            var scope = (override) ? o : window;
-            
-            if (el.tagName || el.length === undefined) { // element or not array-like 
-                return method.call(scope, el, o);
-            } 
-
-            var collection = [];
-            
-            for (var i = 0, len = el.length; i < len; ++i) {
-                collection[collection.length] = method.call(scope, el[i], o);
-            }
-            
             return collection;
         },
         
@@ -639,9 +898,9 @@
          * @return {Int} The height of the actual document (which includes the body and its margin).
          */
         getDocumentHeight: function() {
-            var scrollHeight = (document.compatMode != 'CSS1Compat') ? document.body.scrollHeight : document.documentElement.scrollHeight;
+            var scrollHeight = (document[COMPAT_MODE] != CSS1_COMPAT || isSafari) ? document.body.scrollHeight : documentElement.scrollHeight,
+                h = Math.max(scrollHeight, Y.Dom.getViewportHeight());
 
-            var h = Math.max(scrollHeight, Y.Dom.getViewportHeight());
             return h;
         },
         
@@ -651,8 +910,8 @@
          * @return {Int} The width of the actual document (which includes the body and its margin).
          */
         getDocumentWidth: function() {
-            var scrollWidth = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth;
-            var w = Math.max(scrollWidth, Y.Dom.getViewportWidth());
+            var scrollWidth = (document[COMPAT_MODE] != CSS1_COMPAT || isSafari) ? document.body.scrollWidth : documentElement.scrollWidth,
+                w = Math.max(scrollWidth, Y.Dom.getViewportWidth());
             return w;
         },
 
@@ -662,12 +921,12 @@
          * @return {Int} The height of the viewable area of the page (excludes scrollbars).
          */
         getViewportHeight: function() {
-            var height = self.innerHeight; // Safari, Opera
-            var mode = document.compatMode;
+            var height = self.innerHeight, // Safari, Opera
+                mode = document[COMPAT_MODE];
         
             if ( (mode || isIE) && !isOpera ) { // IE, Gecko
-                height = (mode == 'CSS1Compat') ?
-                        document.documentElement.clientHeight : // Standards
+                height = (mode == CSS1_COMPAT) ?
+                        documentElement.clientHeight : // Standards
                         document.body.clientHeight; // Quirks
             }
         
@@ -681,12 +940,12 @@
          */
         
         getViewportWidth: function() {
-            var width = self.innerWidth;  // Safari
-            var mode = document.compatMode;
+            var width = self.innerWidth,  // Safari
+                mode = document[COMPAT_MODE];
             
             if (mode || isIE) { // IE, Gecko, Opera
-                width = (mode == 'CSS1Compat') ?
-                        document.documentElement.clientWidth : // Standards
+                width = (mode == CSS1_COMPAT) ?
+                        documentElement.clientWidth : // Standards
                         document.body.clientWidth; // Quirks
             }
             return width;
@@ -701,8 +960,8 @@
          * @return {Object} HTMLElement or null if not found
          */
         getAncestorBy: function(node, method) {
-            while (node = node.parentNode) { // NOTE: assignment
-                if ( testElement(node, method) ) {
+            while ( (node = node[PARENT_NODE]) ) { // NOTE: assignment
+                if ( Y.Dom._testElement(node, method) ) {
                     return node;
                 }
             } 
@@ -739,7 +998,7 @@
                 return null;
             }
             var method = function(el) {
-                 return el.tagName && el.tagName.toUpperCase() == tagName.toUpperCase();
+                 return el[TAG_NAME] && el[TAG_NAME].toUpperCase() == tagName.toUpperCase();
             };
 
             return Y.Dom.getAncestorBy(node, method);
@@ -758,7 +1017,7 @@
         getPreviousSiblingBy: function(node, method) {
             while (node) {
                 node = node.previousSibling;
-                if ( testElement(node, method) ) {
+                if ( Y.Dom._testElement(node, method) ) {
                     return node;
                 }
             }
@@ -793,7 +1052,7 @@
         getNextSiblingBy: function(node, method) {
             while (node) {
                 node = node.nextSibling;
-                if ( testElement(node, method) ) {
+                if ( Y.Dom._testElement(node, method) ) {
                     return node;
                 }
             }
@@ -824,7 +1083,7 @@
          * @return {Object} HTMLElement or null if not found
          */
         getFirstChildBy: function(node, method) {
-            var child = ( testElement(node.firstChild, method) ) ? node.firstChild : null;
+            var child = ( Y.Dom._testElement(node.firstChild, method) ) ? node.firstChild : null;
             return child || Y.Dom.getNextSiblingBy(node.firstChild, method);
         }, 
 
@@ -854,7 +1113,7 @@
             if (!node) {
                 return null;
             }
-            var child = ( testElement(node.lastChild, method) ) ? node.lastChild : null;
+            var child = ( Y.Dom._testElement(node.lastChild, method) ) ? node.lastChild : null;
             return child || Y.Dom.getPreviousSiblingBy(node.lastChild, method);
         }, 
 
@@ -878,8 +1137,8 @@
          * @return {Array} A static array of HTMLElements
          */
         getChildrenBy: function(node, method) {
-            var child = Y.Dom.getFirstChildBy(node, method);
-            var children = child ? [child] : [];
+            var child = Y.Dom.getFirstChildBy(node, method),
+                children = child ? [child] : [];
 
             Y.Dom.getNextSiblingBy(child, function(node) {
                 if ( !method || method(node) ) {
@@ -904,7 +1163,7 @@
 
             return Y.Dom.getChildrenBy(node);
         },
- 
+
         /**
          * Returns the left scroll value of the document 
          * @method getDocumentScrollLeft
@@ -913,7 +1172,7 @@
          */
         getDocumentScrollLeft: function(doc) {
             doc = doc || document;
-            return Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
+            return Math.max(doc[DOCUMENT_ELEMENT].scrollLeft, doc.body.scrollLeft);
         }, 
 
         /**
@@ -924,7 +1183,7 @@
          */
         getDocumentScrollTop: function(doc) {
             doc = doc || document;
-            return Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
+            return Math.max(doc[DOCUMENT_ELEMENT].scrollTop, doc.body.scrollTop);
         },
 
         /**
@@ -938,11 +1197,11 @@
             newNode = Y.Dom.get(newNode); 
             referenceNode = Y.Dom.get(referenceNode); 
             
-            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+            if (!newNode || !referenceNode || !referenceNode[PARENT_NODE]) {
                 return null;
             }       
 
-            return referenceNode.parentNode.insertBefore(newNode, referenceNode); 
+            return referenceNode[PARENT_NODE].insertBefore(newNode, referenceNode); 
         },
 
         /**
@@ -956,14 +1215,14 @@
             newNode = Y.Dom.get(newNode); 
             referenceNode = Y.Dom.get(referenceNode); 
             
-            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+            if (!newNode || !referenceNode || !referenceNode[PARENT_NODE]) {
                 return null;
             }       
 
             if (referenceNode.nextSibling) {
-                return referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); 
+                return referenceNode[PARENT_NODE].insertBefore(newNode, referenceNode.nextSibling); 
             } else {
-                return referenceNode.parentNode.appendChild(newNode);
+                return referenceNode[PARENT_NODE].appendChild(newNode);
             }
         },
 
@@ -979,62 +1238,143 @@
                 b = Y.Dom.getViewportHeight() + t;
 
             return new Y.Region(t, r, b, l);
-        }
-    };
-    
-    var getXY = function() {
-        if (document.documentElement.getBoundingClientRect) { // IE
-            return function(el) {
-                var box = el.getBoundingClientRect();
+        },
 
-                var rootNode = el.ownerDocument;
-                return [box.left + Y.Dom.getDocumentScrollLeft(rootNode), box.top +
-                        Y.Dom.getDocumentScrollTop(rootNode)];
-            };
-        } else {
-            return function(el) { // manually calculate by crawling up offsetParents
-                var pos = [el.offsetLeft, el.offsetTop];
-                var parentNode = el.offsetParent;
+        /**
+         * Provides a normalized attribute interface. 
+         * @method setAttribute
+         * @param {String | HTMLElement} el The target element for the attribute.
+         * @param {String} attr The attribute to set.
+         * @param {String} val The value of the attribute.
+         */
+        setAttribute: function(el, attr, val) {
+            Y.Dom.batch(el, Y.Dom._setAttribute, { attr: attr, val: val });
+        },
 
-                // safari: subtract body offsets if el is abs (or any offsetParent), unless body is offsetParent
-                var accountForBody = (isSafari &&
-                        Y.Dom.getStyle(el, 'position') == 'absolute' &&
-                        el.offsetParent == el.ownerDocument.body);
+        _setAttribute: function(el, args) {
+            var attr = Y.Dom._toCamel(args.attr),
+                val = args.val;
 
-                if (parentNode != el) {
-                    while (parentNode) {
-                        pos[0] += parentNode.offsetLeft;
-                        pos[1] += parentNode.offsetTop;
-                        if (!accountForBody && isSafari && 
-                                Y.Dom.getStyle(parentNode,'position') == 'absolute' ) { 
-                            accountForBody = true;
-                        }
-                        parentNode = parentNode.offsetParent;
-                    }
+            if (el && el.setAttribute) {
+                if (Y.Dom.DOT_ATTRIBUTES[attr]) {
+                    el[attr] = val;
+                } else {
+                    attr = Y.Dom.CUSTOM_ATTRIBUTES[attr] || attr;
+                    el.setAttribute(attr, val);
                 }
+            } else {
+            }
+        },
 
-                if (accountForBody) { //safari doubles in this case
-                    pos[0] -= el.ownerDocument.body.offsetLeft;
-                    pos[1] -= el.ownerDocument.body.offsetTop;
-                } 
-                parentNode = el.parentNode;
+        /**
+         * Provides a normalized attribute interface. 
+         * @method getAttribute
+         * @param {String | HTMLElement} el The target element for the attribute.
+         * @param {String} attr The attribute to get.
+         * @return {String} The current value of the attribute. 
+         */
+        getAttribute: function(el, attr) {
+            return Y.Dom.batch(el, Y.Dom._getAttribute, attr);
+        },
 
-                // account for any scrolled ancestors
-                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
-                {
-                   // work around opera inline/table scrollLeft/Top bug
-                   if (Y.Dom.getStyle(parentNode, 'display').search(/^inline|table-row.*$/i)) { 
-                        pos[0] -= parentNode.scrollLeft;
-                        pos[1] -= parentNode.scrollTop;
+
+        _getAttribute: function(el, attr) {
+            var val;
+            attr = Y.Dom.CUSTOM_ATTRIBUTES[attr] || attr;
+
+            if (el && el.getAttribute) {
+                val = el.getAttribute(attr, 2);
+            } else {
+            }
+
+            return val;
+        },
+
+        _toCamel: function(property) {
+            var c = propertyCache;
+
+            function tU(x,l) {
+                return l.toUpperCase();
+            }
+
+            return c[property] || (c[property] = property.indexOf('-') === -1 ? 
+                                    property :
+                                    property.replace( /-([a-z])/gi, tU ));
+        },
+
+        _getClassRegex: function(className) {
+            var re;
+            if (className !== undefined) { // allow empty string to pass
+                if (className.exec) { // already a RegExp
+                    re = className;
+                } else {
+                    re = reCache[className];
+                    if (!re) {
+                        // escape special chars (".", "[", etc.)
+                        className = className.replace(Y.Dom._patterns.CLASS_RE_TOKENS, '\\$1');
+                        re = reCache[className] = new RegExp(C_START + className + C_END, G);
                     }
-                    
-                    parentNode = parentNode.parentNode; 
                 }
+            }
+            return re;
+        },
 
-                return pos;
-            };
+        _patterns: {
+            ROOT_TAG: /^body|html$/i, // body for quirks mode, html for standards,
+            CLASS_RE_TOKENS: /([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g
+        },
+
+
+        _testElement: function(node, method) {
+            return node && node[NODE_TYPE] == 1 && ( !method || method(node) );
+        },
+
+        _calcBorders: function(node, xy2) {
+            var t = parseInt(Y.Dom[GET_COMPUTED_STYLE](node, BORDER_TOP_WIDTH), 10) || 0,
+                l = parseInt(Y.Dom[GET_COMPUTED_STYLE](node, BORDER_LEFT_WIDTH), 10) || 0;
+            if (isGecko) {
+                if (RE_TABLE.test(node[TAG_NAME])) {
+                    t = 0;
+                    l = 0;
+                }
+            }
+            xy2[0] += l;
+            xy2[1] += t;
+            return xy2;
         }
-    }() // NOTE: Executing for loadtime branching
+    };
+        
+    var _getComputedStyle = Y.Dom[GET_COMPUTED_STYLE];
+    // fix opera computedStyle default color unit (convert to rgb)
+    if (UA.opera) {
+        Y.Dom[GET_COMPUTED_STYLE] = function(node, att) {
+            var val = _getComputedStyle(node, att);
+            if (RE_COLOR.test(att)) {
+                val = Y.Dom.Color.toRGB(val);
+            }
+
+            return val;
+        };
+
+    }
+
+    // safari converts transparent to rgba(), others use "transparent"
+    if (UA.webkit) {
+        Y.Dom[GET_COMPUTED_STYLE] = function(node, att) {
+            var val = _getComputedStyle(node, att);
+
+            if (val === 'rgba(0, 0, 0, 0)') {
+                val = 'transparent'; 
+            }
+
+            return val;
+        };
+
+    }
+
+    if (UA.ie && UA.ie >= 8 && document.documentElement.hasAttribute) { // IE 8 standards
+        Y.Dom.DOT_ATTRIBUTES.type = true; // IE 8 errors on input.setAttribute('type')
+    }
 })();
 /**
  * A region is a representation of an object on a grid.  It is defined
@@ -1058,6 +1398,13 @@
     this.top = t;
     
     /**
+     * The region's top extent
+     * @property y
+     * @type Int
+     */
+    this.y = t;
+    
+    /**
      * The region's top extent as index, for symmetry with set/getXY
      * @property 1
      * @type Int
@@ -1086,11 +1433,32 @@
     this.left = l;
     
     /**
+     * The region's left extent
+     * @property x
+     * @type Int
+     */
+    this.x = l;
+    
+    /**
      * The region's left extent as index, for symmetry with set/getXY
      * @property 0
      * @type Int
      */
     this[0] = l;
+
+    /**
+     * The region's total width 
+     * @property width 
+     * @type Int
+     */
+    this.width = this.right - this.left;
+
+    /**
+     * The region's total height 
+     * @property height 
+     * @type Int
+     */
+    this.height = this.bottom - this.top;
 };
 
 /**
@@ -1124,10 +1492,10 @@
  * @return {Region}        The overlap region, or null if there is no overlap
  */
 YAHOO.util.Region.prototype.intersect = function(region) {
-    var t = Math.max( this.top,    region.top    );
-    var r = Math.min( this.right,  region.right  );
-    var b = Math.min( this.bottom, region.bottom );
-    var l = Math.max( this.left,   region.left   );
+    var t = Math.max( this.top,    region.top    ),
+        r = Math.min( this.right,  region.right  ),
+        b = Math.min( this.bottom, region.bottom ),
+        l = Math.max( this.left,   region.left   );
     
     if (b >= t && r >= l) {
         return new YAHOO.util.Region(t, r, b, l);
@@ -1144,10 +1512,10 @@
  * @return {Region}        The union region
  */
 YAHOO.util.Region.prototype.union = function(region) {
-    var t = Math.min( this.top,    region.top    );
-    var r = Math.max( this.right,  region.right  );
-    var b = Math.max( this.bottom, region.bottom );
-    var l = Math.min( this.left,   region.left   );
+    var t = Math.min( this.top,    region.top    ),
+        r = Math.max( this.right,  region.right  ),
+        b = Math.max( this.bottom, region.bottom ),
+        l = Math.min( this.left,   region.left   );
 
     return new YAHOO.util.Region(t, r, b, l);
 };
@@ -1163,6 +1531,8 @@
              ", right: "   + this.right  + 
              ", bottom: "  + this.bottom + 
              ", left: "    + this.left   + 
+             ", height: "  + this.height + 
+             ", width: "    + this.width   + 
              "}" );
 };
 
@@ -1174,13 +1544,12 @@
  * @static
  */
 YAHOO.util.Region.getRegion = function(el) {
-    var p = YAHOO.util.Dom.getXY(el);
+    var p = YAHOO.util.Dom.getXY(el),
+        t = p[1],
+        r = p[0] + el.offsetWidth,
+        b = p[1] + el.offsetHeight,
+        l = p[0];
 
-    var t = p[1];
-    var r = p[0] + el.offsetWidth;
-    var b = p[1] + el.offsetHeight;
-    var l = p[0];
-
     return new YAHOO.util.Region(t, r, b, l);
 };
 
@@ -1202,23 +1571,262 @@
       y = x[1]; // dont blow away x yet
       x = x[0];
    }
-   
-    /**
-     * The X position of the point, which is also the right, left and index zero (for Dom.getXY symmetry)
-     * @property x
-     * @type Int
-     */
-
-    this.x = this.right = this.left = this[0] = x;
-     
-    /**
-     * The Y position of the point, which is also the top, bottom and index one (for Dom.getXY symmetry)
-     * @property y
-     * @type Int
-     */
-    this.y = this.top = this.bottom = this[1] = y;
+ 
+    YAHOO.util.Point.superclass.constructor.call(this, y, x, y, x);
 };
 
-YAHOO.util.Point.prototype = new YAHOO.util.Region();
+YAHOO.extend(YAHOO.util.Point, YAHOO.util.Region);
 
-YAHOO.register("dom", YAHOO.util.Dom, {version: "2.4.1", build: "742"});
+(function() {
+/**
+ * Add style management functionality to DOM.
+ * @module dom
+ * @for Dom
+ */
+
+var Y = YAHOO.util, 
+    CLIENT_TOP = 'clientTop',
+    CLIENT_LEFT = 'clientLeft',
+    PARENT_NODE = 'parentNode',
+    RIGHT = 'right',
+    HAS_LAYOUT = 'hasLayout',
+    PX = 'px',
+    OPACITY = 'opacity',
+    AUTO = 'auto',
+    BORDER_LEFT_WIDTH = 'borderLeftWidth',
+    BORDER_TOP_WIDTH = 'borderTopWidth',
+    BORDER_RIGHT_WIDTH = 'borderRightWidth',
+    BORDER_BOTTOM_WIDTH = 'borderBottomWidth',
+    VISIBLE = 'visible',
+    TRANSPARENT = 'transparent',
+    HEIGHT = 'height',
+    WIDTH = 'width',
+    STYLE = 'style',
+    CURRENT_STYLE = 'currentStyle',
+
+// IE getComputedStyle
+// TODO: unit-less lineHeight (e.g. 1.22)
+    re_size = /^width|height$/,
+    re_unit = /^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,
+
+    ComputedStyle = {
+        get: function(el, property) {
+            var value = '',
+                current = el[CURRENT_STYLE][property];
+
+            if (property === OPACITY) {
+                value = Y.Dom.getStyle(el, OPACITY);        
+            } else if (!current || (current.indexOf && current.indexOf(PX) > -1)) { // no need to convert
+                value = current;
+            } else if (Y.Dom.IE_COMPUTED[property]) { // use compute function
+                value = Y.Dom.IE_COMPUTED[property](el, property);
+            } else if (re_unit.test(current)) { // convert to pixel
+                value = Y.Dom.IE.ComputedStyle.getPixel(el, property);
+            } else {
+                value = current;
+            }
+
+            return value;
+        },
+
+        getOffset: function(el, prop) {
+            var current = el[CURRENT_STYLE][prop],                        // value of "width", "top", etc.
+                capped = prop.charAt(0).toUpperCase() + prop.substr(1), // "Width", "Top", etc.
+                offset = 'offset' + capped,                             // "offsetWidth", "offsetTop", etc.
+                pixel = 'pixel' + capped,                               // "pixelWidth", "pixelTop", etc.
+                value = '',
+                actual;
+
+            if (current == AUTO) {
+                actual = el[offset]; // offsetHeight/Top etc.
+                if (actual === undefined) { // likely "right" or "bottom"
+                    value = 0;
+                }
+
+                value = actual;
+                if (re_size.test(prop)) { // account for box model diff 
+                    el[STYLE][prop] = actual; 
+                    if (el[offset] > actual) {
+                        // the difference is padding + border (works in Standards & Quirks modes)
+                        value = actual - (el[offset] - actual);
+                    }
+                    el[STYLE][prop] = AUTO; // revert to auto
+                }
+            } else { // convert units to px
+                if (!el[STYLE][pixel] && !el[STYLE][prop]) { // need to map style.width to currentStyle (no currentStyle.pixelWidth)
+                    el[STYLE][prop] = current;              // no style.pixelWidth if no style.width
+                }
+                value = el[STYLE][pixel];
+            }
+            return value + PX;
+        },
+
+        getBorderWidth: function(el, property) {
+            // clientHeight/Width = paddingBox (e.g. offsetWidth - borderWidth)
+            // clientTop/Left = borderWidth
+            var value = null;
+            if (!el[CURRENT_STYLE][HAS_LAYOUT]) { // TODO: unset layout?
+                el[STYLE].zoom = 1; // need layout to measure client
+            }
+
+            switch(property) {
+                case BORDER_TOP_WIDTH:
+                    value = el[CLIENT_TOP];
+                    break;
+                case BORDER_BOTTOM_WIDTH:
+                    value = el.offsetHeight - el.clientHeight - el[CLIENT_TOP];
+                    break;
+                case BORDER_LEFT_WIDTH:
+                    value = el[CLIENT_LEFT];
+                    break;
+                case BORDER_RIGHT_WIDTH:
+                    value = el.offsetWidth - el.clientWidth - el[CLIENT_LEFT];
+                    break;
+            }
+            return value + PX;
+        },
+
+        getPixel: function(node, att) {
+            // use pixelRight to convert to px
+            var val = null,
+                styleRight = node[CURRENT_STYLE][RIGHT],
+                current = node[CURRENT_STYLE][att];
+
+            node[STYLE][RIGHT] = current;
+            val = node[STYLE].pixelRight;
+            node[STYLE][RIGHT] = styleRight; // revert
+
+            return val + PX;
+        },
+
+        getMargin: function(node, att) {
+            var val;
+            if (node[CURRENT_STYLE][att] == AUTO) {
+                val = 0 + PX;
+            } else {
+                val = Y.Dom.IE.ComputedStyle.getPixel(node, att);
+            }
+            return val;
+        },
+
+        getVisibility: function(node, att) {
+            var current;
+            while ( (current = node[CURRENT_STYLE]) && current[att] == 'inherit') { // NOTE: assignment in test
+                node = node[PARENT_NODE];
+            }
+            return (current) ? current[att] : VISIBLE;
+        },
+
+        getColor: function(node, att) {
+            return Y.Dom.Color.toRGB(node[CURRENT_STYLE][att]) || TRANSPARENT;
+        },
+
+        getBorderColor: function(node, att) {
+            var current = node[CURRENT_STYLE],
+                val = current[att] || current.color;
+            return Y.Dom.Color.toRGB(Y.Dom.Color.toHex(val));
+        }
+
+    },
+
+//fontSize: getPixelFont,
+    IEComputed = {};
+
+IEComputed.top = IEComputed.right = IEComputed.bottom = IEComputed.left = 
+        IEComputed[WIDTH] = IEComputed[HEIGHT] = ComputedStyle.getOffset;
+
+IEComputed.color = ComputedStyle.getColor;
+
+IEComputed[BORDER_TOP_WIDTH] = IEComputed[BORDER_RIGHT_WIDTH] =
+        IEComputed[BORDER_BOTTOM_WIDTH] = IEComputed[BORDER_LEFT_WIDTH] =
+        ComputedStyle.getBorderWidth;
+
+IEComputed.marginTop = IEComputed.marginRight = IEComputed.marginBottom =
+        IEComputed.marginLeft = ComputedStyle.getMargin;
+
+IEComputed.visibility = ComputedStyle.getVisibility;
+IEComputed.borderColor = IEComputed.borderTopColor =
+        IEComputed.borderRightColor = IEComputed.borderBottomColor =
+        IEComputed.borderLeftColor = ComputedStyle.getBorderColor;
+
+Y.Dom.IE_COMPUTED = IEComputed;
+Y.Dom.IE_ComputedStyle = ComputedStyle;
+})();
+(function() {
+/**
+ * Add style management functionality to DOM.
+ * @module dom
+ * @for Dom
+ */
+
+var TO_STRING = 'toString',
+    PARSE_INT = parseInt,
+    RE = RegExp,
+    Y = YAHOO.util;
+
+Y.Dom.Color = {
+    KEYWORDS: {
+        black: '000',
+        silver: 'c0c0c0',
+        gray: '808080',
+        white: 'fff',
+        maroon: '800000',
+        red: 'f00',
+        purple: '800080',
+        fuchsia: 'f0f',
+        green: '008000',
+        lime: '0f0',
+        olive: '808000',
+        yellow: 'ff0',
+        navy: '000080',
+        blue: '00f',
+        teal: '008080',
+        aqua: '0ff'
+    },
+
+    re_RGB: /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
+    re_hex: /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
+    re_hex3: /([0-9A-F])/gi,
+
+    toRGB: function(val) {
+        if (!Y.Dom.Color.re_RGB.test(val)) {
+            val = Y.Dom.Color.toHex(val);
+        }
+
+        if(Y.Dom.Color.re_hex.exec(val)) {
+            val = 'rgb(' + [
+                PARSE_INT(RE.$1, 16),
+                PARSE_INT(RE.$2, 16),
+                PARSE_INT(RE.$3, 16)
+            ].join(', ') + ')';
+        }
+        return val;
+    },
+
+    toHex: function(val) {
+        val = Y.Dom.Color.KEYWORDS[val] || val;
+        if (Y.Dom.Color.re_RGB.exec(val)) {
+            var r = (RE.$1.length === 1) ? '0' + RE.$1 : Number(RE.$1),
+                g = (RE.$2.length === 1) ? '0' + RE.$2 : Number(RE.$2),
+                b = (RE.$3.length === 1) ? '0' + RE.$3 : Number(RE.$3);
+
+            val = [
+                r[TO_STRING](16),
+                g[TO_STRING](16),
+                b[TO_STRING](16)
+            ].join('');
+        }
+
+        if (val.length < 6) {
+            val = val.replace(Y.Dom.Color.re_hex3, '$1$1');
+        }
+
+        if (val !== 'transparent' && val.indexOf('#') < 0) {
+            val = '#' + val;
+        }
+
+        return val.toLowerCase();
+    }
+};
+}());
+YAHOO.register("dom", YAHOO.util.Dom, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/dom/dom-min.js
===================================================================
--- branches/2.8.x/wb/include/yui/dom/dom-min.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/dom/dom-min.js	(revision 1263)
@@ -1,8 +1,9 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
-(function(){var B=YAHOO.util,L,J,H=0,K={},F={},N=window.document;var C=YAHOO.env.ua.opera,M=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var O=function(Q){if(!E.HYPHEN.test(Q)){return Q;}if(K[Q]){return K[Q];}var R=Q;while(E.HYPHEN.exec(R)){R=R.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}K[Q]=R;return R;};var P=function(R){var Q=F[R];if(!Q){Q=new RegExp("(?:^|\\s+)"+R+"(?:\\s+|$)");F[R]=Q;}return Q;};if(N.defaultView&&N.defaultView.getComputedStyle){L=function(Q,T){var S=null;if(T=="float"){T="cssFloat";}var R=N.defaultView.getComputedStyle(Q,"");if(R){S=R[O(T)];}return Q.style[T]||S;};}else{if(N.documentElement.currentStyle&&G){L=function(Q,S){switch(O(S)){case"opacity":var U=100;try{U=Q.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(T){try{U=Q.filters("alpha").opacity;}catch(T){}}return U/100;case"float":S="styleFloat";default:var R=Q.currentStyle?Q.currentStyle[S]:null;return(Q.style[S]||R);}};}else{L=function(Q,R){return Q.style[R];};}}if(G){J=function(Q,R,S){switch(R){case"opacity":if(YAHOO.lang.isString(Q.style.filter)){Q.style.filter="alpha(opacity="+S*100+")";if(!Q.currentStyle||!Q.currentStyle.hasLayout){Q.style.zoom=1;}}break;case"float":R="styleFloat";default:Q.style[R]=S;}};}else{J=function(Q,R,S){if(R=="float"){R="cssFloat";}Q.style[R]=S;};}var D=function(Q,R){return Q&&Q.nodeType==1&&(!R||R(Q));};YAHOO.util.Dom={get:function(S){if(S&&(S.tagName||S.item)){return S;}if(YAHOO.lang.isString(S)||!S){return N.getElementById(S);}if(S.length!==undefined){var T=[];for(var R=0,Q=S.length;R<Q;++R){T[T.length]=B.Dom.get(S[R]);}return T;}return S;},getStyle:function(Q,S){S=O(S);var R=function(T){return L(T,S);};return B.Dom.batch(Q,R,B.Dom,true);},setStyle:function(Q,S,T){S=O(S);var R=function(U){J(U,S,T);};B.Dom.batch(Q,R,B.Dom,true);},getXY:function(Q){var R=function(S){if((S.parentNode===null||S.offsetParent===null||this.getStyle(S,"display")=="none")&&S!=S.ownerDocument.body){return false;}return I(S);};return B.Dom.batch(Q,R,B.Dom,true);},getX:function(Q){var R=function(S){return B.Dom.getXY(S)[0];};return B.Dom.batch(Q,R,B.Dom,true);},getY:function(Q){var R=function(S){return B.Dom.getXY(S)[1];};return B.Dom.batch(Q,R,B.Dom,true);},setXY:function(Q,T,S){var R=function(W){var V=this.getStyle(W,"position");if(V=="static"){this.setStyle(W,"position","relative");V="relative";}var Y=this.getXY(W);if(Y===false){return false;}var X=[parseInt(this.getStyle(W,"left"),10),parseInt(this.getStyle(W,"top"),10)];if(isNaN(X[0])){X[0]=(V=="relative")?0:W.offsetLeft;}if(isNaN(X[1])){X[1]=(V=="relative")?0:W.offsetTop;}if(T[0]!==null){W.style.left=T[0]-Y[0]+X[0]+"px";}if(T[1]!==null){W.style.top=T[1]-Y[1]+X[1]+"px";}if(!S){var U=this.getXY(W);if((T[0]!==null&&U[0]!=T[0])||(T[1]!==null&&U[1]!=T[1])){this.setXY(W,T,true);}}};B.Dom.batch(Q,R,B.Dom,true);},setX:function(R,Q){B.Dom.setXY(R,[Q,null]);},setY:function(Q,R){B.Dom.setXY(Q,[null,R]);},getRegion:function(Q){var R=function(S){if((S.parentNode===null||S.offsetParent===null||this.getStyle(S,"display")=="none")&&S!=N.body){return false;}var T=B.Region.getRegion(S);return T;};return B.Dom.batch(Q,R,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(U,Y,V,W){Y=Y||"*";V=(V)?B.Dom.get(V):null||N;if(!V){return[];}var R=[],Q=V.getElementsByTagName(Y),X=P(U);for(var S=0,T=Q.length;S<T;++S){if(X.test(Q[S].className)){R[R.length]=Q[S];if(W){W.call(Q[S],Q[S]);}}}return R;},hasClass:function(S,R){var Q=P(R);var T=function(U){return Q.test(U.className);};return B.Dom.batch(S,T,B.Dom,true);},addClass:function(R,Q){var S=function(T){if(this.hasClass(T,Q)){return false;}T.className=YAHOO.lang.trim([T.className,Q].join(" "));return true;};return B.Dom.batch(R,S,B.Dom,true);},removeClass:function(S,R){var Q=P(R);var T=function(U){if(!this.hasClass(U,R)){return false;}var V=U.className;U.className=V.replace(Q," ");if(this.hasClass(U,R)){this.removeClass(U,R);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},replaceClass:function(T,R,Q){if(!Q||R===Q){return false;}var S=P(R);var U=function(V){if(!this.hasClass(V,R)){this.addClass(V,Q);return true;}V.className=V.className.replace(S," "+Q+" ");if(this.hasClass(V,R)){this.replaceClass(V,R,Q);}V.className=YAHOO.lang.trim(V.className);return true;};return B.Dom.batch(T,U,B.Dom,true);},generateId:function(Q,S){S=S||"yui-gen";var R=function(T){if(T&&T.id){return T.id;}var U=S+H++;if(T){T.id=U;}return U;};return B.Dom.batch(Q,R,B.Dom,true)||R.apply(B.Dom,arguments);},isAncestor:function(Q,R){Q=B.Dom.get(Q);R=B.Dom.get(R);if(!Q||!R){return false;}if(Q.contains&&R.nodeType&&!M){return Q.contains(R);}else{if(Q.compareDocumentPosition&&R.nodeType){return !!(Q.compareDocumentPosition(R)&16);}else{if(R.nodeType){return !!this.getAncestorBy(R,function(S){return S==Q;});}}}return false;},inDocument:function(Q){return this.isAncestor(N.documentElement,Q);},getElementsBy:function(X,R,S,U){R=R||"*";S=(S)?B.Dom.get(S):null||N;if(!S){return[];}var T=[],W=S.getElementsByTagName(R);for(var V=0,Q=W.length;V<Q;++V){if(X(W[V])){T[T.length]=W[V];if(U){U(W[V]);}}}return T;},batch:function(U,X,W,S){U=(U&&(U.tagName||U.item))?U:B.Dom.get(U);if(!U||!X){return false;}var T=(S)?W:window;if(U.tagName||U.length===undefined){return X.call(T,U,W);}var V=[];for(var R=0,Q=U.length;R<Q;++R){V[V.length]=X.call(T,U[R],W);}return V;},getDocumentHeight:function(){var R=(N.compatMode!="CSS1Compat")?N.body.scrollHeight:N.documentElement.scrollHeight;var Q=Math.max(R,B.Dom.getViewportHeight());return Q;},getDocumentWidth:function(){var R=(N.compatMode!="CSS1Compat")?N.body.scrollWidth:N.documentElement.scrollWidth;var Q=Math.max(R,B.Dom.getViewportWidth());return Q;},getViewportHeight:function(){var Q=self.innerHeight;var R=N.compatMode;if((R||G)&&!C){Q=(R=="CSS1Compat")?N.documentElement.clientHeight:N.body.clientHeight;
-}return Q;},getViewportWidth:function(){var Q=self.innerWidth;var R=N.compatMode;if(R||G){Q=(R=="CSS1Compat")?N.documentElement.clientWidth:N.body.clientWidth;}return Q;},getAncestorBy:function(Q,R){while(Q=Q.parentNode){if(D(Q,R)){return Q;}}return null;},getAncestorByClassName:function(R,Q){R=B.Dom.get(R);if(!R){return null;}var S=function(T){return B.Dom.hasClass(T,Q);};return B.Dom.getAncestorBy(R,S);},getAncestorByTagName:function(R,Q){R=B.Dom.get(R);if(!R){return null;}var S=function(T){return T.tagName&&T.tagName.toUpperCase()==Q.toUpperCase();};return B.Dom.getAncestorBy(R,S);},getPreviousSiblingBy:function(Q,R){while(Q){Q=Q.previousSibling;if(D(Q,R)){return Q;}}return null;},getPreviousSibling:function(Q){Q=B.Dom.get(Q);if(!Q){return null;}return B.Dom.getPreviousSiblingBy(Q);},getNextSiblingBy:function(Q,R){while(Q){Q=Q.nextSibling;if(D(Q,R)){return Q;}}return null;},getNextSibling:function(Q){Q=B.Dom.get(Q);if(!Q){return null;}return B.Dom.getNextSiblingBy(Q);},getFirstChildBy:function(Q,S){var R=(D(Q.firstChild,S))?Q.firstChild:null;return R||B.Dom.getNextSiblingBy(Q.firstChild,S);},getFirstChild:function(Q,R){Q=B.Dom.get(Q);if(!Q){return null;}return B.Dom.getFirstChildBy(Q);},getLastChildBy:function(Q,S){if(!Q){return null;}var R=(D(Q.lastChild,S))?Q.lastChild:null;return R||B.Dom.getPreviousSiblingBy(Q.lastChild,S);},getLastChild:function(Q){Q=B.Dom.get(Q);return B.Dom.getLastChildBy(Q);},getChildrenBy:function(R,T){var S=B.Dom.getFirstChildBy(R,T);var Q=S?[S]:[];B.Dom.getNextSiblingBy(S,function(U){if(!T||T(U)){Q[Q.length]=U;}return false;});return Q;},getChildren:function(Q){Q=B.Dom.get(Q);if(!Q){}return B.Dom.getChildrenBy(Q);},getDocumentScrollLeft:function(Q){Q=Q||N;return Math.max(Q.documentElement.scrollLeft,Q.body.scrollLeft);},getDocumentScrollTop:function(Q){Q=Q||N;return Math.max(Q.documentElement.scrollTop,Q.body.scrollTop);},insertBefore:function(R,Q){R=B.Dom.get(R);Q=B.Dom.get(Q);if(!R||!Q||!Q.parentNode){return null;}return Q.parentNode.insertBefore(R,Q);},insertAfter:function(R,Q){R=B.Dom.get(R);Q=B.Dom.get(Q);if(!R||!Q||!Q.parentNode){return null;}if(Q.nextSibling){return Q.parentNode.insertBefore(R,Q.nextSibling);}else{return Q.parentNode.appendChild(R);}},getClientRegion:function(){var S=B.Dom.getDocumentScrollTop(),R=B.Dom.getDocumentScrollLeft(),T=B.Dom.getViewportWidth()+R,Q=B.Dom.getViewportHeight()+S;return new B.Region(S,T,Q,R);}};var I=function(){if(N.documentElement.getBoundingClientRect){return function(R){var S=R.getBoundingClientRect();var Q=R.ownerDocument;return[S.left+B.Dom.getDocumentScrollLeft(Q),S.top+B.Dom.getDocumentScrollTop(Q)];};}else{return function(S){var T=[S.offsetLeft,S.offsetTop];var R=S.offsetParent;var Q=(M&&B.Dom.getStyle(S,"position")=="absolute"&&S.offsetParent==S.ownerDocument.body);if(R!=S){while(R){T[0]+=R.offsetLeft;T[1]+=R.offsetTop;if(!Q&&M&&B.Dom.getStyle(R,"position")=="absolute"){Q=true;}R=R.offsetParent;}}if(Q){T[0]-=S.ownerDocument.body.offsetLeft;T[1]-=S.ownerDocument.body.offsetTop;}R=S.parentNode;while(R.tagName&&!E.ROOT_TAG.test(R.tagName)){if(B.Dom.getStyle(R,"display").search(/^inline|table-row.*$/i)){T[0]-=R.scrollLeft;T[1]-=R.scrollTop;}R=R.parentNode;}return T;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.4.1",build:"742"});
\ No newline at end of file
+(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},DOT_ATTRIBUTES:{},get:function(z){var AB,x,AA,y,Y,G;if(z){if(z[l]||z.item){return z;}if(typeof z==="string"){AB=z;z=K.getElementById(z);G=(z)?z.attributes:null;if(z&&G&&G.id&&G.id.value===AB){return z;}else{if(z&&K.all){z=null;x=K.all[AB];for(y=0,Y=x.length;y<Y;++y){if(x[y].id===AB){return x[y];}}}}return z;}if(YAHOO.util.Element&&z instanceof YAHOO.util.Element){z=z.get("element");}if("length" in z){AA=[];for(y=0,Y=z.length;y<Y;++y){AA[AA.length]=E.Dom.get(z[y]);}return AA;}return z;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC===c)){G=S(AF[v],q);x=S(AF[v],R);if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom._getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom._getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom._getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;
+y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom._getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e]&&y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){E.Dom.batch(Y,E.Dom._setAttribute,{attr:G,val:x});},_setAttribute:function(x,Y){var G=E.Dom._toCamel(Y.attr),y=Y.val;if(x&&x.setAttribute){if(E.Dom.DOT_ATTRIBUTES[G]){x[G]=y;}else{G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;x.setAttribute(G,y);}}else{}},getAttribute:function(Y,G){return E.Dom.batch(Y,E.Dom._getAttribute,G);},_getAttribute:function(Y,G){var x;G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;if(Y&&Y.getAttribute){x=Y.getAttribute(G,2);}else{}return x;},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}if(m.ie&&m.ie>=8&&K.documentElement.hasAttribute){E.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;
+this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.8.0r4",build:"2449"});
\ No newline at end of file
Index: branches/2.8.x/wb/include/yui/dom/index.php
===================================================================
--- branches/2.8.x/wb/include/yui/dom/index.php	(revision 1262)
+++ branches/2.8.x/wb/include/yui/dom/index.php	(revision 1263)
@@ -1,28 +1,55 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-header("Location: ../../../index.php");
-
+<?php
+/*
+*
+*                       About WebsiteBaker
+*
+* Website Baker is a PHP-based Content Management System (CMS)
+* designed with one goal in mind: to enable its users to produce websites
+* with ease.
+*
+*                       LICENSE INFORMATION
+*
+* WebsiteBaker is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* WebsiteBaker is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*
+*                   WebsiteBaker Extra Information
+*
+*
+*/
+/**
+ *
+ * @category        backend
+ * @package         yui
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @filesource		$HeadURL$
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ *
+ * @author          WebsiteBaker Project
+ * @link			http://www.websitebaker2.org/
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @link			http://start.websitebaker2.org/impressum-datenschutz.php
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @version         $Id$
+ * @platform        WebsiteBaker 2.8.x
+ * @requirements    PHP 4.3.4 and higher
+ * @lastmodified    $Date$
+ *
+ */
+
+header("Location: ../../../index.php");
+
 ?>
\ No newline at end of file

Property changes on: branches/2.8.x/wb/include/yui/dom/index.php
___________________________________________________________________
Modified: svn:keywords
## -1 +1,4 ##
-Id
\ No newline at end of property
+Id
+Revision
+HeadURL
+Date
\ No newline at end of property
Index: branches/2.8.x/wb/include/yui/dom/dom-debug.js
===================================================================
--- branches/2.8.x/wb/include/yui/dom/dom-debug.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/dom/dom-debug.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 /**
  * The dom module provides helper methods for manipulating Dom elements.
@@ -11,138 +11,80 @@
  */
 
 (function() {
-    var Y = YAHOO.util,     // internal shorthand
-        getStyle,           // for load time browser branching
-        setStyle,           // ditto
-        id_counter = 0,     // for use with generateId
+    // for use with generateId (global to save state if Dom is overwritten)
+    YAHOO.env._id_counter = YAHOO.env._id_counter || 0;
+
+    // internal shorthand
+    var Y = YAHOO.util,
+        lang = YAHOO.lang,
+        UA = YAHOO.env.ua,
+        trim = YAHOO.lang.trim,
         propertyCache = {}, // for faster hyphen converts
-        reClassNameCache = {},          // cache regexes for className
-        document = window.document;     // cache for faster lookups
+        reCache = {}, // cache className regexes
+        RE_TABLE = /^t(?:able|d|h)$/i, // for _calcBorders
+        RE_COLOR = /color$/i,
+
+        // DOM aliases 
+        document = window.document,     
+        documentElement = document.documentElement,
+
+        // string constants
+        OWNER_DOCUMENT = 'ownerDocument',
+        DEFAULT_VIEW = 'defaultView',
+        DOCUMENT_ELEMENT = 'documentElement',
+        COMPAT_MODE = 'compatMode',
+        OFFSET_LEFT = 'offsetLeft',
+        OFFSET_TOP = 'offsetTop',
+        OFFSET_PARENT = 'offsetParent',
+        PARENT_NODE = 'parentNode',
+        NODE_TYPE = 'nodeType',
+        TAG_NAME = 'tagName',
+        SCROLL_LEFT = 'scrollLeft',
+        SCROLL_TOP = 'scrollTop',
+        GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect',
+        GET_COMPUTED_STYLE = 'getComputedStyle',
+        CURRENT_STYLE = 'currentStyle',
+        CSS1_COMPAT = 'CSS1Compat',
+        _BACK_COMPAT = 'BackCompat',
+        _CLASS = 'class', // underscore due to reserved word
+        CLASS_NAME = 'className',
+        EMPTY = '',
+        SPACE = ' ',
+        C_START = '(?:^|\\s)',
+        C_END = '(?= |$)',
+        G = 'g',
+        POSITION = 'position',
+        FIXED = 'fixed',
+        RELATIVE = 'relative',
+        LEFT = 'left',
+        TOP = 'top',
+        MEDIUM = 'medium',
+        BORDER_LEFT_WIDTH = 'borderLeftWidth',
+        BORDER_TOP_WIDTH = 'borderTopWidth',
     
     // brower detection
-    var isOpera = YAHOO.env.ua.opera,
-        isSafari = YAHOO.env.ua.webkit, 
-        isGecko = YAHOO.env.ua.gecko,
-        isIE = YAHOO.env.ua.ie; 
+        isOpera = UA.opera,
+        isSafari = UA.webkit, 
+        isGecko = UA.gecko, 
+        isIE = UA.ie; 
     
-    // regex cache
-    var patterns = {
-        HYPHEN: /(-[a-z])/i, // to normalize get/setStyle
-        ROOT_TAG: /^body|html$/i // body for quirks mode, html for standards
-    };
-
-    var toCamel = function(property) {
-        if ( !patterns.HYPHEN.test(property) ) {
-            return property; // no hyphens
-        }
-        
-        if (propertyCache[property]) { // already converted
-            return propertyCache[property];
-        }
-       
-        var converted = property;
- 
-        while( patterns.HYPHEN.exec(converted) ) {
-            converted = converted.replace(RegExp.$1,
-                    RegExp.$1.substr(1).toUpperCase());
-        }
-        
-        propertyCache[property] = converted;
-        return converted;
-        //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug
-    };
-    
-    var getClassRegEx = function(className) {
-        var re = reClassNameCache[className];
-        if (!re) {
-            re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
-            reClassNameCache[className] = re;
-        }
-        return re;
-    };
-
-    // branching at load instead of runtime
-    if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method
-        getStyle = function(el, property) {
-            var value = null;
-            
-            if (property == 'float') { // fix reserved word
-                property = 'cssFloat';
-            }
-
-            var computed = document.defaultView.getComputedStyle(el, '');
-            if (computed) { // test computed before touching for safari
-                value = computed[toCamel(property)];
-            }
-            
-            return el.style[property] || value;
-        };
-    } else if (document.documentElement.currentStyle && isIE) { // IE method
-        getStyle = function(el, property) {                         
-            switch( toCamel(property) ) {
-                case 'opacity' :// IE opacity uses filter
-                    var val = 100;
-                    try { // will error if no DXImageTransform
-                        val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;
-
-                    } catch(e) {
-                        try { // make sure its in the document
-                            val = el.filters('alpha').opacity;
-                        } catch(e) {
-                            YAHOO.log('getStyle: IE filter failed',
-                                    'error', 'Dom');
-                        }
-                    }
-                    return val / 100;
-                case 'float': // fix reserved word
-                    property = 'styleFloat'; // fall through
-                default: 
-                    // test currentStyle before touching
-                    var value = el.currentStyle ? el.currentStyle[property] : null;
-                    return ( el.style[property] || value );
-            }
-        };
-    } else { // default to inline only
-        getStyle = function(el, property) { return el.style[property]; };
-    }
-    
-    if (isIE) {
-        setStyle = function(el, property, val) {
-            switch (property) {
-                case 'opacity':
-                    if ( YAHOO.lang.isString(el.style.filter) ) { // in case not appended
-                        el.style.filter = 'alpha(opacity=' + val * 100 + ')';
-                        
-                        if (!el.currentStyle || !el.currentStyle.hasLayout) {
-                            el.style.zoom = 1; // when no layout or cant tell
-                        }
-                    }
-                    break;
-                case 'float':
-                    property = 'styleFloat';
-                default:
-                el.style[property] = val;
-            }
-        };
-    } else {
-        setStyle = function(el, property, val) {
-            if (property == 'float') {
-                property = 'cssFloat';
-            }
-            el.style[property] = val;
-        };
-    }
-
-    var testElement = function(node, method) {
-        return node && node.nodeType == 1 && ( !method || method(node) );
-    };
-
     /**
      * Provides helper methods for DOM elements.
      * @namespace YAHOO.util
      * @class Dom
+     * @requires yahoo, event
      */
-    YAHOO.util.Dom = {
+    Y.Dom = {
+        CUSTOM_ATTRIBUTES: (!documentElement.hasAttribute) ? { // IE < 8
+            'for': 'htmlFor',
+            'class': CLASS_NAME
+        } : { // w3c
+            'htmlFor': 'for',
+            'className': _CLASS
+        },
+
+        DOT_ATTRIBUTES: {},
+
         /**
          * Returns an HTMLElement reference.
          * @method get
@@ -150,26 +92,58 @@
          * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.
          */
         get: function(el) {
-            if (el && (el.tagName || el.item)) { // HTMLElement, or HTMLCollection
-                return el;
-            }
+            var id, nodes, c, i, len, attr;
 
-            if (YAHOO.lang.isString(el) || !el) { // HTMLElement or null
-                return document.getElementById(el);
-            }
-            
-            if (el.length !== undefined) { // array-like 
-                var c = [];
-                for (var i = 0, len = el.length; i < len; ++i) {
-                    c[c.length] = Y.Dom.get(el[i]);
+            if (el) {
+                if (el[NODE_TYPE] || el.item) { // Node, or NodeList
+                    return el;
                 }
+
+                if (typeof el === 'string') { // id
+                    id = el;
+                    el = document.getElementById(el);
+                    attr = (el) ? el.attributes : null;
+                    if (el && attr && attr.id && attr.id.value === id) { // IE: avoid false match on "name" attribute
+                        return el;
+                    } else if (el && document.all) { // filter by name
+                        el = null;
+                        nodes = document.all[id];
+                        for (i = 0, len = nodes.length; i < len; ++i) {
+                            if (nodes[i].id === id) {
+                                return nodes[i];
+                            }
+                        }
+                    }
+                    return el;
+                }
                 
-                return c;
+                if (YAHOO.util.Element && el instanceof YAHOO.util.Element) {
+                    el = el.get('element');
+                }
+
+                if ('length' in el) { // array-like 
+                    c = [];
+                    for (i = 0, len = el.length; i < len; ++i) {
+                        c[c.length] = Y.Dom.get(el[i]);
+                    }
+                    
+                    return c;
+                }
+
+                return el; // some other object, just pass it back
             }
 
-            return el; // some other object, just pass it back
+            return null;
         },
     
+        getComputedStyle: function(el, property) {
+            if (window[GET_COMPUTED_STYLE]) {
+                return el[OWNER_DOCUMENT][DEFAULT_VIEW][GET_COMPUTED_STYLE](el, null)[property];
+            } else if (el[CURRENT_STYLE]) {
+                return Y.Dom.IE_ComputedStyle.get(el, property);
+            }
+        },
+
         /**
          * Normalizes currentStyle and ComputedStyle.
          * @method getStyle
@@ -178,14 +152,57 @@
          * @return {String | Array} The current value of the style property for the element(s).
          */
         getStyle: function(el, property) {
-            property = toCamel(property);
-            
-            var f = function(element) {
-                return getStyle(element, property);
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, Y.Dom._getStyle, property);
         },
+
+        // branching at load instead of runtime
+        _getStyle: function() {
+            if (window[GET_COMPUTED_STYLE]) { // W3C DOM method
+                return function(el, property) {
+                    property = (property === 'float') ? property = 'cssFloat' :
+                            Y.Dom._toCamel(property);
+
+                    var value = el.style[property],
+                        computed;
+                    
+                    if (!value) {
+                        computed = el[OWNER_DOCUMENT][DEFAULT_VIEW][GET_COMPUTED_STYLE](el, null);
+                        if (computed) { // test computed before touching for safari
+                            value = computed[property];
+                        }
+                    }
+                    
+                    return value;
+                };
+            } else if (documentElement[CURRENT_STYLE]) {
+                return function(el, property) {                         
+                    var value;
+
+                    switch(property) {
+                        case 'opacity' :// IE opacity uses filter
+                            value = 100;
+                            try { // will error if no DXImageTransform
+                                value = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;
+
+                            } catch(e) {
+                                try { // make sure its in the document
+                                    value = el.filters('alpha').opacity;
+                                } catch(err) {
+                                    YAHOO.log('getStyle: IE filter failed',
+                                            'error', 'Dom');
+                                }
+                            }
+                            return value / 100;
+                        case 'float': // fix reserved word
+                            property = 'styleFloat'; // fall through
+                        default: 
+                            property = Y.Dom._toCamel(property);
+                            value = el[CURRENT_STYLE] ? el[CURRENT_STYLE][property] : null;
+                            return ( el.style[property] || value );
+                    }
+                };
+            }
+        }(),
     
         /**
          * Wrapper for setting style properties of HTMLElements.  Normalizes "opacity" across modern browsers.
@@ -195,38 +212,191 @@
          * @param {String} val The value to apply to the given property.
          */
         setStyle: function(el, property, val) {
-            property = toCamel(property);
-            
-            var f = function(element) {
-                setStyle(element, property, val);
-                YAHOO.log('setStyle setting ' + property + ' to ' + val, 'info', 'Dom');
-                
-            };
-            
-            Y.Dom.batch(el, f, Y.Dom, true);
+            Y.Dom.batch(el, Y.Dom._setStyle, { prop: property, val: val });
         },
+
+        _setStyle: function() {
+            if (isIE) {
+                return function(el, args) {
+                    var property = Y.Dom._toCamel(args.prop),
+                        val = args.val;
+
+                    if (el) {
+                        switch (property) {
+                            case 'opacity':
+                                if ( lang.isString(el.style.filter) ) { // in case not appended
+                                    el.style.filter = 'alpha(opacity=' + val * 100 + ')';
+                                    
+                                    if (!el[CURRENT_STYLE] || !el[CURRENT_STYLE].hasLayout) {
+                                        el.style.zoom = 1; // when no layout or cant tell
+                                    }
+                                }
+                                break;
+                            case 'float':
+                                property = 'styleFloat';
+                            default:
+                            el.style[property] = val;
+                        }
+                    } else {
+                        YAHOO.log('element ' + el + ' is undefined', 'error', 'Dom');
+                    }
+                };
+            } else {
+                return function(el, args) {
+                    var property = Y.Dom._toCamel(args.prop),
+                        val = args.val;
+                    if (el) {
+                        if (property == 'float') {
+                            property = 'cssFloat';
+                        }
+                        el.style[property] = val;
+                    } else {
+                        YAHOO.log('element ' + el + ' is undefined', 'error', 'Dom');
+                    }
+                };
+            }
+
+        }(),
         
         /**
-         * Gets the current position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+         * Gets the current position of an element based on page coordinates. 
+         * Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
          * @method getXY
-         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM
+         * reference, or an Array of IDs and/or HTMLElements
          * @return {Array} The XY position of the element(s)
          */
         getXY: function(el) {
-            var f = function(el) {
-                // has to be part of document to have pageXY
-                if ( (el.parentNode === null || el.offsetParent === null ||
-                        this.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) {
-                    YAHOO.log('getXY failed: element not available', 'error', 'Dom');
-                    return false;
-                }
-                
-                YAHOO.log('getXY returning ' + getXY(el), 'info', 'Dom');
-                return getXY(el);
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, Y.Dom._getXY);
         },
+
+        _canPosition: function(el) {
+            return ( Y.Dom._getStyle(el, 'display') !== 'none' && Y.Dom._inDoc(el) );
+        },
+
+        _getXY: function() {
+            if (document[DOCUMENT_ELEMENT][GET_BOUNDING_CLIENT_RECT]) {
+                return function(node) {
+                    var scrollLeft, scrollTop, box, doc,
+                        off1, off2, mode, bLeft, bTop,
+                        floor = Math.floor, // TODO: round?
+                        xy = false;
+
+                    if (Y.Dom._canPosition(node)) {
+                        box = node[GET_BOUNDING_CLIENT_RECT]();
+                        doc = node[OWNER_DOCUMENT];
+                        scrollLeft = Y.Dom.getDocumentScrollLeft(doc);
+                        scrollTop = Y.Dom.getDocumentScrollTop(doc);
+                        xy = [floor(box[LEFT]), floor(box[TOP])];
+
+                        if (isIE && UA.ie < 8) { // IE < 8: viewport off by 2
+                            off1 = 2;
+                            off2 = 2;
+                            mode = doc[COMPAT_MODE];
+
+                            if (UA.ie === 6) {
+                                if (mode !== _BACK_COMPAT) {
+                                    off1 = 0;
+                                    off2 = 0;
+                                }
+                            }
+                            
+                            if ((mode === _BACK_COMPAT)) {
+                                bLeft = _getComputedStyle(doc[DOCUMENT_ELEMENT], BORDER_LEFT_WIDTH);
+                                bTop = _getComputedStyle(doc[DOCUMENT_ELEMENT], BORDER_TOP_WIDTH);
+                                if (bLeft !== MEDIUM) {
+                                    off1 = parseInt(bLeft, 10);
+                                }
+                                if (bTop !== MEDIUM) {
+                                    off2 = parseInt(bTop, 10);
+                                }
+                            }
+                            
+                            xy[0] -= off1;
+                            xy[1] -= off2;
+
+                        }
+
+                        if ((scrollTop || scrollLeft)) {
+                            xy[0] += scrollLeft;
+                            xy[1] += scrollTop;
+                        }
+
+                        // gecko may return sub-pixel (non-int) values
+                        xy[0] = floor(xy[0]);
+                        xy[1] = floor(xy[1]);
+                    } else {
+                        YAHOO.log('getXY failed: element not positionable (either not in a document or not displayed)', 'error', 'Dom');
+                    }
+
+                    return xy;
+                };
+            } else {
+                return function(node) { // ff2, safari: manually calculate by crawling up offsetParents
+                    var docScrollLeft, docScrollTop,
+                        scrollTop, scrollLeft,
+                        bCheck,
+                        xy = false,
+                        parentNode = node;
+
+                    if  (Y.Dom._canPosition(node) ) {
+                        xy = [node[OFFSET_LEFT], node[OFFSET_TOP]];
+                        docScrollLeft = Y.Dom.getDocumentScrollLeft(node[OWNER_DOCUMENT]);
+                        docScrollTop = Y.Dom.getDocumentScrollTop(node[OWNER_DOCUMENT]);
+
+                        // TODO: refactor with !! or just falsey
+                        bCheck = ((isGecko || UA.webkit > 519) ? true : false);
+
+                        // TODO: worth refactoring for TOP/LEFT only?
+                        while ((parentNode = parentNode[OFFSET_PARENT])) {
+                            xy[0] += parentNode[OFFSET_LEFT];
+                            xy[1] += parentNode[OFFSET_TOP];
+                            if (bCheck) {
+                                xy = Y.Dom._calcBorders(parentNode, xy);
+                            }
+                        }
+
+                        // account for any scrolled ancestors
+                        if (Y.Dom._getStyle(node, POSITION) !== FIXED) {
+                            parentNode = node;
+
+                            while ((parentNode = parentNode[PARENT_NODE]) && parentNode[TAG_NAME]) {
+                                scrollTop = parentNode[SCROLL_TOP];
+                                scrollLeft = parentNode[SCROLL_LEFT];
+
+                                //Firefox does something funky with borders when overflow is not visible.
+                                if (isGecko && (Y.Dom._getStyle(parentNode, 'overflow') !== 'visible')) {
+                                        xy = Y.Dom._calcBorders(parentNode, xy);
+                                }
+
+                                if (scrollTop || scrollLeft) {
+                                    xy[0] -= scrollLeft;
+                                    xy[1] -= scrollTop;
+                                }
+                            }
+                            xy[0] += docScrollLeft;
+                            xy[1] += docScrollTop;
+
+                        } else {
+                            //Fix FIXED position -- add scrollbars
+                            if (isOpera) {
+                                xy[0] -= docScrollLeft;
+                                xy[1] -= docScrollTop;
+                            } else if (isSafari || isGecko) {
+                                xy[0] += docScrollLeft;
+                                xy[1] += docScrollTop;
+                            }
+                        }
+                        //Round the numbers so we get sane data back
+                        xy[0] = Math.floor(xy[0]);
+                        xy[1] = Math.floor(xy[1]);
+                    } else {
+                        YAHOO.log('getXY failed: element not positionable (either not in a document or not displayed)', 'error', 'Dom');
+                    }
+                    return xy;                
+                };
+            }
+        }(), // NOTE: Executing for loadtime branching
         
         /**
          * Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
@@ -265,48 +435,61 @@
          * @param {Boolean} noRetry By default we try and set the position a second time if the first fails
          */
         setXY: function(el, pos, noRetry) {
-            var f = function(el) {
-                var style_pos = this.getStyle(el, 'position');
-                if (style_pos == 'static') { // default to relative
-                    this.setStyle(el, 'position', 'relative');
-                    style_pos = 'relative';
-                }
+            Y.Dom.batch(el, Y.Dom._setXY, { pos: pos, noRetry: noRetry });
+        },
 
-                var pageXY = this.getXY(el);
-                if (pageXY === false) { // has to be part of doc to have pageXY
-                    YAHOO.log('setXY failed: element not available', 'error', 'Dom');
-                    return false; 
-                }
-                
-                var delta = [ // assuming pixels; if not we will have to retry
-                    parseInt( this.getStyle(el, 'left'), 10 ),
-                    parseInt( this.getStyle(el, 'top'), 10 )
-                ];
-            
-                if ( isNaN(delta[0]) ) {// in case of 'auto'
-                    delta[0] = (style_pos == 'relative') ? 0 : el.offsetLeft;
-                } 
-                if ( isNaN(delta[1]) ) { // in case of 'auto'
-                    delta[1] = (style_pos == 'relative') ? 0 : el.offsetTop;
-                } 
+        _setXY: function(node, args) {
+            var pos = Y.Dom._getStyle(node, POSITION),
+                setStyle = Y.Dom.setStyle,
+                xy = args.pos,
+                noRetry = args.noRetry,
+
+                delta = [ // assuming pixels; if not we will have to retry
+                    parseInt( Y.Dom.getComputedStyle(node, LEFT), 10 ),
+                    parseInt( Y.Dom.getComputedStyle(node, TOP), 10 )
+                ],
+
+                currentXY,
+                newXY;
         
-                if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }
-                if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }
-              
-                if (!noRetry) {
-                    var newXY = this.getXY(el);
+            if (pos == 'static') { // default to relative
+                pos = RELATIVE;
+                setStyle(node, POSITION, pos);
+            }
 
-                    // if retry is true, try one more time if we miss 
-                   if ( (pos[0] !== null && newXY[0] != pos[0]) || 
-                        (pos[1] !== null && newXY[1] != pos[1]) ) {
-                       this.setXY(el, pos, true);
-                   }
-                }        
-        
-                YAHOO.log('setXY setting position to ' + pos, 'info', 'Dom');
-            };
+            currentXY = Y.Dom._getXY(node);
+
+            if (!xy || currentXY === false) { // has to be part of doc to have xy
+                YAHOO.log('xy failed: node not available', 'error', 'Node');
+                return false; 
+            }
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            if ( isNaN(delta[0]) ) {// in case of 'auto'
+                delta[0] = (pos == RELATIVE) ? 0 : node[OFFSET_LEFT];
+            } 
+            if ( isNaN(delta[1]) ) { // in case of 'auto'
+                delta[1] = (pos == RELATIVE) ? 0 : node[OFFSET_TOP];
+            } 
+
+            if (xy[0] !== null) { // from setX
+                setStyle(node, LEFT, xy[0] - currentXY[0] + delta[0] + 'px');
+            }
+
+            if (xy[1] !== null) { // from setY
+                setStyle(node, TOP, xy[1] - currentXY[1] + delta[1] + 'px');
+            }
+          
+            if (!noRetry) {
+                newXY = Y.Dom._getXY(node);
+
+                // if retry is true, try one more time if we miss 
+               if ( (xy[0] !== null && newXY[0] != xy[0]) || 
+                    (xy[1] !== null && newXY[1] != xy[1]) ) {
+                   Y.Dom._setXY(node, { pos: xy, noRetry: true });
+               }
+            }        
+
+            YAHOO.log('setXY setting position to ' + xy, 'info', 'Node');
         },
         
         /**
@@ -340,14 +523,14 @@
          */
         getRegion: function(el) {
             var f = function(el) {
-                if ( (el.parentNode === null || el.offsetParent === null ||
-                        this.getStyle(el, 'display') == 'none') && el != document.body) {
-                    YAHOO.log('getRegion failed: element not available', 'error', 'Dom');
-                    return false;
+                var region = false;
+                if ( Y.Dom._canPosition(el) ) {
+                    region = Y.Region.getRegion(el);
+                    YAHOO.log('getRegion returning ' + region, 'info', 'Dom');
+                } else {
+                    YAHOO.log('getRegion failed: element not positionable (either not in a document or not displayed)', 'error', 'Dom');
                 }
 
-                var region = Y.Region.getRegion(el);
-                YAHOO.log('getRegion returning ' + region, 'info', 'Dom');
                 return region;
             };
             
@@ -375,16 +558,23 @@
         },
 
         /**
-         * Returns a array of HTMLElements with the given class.
+         * Returns an array of HTMLElements with the given class.
          * For optimized performance, include a tag and/or root node when possible.
+         * Note: This method operates against a live collection, so modifying the 
+         * collection in the callback (removing/appending nodes, etc.) will have
+         * side effects.  Instead you should iterate the returned nodes array,
+         * as you would with the native "getElementsByTagName" method. 
          * @method getElementsByClassName
          * @param {String} className The class name to match against
          * @param {String} tag (optional) The tag name of the elements being collected
-         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point.
+         * This element is not included in the className scan.
          * @param {Function} apply (optional) A function to apply to each element when found 
+         * @param {Any} o (optional) An optional arg that is passed to the supplied method
+         * @param {Boolean} overrides (optional) Whether or not to override the scope of "method" with "o"
          * @return {Array} An array of elements that have the given class name
          */
-        getElementsByClassName: function(className, tag, root, apply) {
+        getElementsByClassName: function(className, tag, root, apply, o, overrides) {
             tag = tag || '*';
             root = (root) ? Y.Dom.get(root) : null || document; 
             if (!root) {
@@ -393,17 +583,18 @@
 
             var nodes = [],
                 elements = root.getElementsByTagName(tag),
-                re = getClassRegEx(className);
+                hasClass = Y.Dom.hasClass;
 
             for (var i = 0, len = elements.length; i < len; ++i) {
-                if ( re.test(elements[i].className) ) {
+                if ( hasClass(elements[i], className) ) {
                     nodes[nodes.length] = elements[i];
-                    if (apply) {
-                        apply.call(elements[i], elements[i]);
-                    }
                 }
             }
             
+            if (apply) {
+                Y.Dom.batch(nodes, apply, o, overrides);
+            }
+
             return nodes;
         },
 
@@ -415,14 +606,26 @@
          * @return {Boolean | Array} A boolean value or array of boolean values
          */
         hasClass: function(el, className) {
-            var re = getClassRegEx(className);
+            return Y.Dom.batch(el, Y.Dom._hasClass, className);
+        },
 
-            var f = function(el) {
-                YAHOO.log('hasClass returning ' + re.test(el.className), 'info', 'Dom');
-                return re.test(el.className);
-            };
+        _hasClass: function(el, className) {
+            var ret = false,
+                current;
             
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            if (el && className) {
+                current = Y.Dom._getAttribute(el, CLASS_NAME) || EMPTY;
+                if (className.exec) {
+                    ret = className.test(current);
+                } else {
+                    ret = className && (SPACE + current + SPACE).
+                        indexOf(SPACE + className + SPACE) > -1;
+                }
+            } else {
+                YAHOO.log('hasClass called with invalid arguments', 'warn', 'Dom');
+            }
+
+            return ret;
         },
     
         /**
@@ -433,18 +636,24 @@
          * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         addClass: function(el, className) {
-            var f = function(el) {
-                if (this.hasClass(el, className)) {
-                    return false; // already present
+            return Y.Dom.batch(el, Y.Dom._addClass, className);
+        },
+
+        _addClass: function(el, className) {
+            var ret = false,
+                current;
+
+            if (el && className) {
+                current = Y.Dom._getAttribute(el, CLASS_NAME) || EMPTY;
+                if ( !Y.Dom._hasClass(el, className) ) {
+                    Y.Dom.setAttribute(el, CLASS_NAME, trim(current + SPACE + className));
+                    ret = true;
                 }
-                
-                YAHOO.log('addClass adding ' + className, 'info', 'Dom');
-                
-                el.className = YAHOO.lang.trim([el.className, className].join(' '));
-                return true;
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            } else {
+                YAHOO.log('addClass called with invalid arguments', 'warn', 'Dom');
+            }
+
+            return ret;
         },
     
         /**
@@ -455,26 +664,36 @@
          * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         removeClass: function(el, className) {
-            var re = getClassRegEx(className);
-            
-            var f = function(el) {
-                if (!this.hasClass(el, className)) {
-                    return false; // not present
-                }                 
+            return Y.Dom.batch(el, Y.Dom._removeClass, className);
+        },
+        
+        _removeClass: function(el, className) {
+            var ret = false,
+                current,
+                newClass,
+                attr;
 
-                YAHOO.log('removeClass removing ' + className, 'info', 'Dom');
-                
-                var c = el.className;
-                el.className = c.replace(re, ' ');
-                if ( this.hasClass(el, className) ) { // in case of multiple adjacent
-                    this.removeClass(el, className);
+            if (el && className) {
+                current = Y.Dom._getAttribute(el, CLASS_NAME) || EMPTY;
+                Y.Dom.setAttribute(el, CLASS_NAME, current.replace(Y.Dom._getClassRegex(className), EMPTY));
+
+                newClass = Y.Dom._getAttribute(el, CLASS_NAME);
+                if (current !== newClass) { // else nothing changed
+                    Y.Dom.setAttribute(el, CLASS_NAME, trim(newClass)); // trim after comparing to current class
+                    ret = true;
+
+                    if (Y.Dom._getAttribute(el, CLASS_NAME) === '') { // remove class attribute if empty
+                        attr = (el.hasAttribute && el.hasAttribute(_CLASS)) ? _CLASS : CLASS_NAME;
+                        YAHOO.log('removeClass removing empty class attribute', 'info', 'Dom');
+                        el.removeAttribute(attr);
+                    }
                 }
 
-                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
-                return true;
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            } else {
+                YAHOO.log('removeClass called with invalid arguments', 'warn', 'Dom');
+            }
+
+            return ret;
         },
         
         /**
@@ -487,31 +706,40 @@
          * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         replaceClass: function(el, oldClassName, newClassName) {
-            if (!newClassName || oldClassName === newClassName) { // avoid infinite loop
-                return false;
-            }
-            
-            var re = getClassRegEx(oldClassName);
+            return Y.Dom.batch(el, Y.Dom._replaceClass, { from: oldClassName, to: newClassName });
+        },
 
-            var f = function(el) {
-                YAHOO.log('replaceClass replacing ' + oldClassName + ' with ' + newClassName, 'info', 'Dom');
-            
-                if ( !this.hasClass(el, oldClassName) ) {
-                    this.addClass(el, newClassName); // just add it if nothing to replace
-                    return true; // NOTE: return
-                }
-            
-                el.className = el.className.replace(re, ' ' + newClassName + ' ');
+        _replaceClass: function(el, classObj) {
+            var className,
+                from,
+                to,
+                ret = false,
+                current;
 
-                if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent
-                    this.replaceClass(el, oldClassName, newClassName);
+            if (el && classObj) {
+                from = classObj.from;
+                to = classObj.to;
+
+                if (!to) {
+                    ret = false;
+                }  else if (!from) { // just add if no "from"
+                    ret = Y.Dom._addClass(el, classObj.to);
+                } else if (from !== to) { // else nothing to replace
+                    // May need to lead with DBLSPACE?
+                    current = Y.Dom._getAttribute(el, CLASS_NAME) || EMPTY;
+                    className = (SPACE + current.replace(Y.Dom._getClassRegex(from), SPACE + to)).
+                               split(Y.Dom._getClassRegex(to));
+
+                    // insert to into what would have been the first occurrence slot
+                    className.splice(1, 0, SPACE + to);
+                    Y.Dom.setAttribute(el, CLASS_NAME, trim(className.join(EMPTY)));
+                    ret = true;
                 }
+            } else {
+                YAHOO.log('replaceClass called with invalid arguments', 'warn', 'Dom');
+            }
 
-                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
-                return true;
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            return ret;
         },
         
         /**
@@ -528,12 +756,16 @@
                 if (el && el.id) { // do not override existing ID
                     YAHOO.log('generateId returning existing id ' + el.id, 'info', 'Dom');
                     return el.id;
-                } 
+                }
 
-                var id = prefix + id_counter++;
+                var id = prefix + YAHOO.env._id_counter++;
                 YAHOO.log('generateId generating ' + id, 'info', 'Dom');
 
                 if (el) {
+                    if (el[OWNER_DOCUMENT] && el[OWNER_DOCUMENT].getElementById(id)) { // in case one already exists
+                        // use failed id plus prefix to help ensure uniqueness
+                        return Y.Dom.generateId(el, id + prefix);
+                    }
                     el.id = id;
                 }
                 
@@ -555,25 +787,20 @@
             haystack = Y.Dom.get(haystack);
             needle = Y.Dom.get(needle);
             
-            if (!haystack || !needle) {
-                return false;
-            }
+            var ret = false;
 
-            if (haystack.contains && needle.nodeType && !isSafari) { // safari contains is broken
-                YAHOO.log('isAncestor returning ' + haystack.contains(needle), 'info', 'Dom');
-                return haystack.contains(needle);
+            if ( (haystack && needle) && (haystack[NODE_TYPE] && needle[NODE_TYPE]) ) {
+                if (haystack.contains && haystack !== needle) { // contains returns true when equal
+                    ret = haystack.contains(needle);
+                }
+                else if (haystack.compareDocumentPosition) { // gecko
+                    ret = !!(haystack.compareDocumentPosition(needle) & 16);
+                }
+            } else {
+                YAHOO.log('isAncestor failed; invalid input: ' + haystack + ',' + needle, 'error', 'Dom');
             }
-            else if ( haystack.compareDocumentPosition && needle.nodeType ) {
-                YAHOO.log('isAncestor returning ' + !!(haystack.compareDocumentPosition(needle) & 16), 'info', 'Dom');
-                return !!(haystack.compareDocumentPosition(needle) & 16);
-            } else if (needle.nodeType) {
-                // fallback to crawling up (safari)
-                return !!this.getAncestorBy(needle, function(el) {
-                    return el == haystack; 
-                }); 
-            }
-            YAHOO.log('isAncestor failed; most likely needle is not an HTMLElement', 'error', 'Dom');
-            return false;
+            YAHOO.log('isAncestor(' + haystack + ',' + needle + ' returning ' + ret, 'info', 'Dom');
+            return ret;
         },
         
         /**
@@ -580,23 +807,41 @@
          * Determines whether an HTMLElement is present in the current document.
          * @method inDocument         
          * @param {String | HTMLElement} el The element to search for
+         * @param {Object} doc An optional document to search, defaults to element's owner document 
          * @return {Boolean} Whether or not the element is present in the current document
          */
-        inDocument: function(el) {
-            return this.isAncestor(document.documentElement, el);
+        inDocument: function(el, doc) {
+            return Y.Dom._inDoc(Y.Dom.get(el), doc);
         },
+
+        _inDoc: function(el, doc) {
+            var ret = false;
+            if (el && el[TAG_NAME]) {
+                doc = doc || el[OWNER_DOCUMENT]; 
+                ret = Y.Dom.isAncestor(doc[DOCUMENT_ELEMENT], el);
+            } else {
+                YAHOO.log('inDocument failed: invalid input', 'error', 'Dom');
+            }
+            return ret;
+        },
         
         /**
-         * Returns a array of HTMLElements that pass the test applied by supplied boolean method.
+         * Returns an array of HTMLElements that pass the test applied by supplied boolean method.
          * For optimized performance, include a tag and/or root node when possible.
+         * Note: This method operates against a live collection, so modifying the 
+         * collection in the callback (removing/appending nodes, etc.) will have
+         * side effects.  Instead you should iterate the returned nodes array,
+         * as you would with the native "getElementsByTagName" method. 
          * @method getElementsBy
          * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
          * @param {String} tag (optional) The tag name of the elements being collected
          * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
          * @param {Function} apply (optional) A function to apply to each element when found 
+         * @param {Any} o (optional) An optional arg that is passed to the supplied method
+         * @param {Boolean} overrides (optional) Whether or not to override the scope of "method" with "o"
          * @return {Array} Array of HTMLElements
          */
-        getElementsBy: function(method, tag, root, apply) {
+        getElementsBy: function(method, tag, root, apply, o, overrides, firstOnly) {
             tag = tag || '*';
             root = (root) ? Y.Dom.get(root) : null || document; 
 
@@ -609,13 +854,19 @@
             
             for (var i = 0, len = elements.length; i < len; ++i) {
                 if ( method(elements[i]) ) {
-                    nodes[nodes.length] = elements[i];
-                    if (apply) {
-                        apply(elements[i]);
+                    if (firstOnly) {
+                        nodes = elements[i]; 
+                        break;
+                    } else {
+                        nodes[nodes.length] = elements[i];
                     }
                 }
             }
 
+            if (apply) {
+                Y.Dom.batch(nodes, apply, o, overrides);
+            }
+
             YAHOO.log('getElementsBy returning ' + nodes, 'info', 'Dom');
             
             return nodes;
@@ -622,6 +873,18 @@
         },
         
         /**
+         * Returns the first HTMLElement that passes the test applied by the supplied boolean method.
+         * @method getElementBy
+         * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
+         * @param {String} tag (optional) The tag name of the elements being collected
+         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @return {HTMLElement}
+         */
+        getElementBy: function(method, tag, root) {
+            return Y.Dom.getElementsBy(method, tag, root, null, null, null, true); 
+        },
+
+        /**
          * Runs the supplied method against each item in the Collection/Array.
          * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).
          * @method batch
@@ -628,28 +891,26 @@
          * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to
          * @param {Function} method The method to apply to the element(s)
          * @param {Any} o (optional) An optional arg that is passed to the supplied method
-         * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"
+         * @param {Boolean} overrides (optional) Whether or not to override the scope of "method" with "o"
          * @return {Any | Array} The return value(s) from the supplied method
          */
-        batch: function(el, method, o, override) {
-            el = (el && (el.tagName || el.item)) ? el : Y.Dom.get(el); // skip get() when possible
+        batch: function(el, method, o, overrides) {
+            var collection = [],
+                scope = (overrides) ? o : window;
+                
+            el = (el && (el[TAG_NAME] || el.item)) ? el : Y.Dom.get(el); // skip get() when possible
+            if (el && method) {
+                if (el[TAG_NAME] || el.length === undefined) { // element or not array-like 
+                    return method.call(scope, el, o);
+                } 
 
-            if (!el || !method) {
-                YAHOO.log('batch failed: invalid arguments', 'error', 'Dom');
+                for (var i = 0; i < el.length; ++i) {
+                    collection[collection.length] = method.call(scope, el[i], o);
+                }
+            } else {
+                YAHOO.log('batch called with invalid arguments', 'warn', 'Dom');
                 return false;
             } 
-            var scope = (override) ? o : window;
-            
-            if (el.tagName || el.length === undefined) { // element or not array-like 
-                return method.call(scope, el, o);
-            } 
-
-            var collection = [];
-            
-            for (var i = 0, len = el.length; i < len; ++i) {
-                collection[collection.length] = method.call(scope, el[i], o);
-            }
-            
             return collection;
         },
         
@@ -659,9 +920,9 @@
          * @return {Int} The height of the actual document (which includes the body and its margin).
          */
         getDocumentHeight: function() {
-            var scrollHeight = (document.compatMode != 'CSS1Compat') ? document.body.scrollHeight : document.documentElement.scrollHeight;
+            var scrollHeight = (document[COMPAT_MODE] != CSS1_COMPAT || isSafari) ? document.body.scrollHeight : documentElement.scrollHeight,
+                h = Math.max(scrollHeight, Y.Dom.getViewportHeight());
 
-            var h = Math.max(scrollHeight, Y.Dom.getViewportHeight());
             YAHOO.log('getDocumentHeight returning ' + h, 'info', 'Dom');
             return h;
         },
@@ -672,8 +933,8 @@
          * @return {Int} The width of the actual document (which includes the body and its margin).
          */
         getDocumentWidth: function() {
-            var scrollWidth = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth;
-            var w = Math.max(scrollWidth, Y.Dom.getViewportWidth());
+            var scrollWidth = (document[COMPAT_MODE] != CSS1_COMPAT || isSafari) ? document.body.scrollWidth : documentElement.scrollWidth,
+                w = Math.max(scrollWidth, Y.Dom.getViewportWidth());
             YAHOO.log('getDocumentWidth returning ' + w, 'info', 'Dom');
             return w;
         },
@@ -684,12 +945,12 @@
          * @return {Int} The height of the viewable area of the page (excludes scrollbars).
          */
         getViewportHeight: function() {
-            var height = self.innerHeight; // Safari, Opera
-            var mode = document.compatMode;
+            var height = self.innerHeight, // Safari, Opera
+                mode = document[COMPAT_MODE];
         
             if ( (mode || isIE) && !isOpera ) { // IE, Gecko
-                height = (mode == 'CSS1Compat') ?
-                        document.documentElement.clientHeight : // Standards
+                height = (mode == CSS1_COMPAT) ?
+                        documentElement.clientHeight : // Standards
                         document.body.clientHeight; // Quirks
             }
         
@@ -704,12 +965,12 @@
          */
         
         getViewportWidth: function() {
-            var width = self.innerWidth;  // Safari
-            var mode = document.compatMode;
+            var width = self.innerWidth,  // Safari
+                mode = document[COMPAT_MODE];
             
             if (mode || isIE) { // IE, Gecko, Opera
-                width = (mode == 'CSS1Compat') ?
-                        document.documentElement.clientWidth : // Standards
+                width = (mode == CSS1_COMPAT) ?
+                        documentElement.clientWidth : // Standards
                         document.body.clientWidth; // Quirks
             }
             YAHOO.log('getViewportWidth returning ' + width, 'info', 'Dom');
@@ -725,8 +986,8 @@
          * @return {Object} HTMLElement or null if not found
          */
         getAncestorBy: function(node, method) {
-            while (node = node.parentNode) { // NOTE: assignment
-                if ( testElement(node, method) ) {
+            while ( (node = node[PARENT_NODE]) ) { // NOTE: assignment
+                if ( Y.Dom._testElement(node, method) ) {
                     YAHOO.log('getAncestorBy returning ' + node, 'info', 'Dom');
                     return node;
                 }
@@ -767,7 +1028,7 @@
                 return null;
             }
             var method = function(el) {
-                 return el.tagName && el.tagName.toUpperCase() == tagName.toUpperCase();
+                 return el[TAG_NAME] && el[TAG_NAME].toUpperCase() == tagName.toUpperCase();
             };
 
             return Y.Dom.getAncestorBy(node, method);
@@ -786,7 +1047,7 @@
         getPreviousSiblingBy: function(node, method) {
             while (node) {
                 node = node.previousSibling;
-                if ( testElement(node, method) ) {
+                if ( Y.Dom._testElement(node, method) ) {
                     return node;
                 }
             }
@@ -822,7 +1083,7 @@
         getNextSiblingBy: function(node, method) {
             while (node) {
                 node = node.nextSibling;
-                if ( testElement(node, method) ) {
+                if ( Y.Dom._testElement(node, method) ) {
                     return node;
                 }
             }
@@ -854,7 +1115,7 @@
          * @return {Object} HTMLElement or null if not found
          */
         getFirstChildBy: function(node, method) {
-            var child = ( testElement(node.firstChild, method) ) ? node.firstChild : null;
+            var child = ( Y.Dom._testElement(node.firstChild, method) ) ? node.firstChild : null;
             return child || Y.Dom.getNextSiblingBy(node.firstChild, method);
         }, 
 
@@ -886,7 +1147,7 @@
                 YAHOO.log('getLastChild failed: invalid node argument', 'error', 'Dom');
                 return null;
             }
-            var child = ( testElement(node.lastChild, method) ) ? node.lastChild : null;
+            var child = ( Y.Dom._testElement(node.lastChild, method) ) ? node.lastChild : null;
             return child || Y.Dom.getPreviousSiblingBy(node.lastChild, method);
         }, 
 
@@ -910,8 +1171,8 @@
          * @return {Array} A static array of HTMLElements
          */
         getChildrenBy: function(node, method) {
-            var child = Y.Dom.getFirstChildBy(node, method);
-            var children = child ? [child] : [];
+            var child = Y.Dom.getFirstChildBy(node, method),
+                children = child ? [child] : [];
 
             Y.Dom.getNextSiblingBy(child, function(node) {
                 if ( !method || method(node) ) {
@@ -937,7 +1198,7 @@
 
             return Y.Dom.getChildrenBy(node);
         },
- 
+
         /**
          * Returns the left scroll value of the document 
          * @method getDocumentScrollLeft
@@ -946,7 +1207,7 @@
          */
         getDocumentScrollLeft: function(doc) {
             doc = doc || document;
-            return Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
+            return Math.max(doc[DOCUMENT_ELEMENT].scrollLeft, doc.body.scrollLeft);
         }, 
 
         /**
@@ -957,7 +1218,7 @@
          */
         getDocumentScrollTop: function(doc) {
             doc = doc || document;
-            return Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
+            return Math.max(doc[DOCUMENT_ELEMENT].scrollTop, doc.body.scrollTop);
         },
 
         /**
@@ -971,12 +1232,12 @@
             newNode = Y.Dom.get(newNode); 
             referenceNode = Y.Dom.get(referenceNode); 
             
-            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+            if (!newNode || !referenceNode || !referenceNode[PARENT_NODE]) {
                 YAHOO.log('insertAfter failed: missing or invalid arg(s)', 'error', 'Dom');
                 return null;
             }       
 
-            return referenceNode.parentNode.insertBefore(newNode, referenceNode); 
+            return referenceNode[PARENT_NODE].insertBefore(newNode, referenceNode); 
         },
 
         /**
@@ -990,15 +1251,15 @@
             newNode = Y.Dom.get(newNode); 
             referenceNode = Y.Dom.get(referenceNode); 
             
-            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+            if (!newNode || !referenceNode || !referenceNode[PARENT_NODE]) {
                 YAHOO.log('insertAfter failed: missing or invalid arg(s)', 'error', 'Dom');
                 return null;
             }       
 
             if (referenceNode.nextSibling) {
-                return referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); 
+                return referenceNode[PARENT_NODE].insertBefore(newNode, referenceNode.nextSibling); 
             } else {
-                return referenceNode.parentNode.appendChild(newNode);
+                return referenceNode[PARENT_NODE].appendChild(newNode);
             }
         },
 
@@ -1014,62 +1275,145 @@
                 b = Y.Dom.getViewportHeight() + t;
 
             return new Y.Region(t, r, b, l);
-        }
-    };
-    
-    var getXY = function() {
-        if (document.documentElement.getBoundingClientRect) { // IE
-            return function(el) {
-                var box = el.getBoundingClientRect();
+        },
 
-                var rootNode = el.ownerDocument;
-                return [box.left + Y.Dom.getDocumentScrollLeft(rootNode), box.top +
-                        Y.Dom.getDocumentScrollTop(rootNode)];
-            };
-        } else {
-            return function(el) { // manually calculate by crawling up offsetParents
-                var pos = [el.offsetLeft, el.offsetTop];
-                var parentNode = el.offsetParent;
+        /**
+         * Provides a normalized attribute interface. 
+         * @method setAttribute
+         * @param {String | HTMLElement} el The target element for the attribute.
+         * @param {String} attr The attribute to set.
+         * @param {String} val The value of the attribute.
+         */
+        setAttribute: function(el, attr, val) {
+            Y.Dom.batch(el, Y.Dom._setAttribute, { attr: attr, val: val });
+        },
 
-                // safari: subtract body offsets if el is abs (or any offsetParent), unless body is offsetParent
-                var accountForBody = (isSafari &&
-                        Y.Dom.getStyle(el, 'position') == 'absolute' &&
-                        el.offsetParent == el.ownerDocument.body);
+        _setAttribute: function(el, args) {
+            var attr = Y.Dom._toCamel(args.attr),
+                val = args.val;
 
-                if (parentNode != el) {
-                    while (parentNode) {
-                        pos[0] += parentNode.offsetLeft;
-                        pos[1] += parentNode.offsetTop;
-                        if (!accountForBody && isSafari && 
-                                Y.Dom.getStyle(parentNode,'position') == 'absolute' ) { 
-                            accountForBody = true;
-                        }
-                        parentNode = parentNode.offsetParent;
-                    }
+            if (el && el.setAttribute) {
+                if (Y.Dom.DOT_ATTRIBUTES[attr]) {
+                    el[attr] = val;
+                } else {
+                    attr = Y.Dom.CUSTOM_ATTRIBUTES[attr] || attr;
+                    el.setAttribute(attr, val);
                 }
+            } else {
+                YAHOO.log('setAttribute method not available for ' + el, 'error', 'Dom');
+            }
+        },
 
-                if (accountForBody) { //safari doubles in this case
-                    pos[0] -= el.ownerDocument.body.offsetLeft;
-                    pos[1] -= el.ownerDocument.body.offsetTop;
-                } 
-                parentNode = el.parentNode;
+        /**
+         * Provides a normalized attribute interface. 
+         * @method getAttribute
+         * @param {String | HTMLElement} el The target element for the attribute.
+         * @param {String} attr The attribute to get.
+         * @return {String} The current value of the attribute. 
+         */
+        getAttribute: function(el, attr) {
+            return Y.Dom.batch(el, Y.Dom._getAttribute, attr);
+        },
 
-                // account for any scrolled ancestors
-                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
-                {
-                   // work around opera inline/table scrollLeft/Top bug
-                   if (Y.Dom.getStyle(parentNode, 'display').search(/^inline|table-row.*$/i)) { 
-                        pos[0] -= parentNode.scrollLeft;
-                        pos[1] -= parentNode.scrollTop;
+
+        _getAttribute: function(el, attr) {
+            var val;
+            attr = Y.Dom.CUSTOM_ATTRIBUTES[attr] || attr;
+
+            if (el && el.getAttribute) {
+                val = el.getAttribute(attr, 2);
+            } else {
+                YAHOO.log('getAttribute method not available for ' + el, 'error', 'Dom');
+            }
+
+            return val;
+        },
+
+        _toCamel: function(property) {
+            var c = propertyCache;
+
+            function tU(x,l) {
+                return l.toUpperCase();
+            }
+
+            return c[property] || (c[property] = property.indexOf('-') === -1 ? 
+                                    property :
+                                    property.replace( /-([a-z])/gi, tU ));
+        },
+
+        _getClassRegex: function(className) {
+            var re;
+            if (className !== undefined) { // allow empty string to pass
+                if (className.exec) { // already a RegExp
+                    re = className;
+                } else {
+                    re = reCache[className];
+                    if (!re) {
+                        // escape special chars (".", "[", etc.)
+                        className = className.replace(Y.Dom._patterns.CLASS_RE_TOKENS, '\\$1');
+                        re = reCache[className] = new RegExp(C_START + className + C_END, G);
                     }
-                    
-                    parentNode = parentNode.parentNode; 
                 }
+            }
+            return re;
+        },
 
-                return pos;
-            };
+        _patterns: {
+            ROOT_TAG: /^body|html$/i, // body for quirks mode, html for standards,
+            CLASS_RE_TOKENS: /([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g
+        },
+
+
+        _testElement: function(node, method) {
+            return node && node[NODE_TYPE] == 1 && ( !method || method(node) );
+        },
+
+        _calcBorders: function(node, xy2) {
+            var t = parseInt(Y.Dom[GET_COMPUTED_STYLE](node, BORDER_TOP_WIDTH), 10) || 0,
+                l = parseInt(Y.Dom[GET_COMPUTED_STYLE](node, BORDER_LEFT_WIDTH), 10) || 0;
+            if (isGecko) {
+                if (RE_TABLE.test(node[TAG_NAME])) {
+                    t = 0;
+                    l = 0;
+                }
+            }
+            xy2[0] += l;
+            xy2[1] += t;
+            return xy2;
         }
-    }() // NOTE: Executing for loadtime branching
+    };
+        
+    var _getComputedStyle = Y.Dom[GET_COMPUTED_STYLE];
+    // fix opera computedStyle default color unit (convert to rgb)
+    if (UA.opera) {
+        Y.Dom[GET_COMPUTED_STYLE] = function(node, att) {
+            var val = _getComputedStyle(node, att);
+            if (RE_COLOR.test(att)) {
+                val = Y.Dom.Color.toRGB(val);
+            }
+
+            return val;
+        };
+
+    }
+
+    // safari converts transparent to rgba(), others use "transparent"
+    if (UA.webkit) {
+        Y.Dom[GET_COMPUTED_STYLE] = function(node, att) {
+            var val = _getComputedStyle(node, att);
+
+            if (val === 'rgba(0, 0, 0, 0)') {
+                val = 'transparent'; 
+            }
+
+            return val;
+        };
+
+    }
+
+    if (UA.ie && UA.ie >= 8 && document.documentElement.hasAttribute) { // IE 8 standards
+        Y.Dom.DOT_ATTRIBUTES.type = true; // IE 8 errors on input.setAttribute('type')
+    }
 })();
 /**
  * A region is a representation of an object on a grid.  It is defined
@@ -1093,6 +1437,13 @@
     this.top = t;
     
     /**
+     * The region's top extent
+     * @property y
+     * @type Int
+     */
+    this.y = t;
+    
+    /**
      * The region's top extent as index, for symmetry with set/getXY
      * @property 1
      * @type Int
@@ -1121,11 +1472,32 @@
     this.left = l;
     
     /**
+     * The region's left extent
+     * @property x
+     * @type Int
+     */
+    this.x = l;
+    
+    /**
      * The region's left extent as index, for symmetry with set/getXY
      * @property 0
      * @type Int
      */
     this[0] = l;
+
+    /**
+     * The region's total width 
+     * @property width 
+     * @type Int
+     */
+    this.width = this.right - this.left;
+
+    /**
+     * The region's total height 
+     * @property height 
+     * @type Int
+     */
+    this.height = this.bottom - this.top;
 };
 
 /**
@@ -1160,10 +1532,10 @@
  * @return {Region}        The overlap region, or null if there is no overlap
  */
 YAHOO.util.Region.prototype.intersect = function(region) {
-    var t = Math.max( this.top,    region.top    );
-    var r = Math.min( this.right,  region.right  );
-    var b = Math.min( this.bottom, region.bottom );
-    var l = Math.max( this.left,   region.left   );
+    var t = Math.max( this.top,    region.top    ),
+        r = Math.min( this.right,  region.right  ),
+        b = Math.min( this.bottom, region.bottom ),
+        l = Math.max( this.left,   region.left   );
     
     if (b >= t && r >= l) {
         return new YAHOO.util.Region(t, r, b, l);
@@ -1180,10 +1552,10 @@
  * @return {Region}        The union region
  */
 YAHOO.util.Region.prototype.union = function(region) {
-    var t = Math.min( this.top,    region.top    );
-    var r = Math.max( this.right,  region.right  );
-    var b = Math.max( this.bottom, region.bottom );
-    var l = Math.min( this.left,   region.left   );
+    var t = Math.min( this.top,    region.top    ),
+        r = Math.max( this.right,  region.right  ),
+        b = Math.max( this.bottom, region.bottom ),
+        l = Math.min( this.left,   region.left   );
 
     return new YAHOO.util.Region(t, r, b, l);
 };
@@ -1199,6 +1571,8 @@
              ", right: "   + this.right  + 
              ", bottom: "  + this.bottom + 
              ", left: "    + this.left   + 
+             ", height: "  + this.height + 
+             ", width: "    + this.width   + 
              "}" );
 };
 
@@ -1210,13 +1584,12 @@
  * @static
  */
 YAHOO.util.Region.getRegion = function(el) {
-    var p = YAHOO.util.Dom.getXY(el);
+    var p = YAHOO.util.Dom.getXY(el),
+        t = p[1],
+        r = p[0] + el.offsetWidth,
+        b = p[1] + el.offsetHeight,
+        l = p[0];
 
-    var t = p[1];
-    var r = p[0] + el.offsetWidth;
-    var b = p[1] + el.offsetHeight;
-    var l = p[0];
-
     return new YAHOO.util.Region(t, r, b, l);
 };
 
@@ -1238,23 +1611,262 @@
       y = x[1]; // dont blow away x yet
       x = x[0];
    }
-   
-    /**
-     * The X position of the point, which is also the right, left and index zero (for Dom.getXY symmetry)
-     * @property x
-     * @type Int
-     */
-
-    this.x = this.right = this.left = this[0] = x;
-     
-    /**
-     * The Y position of the point, which is also the top, bottom and index one (for Dom.getXY symmetry)
-     * @property y
-     * @type Int
-     */
-    this.y = this.top = this.bottom = this[1] = y;
+ 
+    YAHOO.util.Point.superclass.constructor.call(this, y, x, y, x);
 };
 
-YAHOO.util.Point.prototype = new YAHOO.util.Region();
+YAHOO.extend(YAHOO.util.Point, YAHOO.util.Region);
 
-YAHOO.register("dom", YAHOO.util.Dom, {version: "2.4.1", build: "742"});
+(function() {
+/**
+ * Add style management functionality to DOM.
+ * @module dom
+ * @for Dom
+ */
+
+var Y = YAHOO.util, 
+    CLIENT_TOP = 'clientTop',
+    CLIENT_LEFT = 'clientLeft',
+    PARENT_NODE = 'parentNode',
+    RIGHT = 'right',
+    HAS_LAYOUT = 'hasLayout',
+    PX = 'px',
+    OPACITY = 'opacity',
+    AUTO = 'auto',
+    BORDER_LEFT_WIDTH = 'borderLeftWidth',
+    BORDER_TOP_WIDTH = 'borderTopWidth',
+    BORDER_RIGHT_WIDTH = 'borderRightWidth',
+    BORDER_BOTTOM_WIDTH = 'borderBottomWidth',
+    VISIBLE = 'visible',
+    TRANSPARENT = 'transparent',
+    HEIGHT = 'height',
+    WIDTH = 'width',
+    STYLE = 'style',
+    CURRENT_STYLE = 'currentStyle',
+
+// IE getComputedStyle
+// TODO: unit-less lineHeight (e.g. 1.22)
+    re_size = /^width|height$/,
+    re_unit = /^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,
+
+    ComputedStyle = {
+        get: function(el, property) {
+            var value = '',
+                current = el[CURRENT_STYLE][property];
+
+            if (property === OPACITY) {
+                value = Y.Dom.getStyle(el, OPACITY);        
+            } else if (!current || (current.indexOf && current.indexOf(PX) > -1)) { // no need to convert
+                value = current;
+            } else if (Y.Dom.IE_COMPUTED[property]) { // use compute function
+                value = Y.Dom.IE_COMPUTED[property](el, property);
+            } else if (re_unit.test(current)) { // convert to pixel
+                value = Y.Dom.IE.ComputedStyle.getPixel(el, property);
+            } else {
+                value = current;
+            }
+
+            return value;
+        },
+
+        getOffset: function(el, prop) {
+            var current = el[CURRENT_STYLE][prop],                        // value of "width", "top", etc.
+                capped = prop.charAt(0).toUpperCase() + prop.substr(1), // "Width", "Top", etc.
+                offset = 'offset' + capped,                             // "offsetWidth", "offsetTop", etc.
+                pixel = 'pixel' + capped,                               // "pixelWidth", "pixelTop", etc.
+                value = '',
+                actual;
+
+            if (current == AUTO) {
+                actual = el[offset]; // offsetHeight/Top etc.
+                if (actual === undefined) { // likely "right" or "bottom"
+                    value = 0;
+                }
+
+                value = actual;
+                if (re_size.test(prop)) { // account for box model diff 
+                    el[STYLE][prop] = actual; 
+                    if (el[offset] > actual) {
+                        // the difference is padding + border (works in Standards & Quirks modes)
+                        value = actual - (el[offset] - actual);
+                    }
+                    el[STYLE][prop] = AUTO; // revert to auto
+                }
+            } else { // convert units to px
+                if (!el[STYLE][pixel] && !el[STYLE][prop]) { // need to map style.width to currentStyle (no currentStyle.pixelWidth)
+                    el[STYLE][prop] = current;              // no style.pixelWidth if no style.width
+                }
+                value = el[STYLE][pixel];
+            }
+            return value + PX;
+        },
+
+        getBorderWidth: function(el, property) {
+            // clientHeight/Width = paddingBox (e.g. offsetWidth - borderWidth)
+            // clientTop/Left = borderWidth
+            var value = null;
+            if (!el[CURRENT_STYLE][HAS_LAYOUT]) { // TODO: unset layout?
+                el[STYLE].zoom = 1; // need layout to measure client
+            }
+
+            switch(property) {
+                case BORDER_TOP_WIDTH:
+                    value = el[CLIENT_TOP];
+                    break;
+                case BORDER_BOTTOM_WIDTH:
+                    value = el.offsetHeight - el.clientHeight - el[CLIENT_TOP];
+                    break;
+                case BORDER_LEFT_WIDTH:
+                    value = el[CLIENT_LEFT];
+                    break;
+                case BORDER_RIGHT_WIDTH:
+                    value = el.offsetWidth - el.clientWidth - el[CLIENT_LEFT];
+                    break;
+            }
+            return value + PX;
+        },
+
+        getPixel: function(node, att) {
+            // use pixelRight to convert to px
+            var val = null,
+                styleRight = node[CURRENT_STYLE][RIGHT],
+                current = node[CURRENT_STYLE][att];
+
+            node[STYLE][RIGHT] = current;
+            val = node[STYLE].pixelRight;
+            node[STYLE][RIGHT] = styleRight; // revert
+
+            return val + PX;
+        },
+
+        getMargin: function(node, att) {
+            var val;
+            if (node[CURRENT_STYLE][att] == AUTO) {
+                val = 0 + PX;
+            } else {
+                val = Y.Dom.IE.ComputedStyle.getPixel(node, att);
+            }
+            return val;
+        },
+
+        getVisibility: function(node, att) {
+            var current;
+            while ( (current = node[CURRENT_STYLE]) && current[att] == 'inherit') { // NOTE: assignment in test
+                node = node[PARENT_NODE];
+            }
+            return (current) ? current[att] : VISIBLE;
+        },
+
+        getColor: function(node, att) {
+            return Y.Dom.Color.toRGB(node[CURRENT_STYLE][att]) || TRANSPARENT;
+        },
+
+        getBorderColor: function(node, att) {
+            var current = node[CURRENT_STYLE],
+                val = current[att] || current.color;
+            return Y.Dom.Color.toRGB(Y.Dom.Color.toHex(val));
+        }
+
+    },
+
+//fontSize: getPixelFont,
+    IEComputed = {};
+
+IEComputed.top = IEComputed.right = IEComputed.bottom = IEComputed.left = 
+        IEComputed[WIDTH] = IEComputed[HEIGHT] = ComputedStyle.getOffset;
+
+IEComputed.color = ComputedStyle.getColor;
+
+IEComputed[BORDER_TOP_WIDTH] = IEComputed[BORDER_RIGHT_WIDTH] =
+        IEComputed[BORDER_BOTTOM_WIDTH] = IEComputed[BORDER_LEFT_WIDTH] =
+        ComputedStyle.getBorderWidth;
+
+IEComputed.marginTop = IEComputed.marginRight = IEComputed.marginBottom =
+        IEComputed.marginLeft = ComputedStyle.getMargin;
+
+IEComputed.visibility = ComputedStyle.getVisibility;
+IEComputed.borderColor = IEComputed.borderTopColor =
+        IEComputed.borderRightColor = IEComputed.borderBottomColor =
+        IEComputed.borderLeftColor = ComputedStyle.getBorderColor;
+
+Y.Dom.IE_COMPUTED = IEComputed;
+Y.Dom.IE_ComputedStyle = ComputedStyle;
+})();
+(function() {
+/**
+ * Add style management functionality to DOM.
+ * @module dom
+ * @for Dom
+ */
+
+var TO_STRING = 'toString',
+    PARSE_INT = parseInt,
+    RE = RegExp,
+    Y = YAHOO.util;
+
+Y.Dom.Color = {
+    KEYWORDS: {
+        black: '000',
+        silver: 'c0c0c0',
+        gray: '808080',
+        white: 'fff',
+        maroon: '800000',
+        red: 'f00',
+        purple: '800080',
+        fuchsia: 'f0f',
+        green: '008000',
+        lime: '0f0',
+        olive: '808000',
+        yellow: 'ff0',
+        navy: '000080',
+        blue: '00f',
+        teal: '008080',
+        aqua: '0ff'
+    },
+
+    re_RGB: /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
+    re_hex: /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
+    re_hex3: /([0-9A-F])/gi,
+
+    toRGB: function(val) {
+        if (!Y.Dom.Color.re_RGB.test(val)) {
+            val = Y.Dom.Color.toHex(val);
+        }
+
+        if(Y.Dom.Color.re_hex.exec(val)) {
+            val = 'rgb(' + [
+                PARSE_INT(RE.$1, 16),
+                PARSE_INT(RE.$2, 16),
+                PARSE_INT(RE.$3, 16)
+            ].join(', ') + ')';
+        }
+        return val;
+    },
+
+    toHex: function(val) {
+        val = Y.Dom.Color.KEYWORDS[val] || val;
+        if (Y.Dom.Color.re_RGB.exec(val)) {
+            var r = (RE.$1.length === 1) ? '0' + RE.$1 : Number(RE.$1),
+                g = (RE.$2.length === 1) ? '0' + RE.$2 : Number(RE.$2),
+                b = (RE.$3.length === 1) ? '0' + RE.$3 : Number(RE.$3);
+
+            val = [
+                r[TO_STRING](16),
+                g[TO_STRING](16),
+                b[TO_STRING](16)
+            ].join('');
+        }
+
+        if (val.length < 6) {
+            val = val.replace(Y.Dom.Color.re_hex3, '$1$1');
+        }
+
+        if (val !== 'transparent' && val.indexOf('#') < 0) {
+            val = '#' + val;
+        }
+
+        return val.toLowerCase();
+    }
+};
+}());
+YAHOO.register("dom", YAHOO.util.Dom, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/yahoo/yahoo.js
===================================================================
--- branches/2.8.x/wb/include/yui/yahoo/yahoo.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/yahoo/yahoo.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 /**
  * The YAHOO object is the single global object used by YUI Library.  It
@@ -88,6 +88,15 @@
  * </pre>
  * This fails because "long" is a future reserved word in ECMAScript
  *
+ * For implementation code that uses YUI, do not create your components
+ * in the namespaces defined by YUI (
+ * <code>YAHOO.util</code>, 
+ * <code>YAHOO.widget</code>, 
+ * <code>YAHOO.lang</code>, 
+ * <code>YAHOO.tool</code>, 
+ * <code>YAHOO.example</code>, 
+ * <code>YAHOO.env</code>) -- create your own namespace (e.g., 'companyname').
+ *
  * @method namespace
  * @static
  * @param  {String*} arguments 1-n namespaces to create 
@@ -96,7 +105,7 @@
 YAHOO.namespace = function() {
     var a=arguments, o=null, i, j, d;
     for (i=0; i<a.length; i=i+1) {
-        d=a[i].split(".");
+        d=(""+a[i]).split(".");
         o=YAHOO;
 
         // YAHOO is implied, so it is ignored if it is included
@@ -146,11 +155,20 @@
  *                             and a "build" property at minimum.
  */
 YAHOO.register = function(name, mainClass, data) {
-    var mods = YAHOO.env.modules;
+    var mods = YAHOO.env.modules, m, v, b, ls, i;
+
     if (!mods[name]) {
-        mods[name] = { versions:[], builds:[] };
+        mods[name] = { 
+            versions:[], 
+            builds:[] 
+        };
     }
-    var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;
+
+    m  = mods[name];
+    v  = data.version;
+    b  = data.build;
+    ls = YAHOO.env.listeners;
+
     m.name = name;
     m.version = v;
     m.build = b;
@@ -157,8 +175,9 @@
     m.versions.push(v);
     m.builds.push(b);
     m.mainClass = mainClass;
+
     // fire the module load listeners
-    for (var i=0;i<ls.length;i=i+1) {
+    for (i=0;i<ls.length;i=i+1) {
         ls[i](m);
     }
     // label the main class
@@ -231,14 +250,24 @@
  * @static
  */
 YAHOO.env.ua = function() {
-    var o={
 
+        var numberfy = function(s) {
+            var c = 0;
+            return parseFloat(s.replace(/\./g, function() {
+                return (c++ == 1) ? '' : '.';
+            }));
+        },
+
+        nav = navigator,
+
+        o = {
+
         /**
          * Internet Explorer version number or 0.  Example: 6
          * @property ie
          * @type float
          */
-        ie:0,
+        ie: 0,
 
         /**
          * Opera version number or 0.  Example: 9.2
@@ -245,7 +274,7 @@
          * @property opera
          * @type float
          */
-        opera:0,
+        opera: 0,
 
         /**
          * Gecko engine revision number.  Will evaluate to 1 if Gecko 
@@ -260,7 +289,7 @@
          * @property gecko
          * @type float
          */
-        gecko:0,
+        gecko: 0,
 
         /**
          * AppleWebKit version.  KHTML browsers that are not WebKit browsers 
@@ -272,9 +301,18 @@
          * Safari 2.0.4:         418     <-- preventDefault fixed
          * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
          *                                   different versions of webkit
-         * Safari 2.0.4 (419.3): 419     <-- Current Safari release
-         * Webkit 212 nightly:   522+    <-- Safari 3.0 (with native SVG) should
-         *                                   be higher than this
+         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
+         *                                   updated, but not updated
+         *                                   to the latest patch.
+         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native SVG
+         *                                   and many major issues fixed).  
+         * 3.x yahoo.com, flickr:422     <-- Safari 3.x hacks the user agent
+         *                                   string when hitting yahoo.com and 
+         *                                   flickr.com.
+         * Safari 3.0.4 (523.12):523.12  <-- First Tiger release - automatic update
+         *                                   from 2.x via the 10.4.11 OS patch
+         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event.
+         *                                   yahoo.com user agent hack removed.
          *                                   
          * </pre>
          * http://developer.apple.com/internet/safari/uamatrix.html
@@ -281,7 +319,7 @@
          * @property webkit
          * @type float
          */
-        webkit:0,
+        webkit: 0,
 
         /**
          * The mobile property will be set to a string containing any relevant
@@ -291,58 +329,113 @@
          * @property mobile 
          * @type string
          */
-        mobile: null 
-    };
+        mobile: null,
 
-    var ua=navigator.userAgent, m;
+        /**
+         * Adobe AIR version number or 0.  Only populated if webkit is detected.
+         * Example: 1.0
+         * @property air
+         * @type float
+         */
+        air: 0,
 
-    // Modern KHTML browsers should qualify as Safari X-Grade
-    if ((/KHTML/).test(ua)) {
-        o.webkit=1;
-    }
-    // Modern WebKit browsers are at least X-Grade
-    m=ua.match(/AppleWebKit\/([^\s]*)/);
-    if (m&&m[1]) {
-        o.webkit=parseFloat(m[1]);
+        /**
+         * Google Caja version number or 0.
+         * @property caja
+         * @type float
+         */
+        caja: nav.cajaVersion,
 
-        // Mobile browser check
-        if (/ Mobile\//.test(ua)) {
-            o.mobile = "Apple"; // iPhone or iPod Touch
-        } else {
-            m=ua.match(/NokiaN[^\/]*/);
-            if (m) {
-                o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
-            }
+        /**
+         * Set to true if the page appears to be in SSL
+         * @property secure
+         * @type boolean
+         * @static
+         */
+        secure: false,
+
+        /**
+         * The operating system.  Currently only detecting windows or macintosh
+         * @property os
+         * @type string
+         * @static
+         */
+        os: null
+
+    },
+
+    ua = navigator && navigator.userAgent, 
+    
+    loc = window && window.location,
+
+    href = loc && loc.href,
+    
+    m;
+
+    o.secure = href && (href.toLowerCase().indexOf("https") === 0);
+
+    if (ua) {
+
+        if ((/windows|win32/i).test(ua)) {
+            o.os = 'windows';
+        } else if ((/macintosh/i).test(ua)) {
+            o.os = 'macintosh';
         }
+    
+        // Modern KHTML browsers should qualify as Safari X-Grade
+        if ((/KHTML/).test(ua)) {
+            o.webkit=1;
+        }
 
-    }
+        // Modern WebKit browsers are at least X-Grade
+        m=ua.match(/AppleWebKit\/([^\s]*)/);
+        if (m&&m[1]) {
+            o.webkit=numberfy(m[1]);
 
-    if (!o.webkit) { // not webkit
-        // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
-        m=ua.match(/Opera[\s\/]([^\s]*)/);
-        if (m&&m[1]) {
-            o.opera=parseFloat(m[1]);
-            m=ua.match(/Opera Mini[^;]*/);
+            // Mobile browser check
+            if (/ Mobile\//.test(ua)) {
+                o.mobile = "Apple"; // iPhone or iPod Touch
+            } else {
+                m=ua.match(/NokiaN[^\/]*/);
+                if (m) {
+                    o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
+                }
+            }
+
+            m=ua.match(/AdobeAIR\/([^\s]*)/);
             if (m) {
-                o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+                o.air = m[0]; // Adobe AIR 1.0 or better
             }
-        } else { // not opera or webkit
-            m=ua.match(/MSIE\s([^;]*)/);
+
+        }
+
+        if (!o.webkit) { // not webkit
+            // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
+            m=ua.match(/Opera[\s\/]([^\s]*)/);
             if (m&&m[1]) {
-                o.ie=parseFloat(m[1]);
-            } else { // not opera, webkit, or ie
-                m=ua.match(/Gecko\/([^\s]*)/);
+                o.opera=numberfy(m[1]);
+                m=ua.match(/Opera Mini[^;]*/);
                 if (m) {
-                    o.gecko=1; // Gecko detected, look for revision
-                    m=ua.match(/rv:([^\s\)]*)/);
-                    if (m&&m[1]) {
-                        o.gecko=parseFloat(m[1]);
+                    o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+                }
+            } else { // not opera or webkit
+                m=ua.match(/MSIE\s([^;]*)/);
+                if (m&&m[1]) {
+                    o.ie=numberfy(m[1]);
+                } else { // not opera, webkit, or ie
+                    m=ua.match(/Gecko\/([^\s]*)/);
+                    if (m) {
+                        o.gecko=1; // Gecko detected, look for revision
+                        m=ua.match(/rv:([^\s\)]*)/);
+                        if (m&&m[1]) {
+                            o.gecko=numberfy(m[1]);
+                        }
                     }
                 }
             }
         }
     }
-    
+
     return o;
 }();
 
@@ -356,18 +449,20 @@
  */
 (function() {
     YAHOO.namespace("util", "widget", "example");
+    /*global YAHOO_config*/
     if ("undefined" !== typeof YAHOO_config) {
-        var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
+        var l=YAHOO_config.listener, ls=YAHOO.env.listeners,unique=true, i;
         if (l) {
             // if YAHOO is loaded multiple times we need to check to see if
             // this is a new config object.  If it is, add the new component
             // load listener to the stack
-            for (i=0;i<ls.length;i=i+1) {
-                if (ls[i]==l) {
-                    unique=false;
+            for (i=0; i<ls.length; i++) {
+                if (ls[i] == l) {
+                    unique = false;
                     break;
                 }
             }
+
             if (unique) {
                 ls.push(l);
             }
@@ -378,25 +473,32 @@
  * Provides the language utilites and extensions used by the library
  * @class YAHOO.lang
  */
-YAHOO.lang = YAHOO.lang || {
+YAHOO.lang = YAHOO.lang || {};
+
+(function() {
+
+
+var L = YAHOO.lang,
+
+    OP = Object.prototype,
+    ARRAY_TOSTRING = '[object Array]',
+    FUNCTION_TOSTRING = '[object Function]',
+    OBJECT_TOSTRING = '[object Object]',
+    NOTHING = [],
+
+    // ADD = ["toString", "valueOf", "hasOwnProperty"],
+    ADD = ["toString", "valueOf"],
+
+    OB = {
+
     /**
-     * Determines whether or not the provided object is an array.
-     * Testing typeof/instanceof/constructor of arrays across frame 
-     * boundaries isn't possible in Safari unless you have a reference
-     * to the other frame to test against its Array prototype.  To
-     * handle this case, we test well-known array properties instead.
-     * properties.
+     * Determines wheather or not the provided object is an array.
      * @method isArray
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isArray: function(o) { 
-
-        if (o) {
-           var l = YAHOO.lang;
-           return l.isNumber(o.length) && l.isFunction(o.splice);
-        }
-        return false;
+        return OP.toString.apply(o) === ARRAY_TOSTRING;
     },
 
     /**
@@ -403,7 +505,7 @@
      * Determines whether or not the provided object is a boolean
      * @method isBoolean
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isBoolean: function(o) {
         return typeof o === 'boolean';
@@ -410,13 +512,24 @@
     },
     
     /**
-     * Determines whether or not the provided object is a function
+     * Determines whether or not the provided object is a function.
+     * Note: Internet Explorer thinks certain functions are objects:
+     *
+     * var obj = document.createElement("object");
+     * YAHOO.lang.isFunction(obj.getAttribute) // reports false in IE
+     *
+     * var input = document.createElement("input"); // append to body
+     * YAHOO.lang.isFunction(input.focus) // reports false in IE
+     *
+     * You will have to implement additional tests if these functions
+     * matter to you.
+     *
      * @method isFunction
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isFunction: function(o) {
-        return typeof o === 'function';
+        return (typeof o === 'function') || OP.toString.apply(o) === FUNCTION_TOSTRING;
     },
         
     /**
@@ -423,7 +536,7 @@
      * Determines whether or not the provided object is null
      * @method isNull
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isNull: function(o) {
         return o === null;
@@ -433,7 +546,7 @@
      * Determines whether or not the provided object is a legal number
      * @method isNumber
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isNumber: function(o) {
         return typeof o === 'number' && isFinite(o);
@@ -444,10 +557,10 @@
      * or function
      * @method isObject
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */  
     isObject: function(o) {
-return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
+return (o && (typeof o === 'object' || L.isFunction(o))) || false;
     },
         
     /**
@@ -454,7 +567,7 @@
      * Determines whether or not the provided object is a string
      * @method isString
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isString: function(o) {
         return typeof o === 'string';
@@ -464,40 +577,12 @@
      * Determines whether or not the provided object is undefined
      * @method isUndefined
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isUndefined: function(o) {
         return typeof o === '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:
-     * <pre>
-     * 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
-     * </pre>
-     * @method hasOwnProperty
-     * @param {any} o The object being testing
-     * @return Boolean
-     */
-    hasOwnProperty: function(o, prop) {
-        if (Object.prototype.hasOwnProperty) {
-            return o.hasOwnProperty(prop);
-        }
-        
-        return !YAHOO.lang.isUndefined(o[prop]) && 
-                o.constructor.prototype[prop] !== o[prop];
-    },
  
     /**
      * IE will not enumerate native functions in a derived object even if the
@@ -509,17 +594,18 @@
      * @static
      * @private
      */
-    _IEEnumFix: function(r, s) {
-        if (YAHOO.env.ua.ie) {
-            var add=["toString", "valueOf"], i;
-            for (i=0;i<add.length;i=i+1) {
-                var fname=add[i],f=s[fname];
-                if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
+    _IEEnumFix: (YAHOO.env.ua.ie) ? function(r, s) {
+            var i, fname, f;
+            for (i=0;i<ADD.length;i=i+1) {
+
+                fname = ADD[i];
+                f = s[fname];
+
+                if (L.isFunction(f) && f!=OP[fname]) {
                     r[fname]=f;
                 }
             }
-        }
-    },
+    } : function(){},
        
     /**
      * Utility to set up the prototype, constructor and superclass properties to
@@ -537,24 +623,26 @@
      */
     extend: function(subc, superc, overrides) {
         if (!superc||!subc) {
-            throw new Error("YAHOO.lang.extend failed, please check that " +
+            throw new Error("extend failed, please check that " +
                             "all dependencies are included.");
         }
-        var F = function() {};
+        var F = function() {}, i;
         F.prototype=superc.prototype;
         subc.prototype=new F();
         subc.prototype.constructor=subc;
         subc.superclass=superc.prototype;
-        if (superc.prototype.constructor == Object.prototype.constructor) {
+        if (superc.prototype.constructor == OP.constructor) {
             superc.prototype.constructor=superc;
         }
     
         if (overrides) {
-            for (var i in overrides) {
-                subc.prototype[i]=overrides[i];
+            for (i in overrides) {
+                if (L.hasOwnProperty(overrides, i)) {
+                    subc.prototype[i]=overrides[i];
+                }
             }
 
-            YAHOO.lang._IEEnumFix(subc.prototype, overrides);
+            L._IEEnumFix(subc.prototype, overrides);
         }
     },
    
@@ -584,19 +672,19 @@
         if (!s||!r) {
             throw new Error("Absorb failed, verify dependencies.");
         }
-        var a=arguments, i, p, override=a[2];
-        if (override && override!==true) { // only absorb the specified properties
+        var a=arguments, i, p, overrideList=a[2];
+        if (overrideList && overrideList!==true) { // only absorb the specified properties
             for (i=2; i<a.length; i=i+1) {
                 r[a[i]] = s[a[i]];
             }
         } else { // take everything, overwriting only if the third parameter is true
             for (p in s) { 
-                if (override || !r[p]) {
+                if (overrideList || !(p in r)) {
                     r[p] = s[p];
                 }
             }
             
-            YAHOO.lang._IEEnumFix(r, s);
+            L._IEEnumFix(r, s);
         }
     },
  
@@ -619,11 +707,11 @@
             throw new Error("Augment failed, verify dependencies.");
         }
         //var a=[].concat(arguments);
-        var a=[r.prototype,s.prototype];
-        for (var i=2;i<arguments.length;i=i+1) {
+        var a=[r.prototype,s.prototype], i;
+        for (i=2;i<arguments.length;i=i+1) {
             a.push(arguments[i]);
         }
-        YAHOO.lang.augmentObject.apply(this, a);
+        L.augmentObject.apply(this, a);
     },
 
       
@@ -639,7 +727,7 @@
      * @return {String} the dump result
      */
     dump: function(o, d) {
-        var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
+        var i,len,s=[],OBJ="{...}",FUN="f(){...}",
             COMMA=', ', ARROW=' => ';
 
         // Cast non-objects to string
@@ -646,23 +734,23 @@
         // Skip dates because the std toString is what we want
         // Skip HTMLElement-like objects because trying to dump 
         // an element will cause an unhandled exception in FF 2.x
-        if (!l.isObject(o)) {
+        if (!L.isObject(o)) {
             return o + "";
         } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
             return o;
-        } else if  (l.isFunction(o)) {
+        } else if  (L.isFunction(o)) {
             return FUN;
         }
 
         // dig into child objects the depth specifed. Default 3
-        d = (l.isNumber(d)) ? d : 3;
+        d = (L.isNumber(d)) ? d : 3;
 
         // arrays [1, 2, 3]
-        if (l.isArray(o)) {
+        if (L.isArray(o)) {
             s.push("[");
             for (i=0,len=o.length;i<len;i=i+1) {
-                if (l.isObject(o[i])) {
-                    s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                if (L.isObject(o[i])) {
+                    s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
                 } else {
                     s.push(o[i]);
                 }
@@ -676,10 +764,10 @@
         } else {
             s.push("{");
             for (i in o) {
-                if (l.hasOwnProperty(o, i)) {
+                if (L.hasOwnProperty(o, i)) {
                     s.push(i + ARROW);
-                    if (l.isObject(o[i])) {
-                        s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                    if (L.isObject(o[i])) {
+                        s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
                     } else {
                         s.push(o[i]);
                     }
@@ -719,8 +807,9 @@
      * @return {String} the substituted string
      */
     substitute: function (s, o, f) {
-        var i, j, k, key, v, meta, l=YAHOO.lang, saved=[], token, 
-            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}';
+        var i, j, k, key, v, meta, saved=[], token, 
+            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}',
+            dump, objstr;
 
 
         for (;;) {
@@ -751,27 +840,29 @@
                 v = f(key, v, meta);
             }
 
-            if (l.isObject(v)) {
-                if (l.isArray(v)) {
-                    v = l.dump(v, parseInt(meta, 10));
+            if (L.isObject(v)) {
+                if (L.isArray(v)) {
+                    v = L.dump(v, parseInt(meta, 10));
                 } else {
                     meta = meta || "";
 
                     // look for the keyword 'dump', if found force obj dump
-                    var dump = meta.indexOf(DUMP);
+                    dump = meta.indexOf(DUMP);
                     if (dump > -1) {
                         meta = meta.substring(4);
                     }
 
+                    objstr = v.toString();
+
                     // use the toString if it is not the Object toString 
                     // and the 'dump' meta info was not found
-                    if (v.toString===Object.prototype.toString||dump>-1) {
-                        v = l.dump(v, parseInt(meta, 10));
+                    if (objstr === OBJECT_TOSTRING || dump > -1) {
+                        v = L.dump(v, parseInt(meta, 10));
                     } else {
-                        v = v.toString();
+                        v = objstr;
                     }
                 }
-            } else if (!l.isString(v) && !l.isNumber(v)) {
+            } else if (!L.isString(v) && !L.isNumber(v)) {
                 // This {block} has no replace string. Save it for later.
                 v = "~-" + saved.length + "-~";
                 saved[saved.length] = token;
@@ -819,15 +910,15 @@
      * @return the new merged object
      */
     merge: function() {
-        var o={}, a=arguments;
-        for (var i=0, l=a.length; i<l; i=i+1) {
-            YAHOO.lang.augmentObject(o, a[i], true);
+        var o={}, a=arguments, l=a.length, i;
+        for (i=0; i<l; i=i+1) {
+            L.augmentObject(o, a[i], true);
         }
         return o;
     },
 
     /**
-     * Executes the supplied function in the scope of the supplied 
+     * Executes the supplied function in the context of the supplied 
      * object 'when' milliseconds later.  Executes the function a 
      * single time unless periodic is set to true.
      * @method later
@@ -834,7 +925,7 @@
      * @since 2.4.0
      * @param when {int} the number of milliseconds to wait until the fn 
      * is executed
-     * @param o the scope object
+     * @param o the context object
      * @param fn {Function|String} the function to execute or the name of 
      * the method in the 'o' object to execute
      * @param data [Array] data that is provided to the function.  This accepts
@@ -852,7 +943,7 @@
         o = o || {};
         var m=fn, d=data, f, r;
 
-        if (YAHOO.lang.isString(fn)) {
+        if (L.isString(fn)) {
             m = o[fn];
         }
 
@@ -860,12 +951,12 @@
             throw new TypeError("method undefined");
         }
 
-        if (!YAHOO.lang.isArray(d)) {
+        if (d && !L.isArray(d)) {
             d = [data];
         }
 
         f = function() {
-            m.apply(o, d);
+            m.apply(o, d || NOTHING);
         };
 
         r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
@@ -881,7 +972,7 @@
             }
         };
     },
-
+    
     /**
      * A convenience method for detecting a legitimate non-null value.
      * Returns false for null/undefined/NaN, true for other values, 
@@ -893,17 +984,48 @@
      */
     isValue: function(o) {
         // return (o || o === false || o === 0 || o === ''); // Infinity fails
-        var l = YAHOO.lang;
-return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
+return (L.isObject(o) || L.isString(o) || L.isNumber(o) || L.isBoolean(o));
     }
 
 };
 
+/**
+ * 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:
+ * <pre>
+ * 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
+ * </pre>
+ * @method hasOwnProperty
+ * @param {any} o The object being testing
+ * @param prop {string} the name of the property to test
+ * @return {boolean} the result
+ */
+L.hasOwnProperty = (OP.hasOwnProperty) ?
+    function(o, prop) {
+        return o && o.hasOwnProperty(prop);
+    } : function(o, prop) {
+        return !L.isUndefined(o[prop]) && 
+                o.constructor.prototype[prop] !== o[prop];
+    };
+
+// new lang wins
+OB.augmentObject(L, OB, true);
+
 /*
  * An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
  * @class YAHOO.util.Lang
  */
-YAHOO.util.Lang = YAHOO.lang;
+YAHOO.util.Lang = L;
  
 /**
  * Same as YAHOO.lang.augmentObject, except it only applies prototype 
@@ -921,7 +1043,7 @@
  *        be applied and will overwrite an existing property in
  *        the receiver
  */
-YAHOO.lang.augment = YAHOO.lang.augmentProto;
+L.augment = L.augmentProto;
 
 /**
  * An alias for <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
@@ -935,7 +1057,7 @@
  *        in the supplier will be used unless it would
  *        overwrite an existing property in the receiver
  */
-YAHOO.augment = YAHOO.lang.augmentProto;
+YAHOO.augment = L.augmentProto;
        
 /**
  * An alias for <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
@@ -947,6 +1069,7 @@
  *        subclass prototype.  These will override the
  *        matching items obtained from the superclass if present.
  */
-YAHOO.extend = YAHOO.lang.extend;
+YAHOO.extend = L.extend;
 
-YAHOO.register("yahoo", YAHOO, {version: "2.4.1", build: "742"});
+})();
+YAHOO.register("yahoo", YAHOO, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/yahoo/yahoo-min.js
===================================================================
--- branches/2.8.x/wb/include/yui/yahoo/yahoo-min.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/yahoo/yahoo-min.js	(revision 1263)
@@ -1,7 +1,7 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
-if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(B){if(B){var A=YAHOO.lang;return A.isNumber(B.length)&&A.isFunction(B.splice);}return false;},isBoolean:function(A){return typeof A==="boolean";},isFunction:function(A){return typeof A==="function";},isNull:function(A){return A===null;},isNumber:function(A){return typeof A==="number"&&isFinite(A);},isObject:function(A){return(A&&(typeof A==="object"||YAHOO.lang.isFunction(A)))||false;},isString:function(A){return typeof A==="string";},isUndefined:function(A){return typeof A==="undefined";},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B);}return !YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B];},_IEEnumFix:function(C,B){if(YAHOO.env.ua.ie){var E=["toString","valueOf"],A;for(A=0;A<E.length;A=A+1){var F=E[A],D=B[F];if(YAHOO.lang.isFunction(D)&&D!=Object.prototype[F]){C[F]=D;}}}},extend:function(D,E,C){if(!E||!D){throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");}var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E;}if(C){for(var A in C){D.prototype[A]=C[A];}YAHOO.lang._IEEnumFix(D.prototype,C);}},augmentObject:function(E,D){if(!D||!E){throw new Error("Absorb failed, verify dependencies.");}var A=arguments,C,F,B=A[2];if(B&&B!==true){for(C=2;C<A.length;C=C+1){E[A[C]]=D[A[C]];}}else{for(F in D){if(B||!E[F]){E[F]=D[F];}}YAHOO.lang._IEEnumFix(E,D);}},augmentProto:function(D,C){if(!C||!D){throw new Error("Augment failed, verify dependencies.");}var A=[D.prototype,C.prototype];for(var B=2;B<arguments.length;B=B+1){A.push(arguments[B]);}YAHOO.lang.augmentObject.apply(this,A);},dump:function(A,G){var C=YAHOO.lang,D,F,I=[],J="{...}",B="f(){...}",H=", ",E=" => ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D<F;D=D+1){if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C<A;C=C+1){YAHOO.lang.augmentObject(D,B[C],true);}return D;},later:function(H,B,I,D,E){H=H||0;B=B||{};var C=I,G=D,F,A;if(YAHOO.lang.isString(I)){C=B[I];}if(!C){throw new TypeError("method undefined");}if(!YAHOO.lang.isArray(G)){G=[D];}F=function(){C.apply(B,G);};A=(E)?setInterval(F,H):setTimeout(F,H);return{interval:E,cancel:function(){if(this.interval){clearInterval(A);}else{clearTimeout(A);}}};},isValue:function(B){var A=YAHOO.lang;return(A.isObject(B)||A.isString(B)||A.isNumber(B)||A.isBoolean(B));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.4.1",build:"742"});
\ No newline at end of file
+if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var D=function(H){var I=0;return parseFloat(H.replace(/\./g,function(){return(I++==1)?"":".";}));},G=navigator,F={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:G.cajaVersion,secure:false,os:null},C=navigator&&navigator.userAgent,E=window&&window.location,B=E&&E.href,A;F.secure=B&&(B.toLowerCase().indexOf("https")===0);if(C){if((/windows|win32/i).test(C)){F.os="windows";}else{if((/macintosh/i).test(C)){F.os="macintosh";}}if((/KHTML/).test(C)){F.webkit=1;}A=C.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){F.webkit=D(A[1]);if(/ Mobile\//.test(C)){F.mobile="Apple";}else{A=C.match(/NokiaN[^\/]*/);if(A){F.mobile=A[0];}}A=C.match(/AdobeAIR\/([^\s]*)/);if(A){F.air=A[0];}}if(!F.webkit){A=C.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){F.opera=D(A[1]);A=C.match(/Opera Mini[^;]*/);if(A){F.mobile=A[0];}}else{A=C.match(/MSIE\s([^;]*)/);if(A&&A[1]){F.ie=D(A[1]);}else{A=C.match(/Gecko\/([^\s]*)/);if(A){F.gecko=1;A=C.match(/rv:([^\s\)]*)/);if(A&&A[1]){F.gecko=D(A[1]);}}}}}}return F;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C++){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,A=Object.prototype,H="[object Array]",C="[object Function]",G="[object Object]",E=[],F=["toString","valueOf"],D={isArray:function(I){return A.toString.apply(I)===H;},isBoolean:function(I){return typeof I==="boolean";},isFunction:function(I){return(typeof I==="function")||A.toString.apply(I)===C;},isNull:function(I){return I===null;},isNumber:function(I){return typeof I==="number"&&isFinite(I);},isObject:function(I){return(I&&(typeof I==="object"||B.isFunction(I)))||false;},isString:function(I){return typeof I==="string";},isUndefined:function(I){return typeof I==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(K,J){var I,M,L;for(I=0;I<F.length;I=I+1){M=F[I];L=J[M];if(B.isFunction(L)&&L!=A[M]){K[M]=L;}}}:function(){},extend:function(L,M,K){if(!M||!L){throw new Error("extend failed, please check that "+"all dependencies are included.");}var J=function(){},I;J.prototype=M.prototype;L.prototype=new J();L.prototype.constructor=L;L.superclass=M.prototype;if(M.prototype.constructor==A.constructor){M.prototype.constructor=M;}if(K){for(I in K){if(B.hasOwnProperty(K,I)){L.prototype[I]=K[I];}}B._IEEnumFix(L.prototype,K);}},augmentObject:function(M,L){if(!L||!M){throw new Error("Absorb failed, verify dependencies.");}var I=arguments,K,N,J=I[2];if(J&&J!==true){for(K=2;K<I.length;K=K+1){M[I[K]]=L[I[K]];}}else{for(N in L){if(J||!(N in M)){M[N]=L[N];}}B._IEEnumFix(M,L);}},augmentProto:function(L,K){if(!K||!L){throw new Error("Augment failed, verify dependencies.");}var I=[L.prototype,K.prototype],J;for(J=2;J<arguments.length;J=J+1){I.push(arguments[J]);}B.augmentObject.apply(this,I);},dump:function(I,N){var K,M,P=[],Q="{...}",J="f(){...}",O=", ",L=" => ";if(!B.isObject(I)){return I+"";}else{if(I instanceof Date||("nodeType" in I&&"tagName" in I)){return I;}else{if(B.isFunction(I)){return J;}}}N=(B.isNumber(N))?N:3;if(B.isArray(I)){P.push("[");for(K=0,M=I.length;K<M;K=K+1){if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}if(P.length>1){P.pop();}P.push("]");}else{P.push("{");for(K in I){if(B.hasOwnProperty(I,K)){P.push(K+L);if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}}if(P.length>1){P.pop();}P.push("}");}return P.join("");},substitute:function(Y,J,R){var N,M,L,U,V,X,T=[],K,O="dump",S=" ",I="{",W="}",Q,P;for(;;){N=Y.lastIndexOf(I);if(N<0){break;}M=Y.indexOf(W,N);if(N+1>=M){break;}K=Y.substring(N+1,M);U=K;X=null;L=U.indexOf(S);if(L>-1){X=U.substring(L+1);U=U.substring(0,L);}V=J[U];if(R){V=R(U,V,X);}if(B.isObject(V)){if(B.isArray(V)){V=B.dump(V,parseInt(X,10));}else{X=X||"";Q=X.indexOf(O);if(Q>-1){X=X.substring(4);}P=V.toString();if(P===G||Q>-1){V=B.dump(V,parseInt(X,10));}else{V=P;}}}else{if(!B.isString(V)&&!B.isNumber(V)){V="~-"+T.length+"-~";T[T.length]=K;}}Y=Y.substring(0,N)+V+Y.substring(M+1);}for(N=T.length-1;N>=0;N=N-1){Y=Y.replace(new RegExp("~-"+N+"-~"),"{"+T[N]+"}","g");}return Y;},trim:function(I){try{return I.replace(/^\s+|\s+$/g,"");}catch(J){return I;}},merge:function(){var L={},J=arguments,I=J.length,K;for(K=0;K<I;K=K+1){B.augmentObject(L,J[K],true);}return L;},later:function(P,J,Q,L,M){P=P||0;J=J||{};var K=Q,O=L,N,I;if(B.isString(Q)){K=J[Q];}if(!K){throw new TypeError("method undefined");}if(O&&!B.isArray(O)){O=[L];}N=function(){K.apply(J,O||E);};I=(M)?setInterval(N,P):setTimeout(N,P);return{interval:M,cancel:function(){if(this.interval){clearInterval(I);}else{clearTimeout(I);}}};},isValue:function(I){return(B.isObject(I)||B.isString(I)||B.isNumber(I)||B.isBoolean(I));}};B.hasOwnProperty=(A.hasOwnProperty)?function(I,J){return I&&I.hasOwnProperty(J);}:function(I,J){return !B.isUndefined(I[J])&&I.constructor.prototype[J]!==I[J];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.8.0r4",build:"2449"});
Index: branches/2.8.x/wb/include/yui/yahoo/index.php
===================================================================
--- branches/2.8.x/wb/include/yui/yahoo/index.php	(revision 1262)
+++ branches/2.8.x/wb/include/yui/yahoo/index.php	(revision 1263)
@@ -1,28 +1,55 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-header("Location: ../../../index.php");
-
+<?php
+/*
+*
+*                       About WebsiteBaker
+*
+* Website Baker is a PHP-based Content Management System (CMS)
+* designed with one goal in mind: to enable its users to produce websites
+* with ease.
+*
+*                       LICENSE INFORMATION
+*
+* WebsiteBaker is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* WebsiteBaker is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*
+*                   WebsiteBaker Extra Information
+*
+*
+*/
+/**
+ *
+ * @category        backend
+ * @package         yui
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @filesource		$HeadURL$
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ *
+ * @author          WebsiteBaker Project
+ * @link			http://www.websitebaker2.org/
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @link			http://start.websitebaker2.org/impressum-datenschutz.php
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @version         $Id$
+ * @platform        WebsiteBaker 2.8.x
+ * @requirements    PHP 4.3.4 and higher
+ * @lastmodified    $Date$
+ *
+ */
+
+header("Location: ../../../index.php");
+
 ?>
\ No newline at end of file

Property changes on: branches/2.8.x/wb/include/yui/yahoo/index.php
___________________________________________________________________
Modified: svn:keywords
## -1 +1,4 ##
-Id
\ No newline at end of property
+Id
+Revision
+HeadURL
+Date
\ No newline at end of property
Index: branches/2.8.x/wb/include/yui/yahoo/yahoo-debug.js
===================================================================
--- branches/2.8.x/wb/include/yui/yahoo/yahoo-debug.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/yahoo/yahoo-debug.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 /**
  * The YAHOO object is the single global object used by YUI Library.  It
@@ -88,6 +88,15 @@
  * </pre>
  * This fails because "long" is a future reserved word in ECMAScript
  *
+ * For implementation code that uses YUI, do not create your components
+ * in the namespaces defined by YUI (
+ * <code>YAHOO.util</code>, 
+ * <code>YAHOO.widget</code>, 
+ * <code>YAHOO.lang</code>, 
+ * <code>YAHOO.tool</code>, 
+ * <code>YAHOO.example</code>, 
+ * <code>YAHOO.env</code>) -- create your own namespace (e.g., 'companyname').
+ *
  * @method namespace
  * @static
  * @param  {String*} arguments 1-n namespaces to create 
@@ -96,7 +105,7 @@
 YAHOO.namespace = function() {
     var a=arguments, o=null, i, j, d;
     for (i=0; i<a.length; i=i+1) {
-        d=a[i].split(".");
+        d=(""+a[i]).split(".");
         o=YAHOO;
 
         // YAHOO is implied, so it is ignored if it is included
@@ -146,11 +155,20 @@
  *                             and a "build" property at minimum.
  */
 YAHOO.register = function(name, mainClass, data) {
-    var mods = YAHOO.env.modules;
+    var mods = YAHOO.env.modules, m, v, b, ls, i;
+
     if (!mods[name]) {
-        mods[name] = { versions:[], builds:[] };
+        mods[name] = { 
+            versions:[], 
+            builds:[] 
+        };
     }
-    var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;
+
+    m  = mods[name];
+    v  = data.version;
+    b  = data.build;
+    ls = YAHOO.env.listeners;
+
     m.name = name;
     m.version = v;
     m.build = b;
@@ -157,8 +175,9 @@
     m.versions.push(v);
     m.builds.push(b);
     m.mainClass = mainClass;
+
     // fire the module load listeners
-    for (var i=0;i<ls.length;i=i+1) {
+    for (i=0;i<ls.length;i=i+1) {
         ls[i](m);
     }
     // label the main class
@@ -231,14 +250,24 @@
  * @static
  */
 YAHOO.env.ua = function() {
-    var o={
 
+        var numberfy = function(s) {
+            var c = 0;
+            return parseFloat(s.replace(/\./g, function() {
+                return (c++ == 1) ? '' : '.';
+            }));
+        },
+
+        nav = navigator,
+
+        o = {
+
         /**
          * Internet Explorer version number or 0.  Example: 6
          * @property ie
          * @type float
          */
-        ie:0,
+        ie: 0,
 
         /**
          * Opera version number or 0.  Example: 9.2
@@ -245,7 +274,7 @@
          * @property opera
          * @type float
          */
-        opera:0,
+        opera: 0,
 
         /**
          * Gecko engine revision number.  Will evaluate to 1 if Gecko 
@@ -260,7 +289,7 @@
          * @property gecko
          * @type float
          */
-        gecko:0,
+        gecko: 0,
 
         /**
          * AppleWebKit version.  KHTML browsers that are not WebKit browsers 
@@ -272,9 +301,18 @@
          * Safari 2.0.4:         418     <-- preventDefault fixed
          * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
          *                                   different versions of webkit
-         * Safari 2.0.4 (419.3): 419     <-- Current Safari release
-         * Webkit 212 nightly:   522+    <-- Safari 3.0 (with native SVG) should
-         *                                   be higher than this
+         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
+         *                                   updated, but not updated
+         *                                   to the latest patch.
+         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native SVG
+         *                                   and many major issues fixed).  
+         * 3.x yahoo.com, flickr:422     <-- Safari 3.x hacks the user agent
+         *                                   string when hitting yahoo.com and 
+         *                                   flickr.com.
+         * Safari 3.0.4 (523.12):523.12  <-- First Tiger release - automatic update
+         *                                   from 2.x via the 10.4.11 OS patch
+         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event.
+         *                                   yahoo.com user agent hack removed.
          *                                   
          * </pre>
          * http://developer.apple.com/internet/safari/uamatrix.html
@@ -281,7 +319,7 @@
          * @property webkit
          * @type float
          */
-        webkit:0,
+        webkit: 0,
 
         /**
          * The mobile property will be set to a string containing any relevant
@@ -291,58 +329,113 @@
          * @property mobile 
          * @type string
          */
-        mobile: null 
-    };
+        mobile: null,
 
-    var ua=navigator.userAgent, m;
+        /**
+         * Adobe AIR version number or 0.  Only populated if webkit is detected.
+         * Example: 1.0
+         * @property air
+         * @type float
+         */
+        air: 0,
 
-    // Modern KHTML browsers should qualify as Safari X-Grade
-    if ((/KHTML/).test(ua)) {
-        o.webkit=1;
-    }
-    // Modern WebKit browsers are at least X-Grade
-    m=ua.match(/AppleWebKit\/([^\s]*)/);
-    if (m&&m[1]) {
-        o.webkit=parseFloat(m[1]);
+        /**
+         * Google Caja version number or 0.
+         * @property caja
+         * @type float
+         */
+        caja: nav.cajaVersion,
 
-        // Mobile browser check
-        if (/ Mobile\//.test(ua)) {
-            o.mobile = "Apple"; // iPhone or iPod Touch
-        } else {
-            m=ua.match(/NokiaN[^\/]*/);
-            if (m) {
-                o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
-            }
+        /**
+         * Set to true if the page appears to be in SSL
+         * @property secure
+         * @type boolean
+         * @static
+         */
+        secure: false,
+
+        /**
+         * The operating system.  Currently only detecting windows or macintosh
+         * @property os
+         * @type string
+         * @static
+         */
+        os: null
+
+    },
+
+    ua = navigator && navigator.userAgent, 
+    
+    loc = window && window.location,
+
+    href = loc && loc.href,
+    
+    m;
+
+    o.secure = href && (href.toLowerCase().indexOf("https") === 0);
+
+    if (ua) {
+
+        if ((/windows|win32/i).test(ua)) {
+            o.os = 'windows';
+        } else if ((/macintosh/i).test(ua)) {
+            o.os = 'macintosh';
         }
+    
+        // Modern KHTML browsers should qualify as Safari X-Grade
+        if ((/KHTML/).test(ua)) {
+            o.webkit=1;
+        }
 
-    }
+        // Modern WebKit browsers are at least X-Grade
+        m=ua.match(/AppleWebKit\/([^\s]*)/);
+        if (m&&m[1]) {
+            o.webkit=numberfy(m[1]);
 
-    if (!o.webkit) { // not webkit
-        // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
-        m=ua.match(/Opera[\s\/]([^\s]*)/);
-        if (m&&m[1]) {
-            o.opera=parseFloat(m[1]);
-            m=ua.match(/Opera Mini[^;]*/);
+            // Mobile browser check
+            if (/ Mobile\//.test(ua)) {
+                o.mobile = "Apple"; // iPhone or iPod Touch
+            } else {
+                m=ua.match(/NokiaN[^\/]*/);
+                if (m) {
+                    o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
+                }
+            }
+
+            m=ua.match(/AdobeAIR\/([^\s]*)/);
             if (m) {
-                o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+                o.air = m[0]; // Adobe AIR 1.0 or better
             }
-        } else { // not opera or webkit
-            m=ua.match(/MSIE\s([^;]*)/);
+
+        }
+
+        if (!o.webkit) { // not webkit
+            // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
+            m=ua.match(/Opera[\s\/]([^\s]*)/);
             if (m&&m[1]) {
-                o.ie=parseFloat(m[1]);
-            } else { // not opera, webkit, or ie
-                m=ua.match(/Gecko\/([^\s]*)/);
+                o.opera=numberfy(m[1]);
+                m=ua.match(/Opera Mini[^;]*/);
                 if (m) {
-                    o.gecko=1; // Gecko detected, look for revision
-                    m=ua.match(/rv:([^\s\)]*)/);
-                    if (m&&m[1]) {
-                        o.gecko=parseFloat(m[1]);
+                    o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+                }
+            } else { // not opera or webkit
+                m=ua.match(/MSIE\s([^;]*)/);
+                if (m&&m[1]) {
+                    o.ie=numberfy(m[1]);
+                } else { // not opera, webkit, or ie
+                    m=ua.match(/Gecko\/([^\s]*)/);
+                    if (m) {
+                        o.gecko=1; // Gecko detected, look for revision
+                        m=ua.match(/rv:([^\s\)]*)/);
+                        if (m&&m[1]) {
+                            o.gecko=numberfy(m[1]);
+                        }
                     }
                 }
             }
         }
     }
-    
+
     return o;
 }();
 
@@ -356,18 +449,20 @@
  */
 (function() {
     YAHOO.namespace("util", "widget", "example");
+    /*global YAHOO_config*/
     if ("undefined" !== typeof YAHOO_config) {
-        var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
+        var l=YAHOO_config.listener, ls=YAHOO.env.listeners,unique=true, i;
         if (l) {
             // if YAHOO is loaded multiple times we need to check to see if
             // this is a new config object.  If it is, add the new component
             // load listener to the stack
-            for (i=0;i<ls.length;i=i+1) {
-                if (ls[i]==l) {
-                    unique=false;
+            for (i=0; i<ls.length; i++) {
+                if (ls[i] == l) {
+                    unique = false;
                     break;
                 }
             }
+
             if (unique) {
                 ls.push(l);
             }
@@ -378,25 +473,32 @@
  * Provides the language utilites and extensions used by the library
  * @class YAHOO.lang
  */
-YAHOO.lang = YAHOO.lang || {
+YAHOO.lang = YAHOO.lang || {};
+
+(function() {
+
+
+var L = YAHOO.lang,
+
+    OP = Object.prototype,
+    ARRAY_TOSTRING = '[object Array]',
+    FUNCTION_TOSTRING = '[object Function]',
+    OBJECT_TOSTRING = '[object Object]',
+    NOTHING = [],
+
+    // ADD = ["toString", "valueOf", "hasOwnProperty"],
+    ADD = ["toString", "valueOf"],
+
+    OB = {
+
     /**
-     * Determines whether or not the provided object is an array.
-     * Testing typeof/instanceof/constructor of arrays across frame 
-     * boundaries isn't possible in Safari unless you have a reference
-     * to the other frame to test against its Array prototype.  To
-     * handle this case, we test well-known array properties instead.
-     * properties.
+     * Determines wheather or not the provided object is an array.
      * @method isArray
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isArray: function(o) { 
-
-        if (o) {
-           var l = YAHOO.lang;
-           return l.isNumber(o.length) && l.isFunction(o.splice);
-        }
-        return false;
+        return OP.toString.apply(o) === ARRAY_TOSTRING;
     },
 
     /**
@@ -403,7 +505,7 @@
      * Determines whether or not the provided object is a boolean
      * @method isBoolean
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isBoolean: function(o) {
         return typeof o === 'boolean';
@@ -410,13 +512,24 @@
     },
     
     /**
-     * Determines whether or not the provided object is a function
+     * Determines whether or not the provided object is a function.
+     * Note: Internet Explorer thinks certain functions are objects:
+     *
+     * var obj = document.createElement("object");
+     * YAHOO.lang.isFunction(obj.getAttribute) // reports false in IE
+     *
+     * var input = document.createElement("input"); // append to body
+     * YAHOO.lang.isFunction(input.focus) // reports false in IE
+     *
+     * You will have to implement additional tests if these functions
+     * matter to you.
+     *
      * @method isFunction
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isFunction: function(o) {
-        return typeof o === 'function';
+        return (typeof o === 'function') || OP.toString.apply(o) === FUNCTION_TOSTRING;
     },
         
     /**
@@ -423,7 +536,7 @@
      * Determines whether or not the provided object is null
      * @method isNull
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isNull: function(o) {
         return o === null;
@@ -433,7 +546,7 @@
      * Determines whether or not the provided object is a legal number
      * @method isNumber
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isNumber: function(o) {
         return typeof o === 'number' && isFinite(o);
@@ -444,10 +557,10 @@
      * or function
      * @method isObject
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */  
     isObject: function(o) {
-return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
+return (o && (typeof o === 'object' || L.isFunction(o))) || false;
     },
         
     /**
@@ -454,7 +567,7 @@
      * Determines whether or not the provided object is a string
      * @method isString
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isString: function(o) {
         return typeof o === 'string';
@@ -464,40 +577,12 @@
      * Determines whether or not the provided object is undefined
      * @method isUndefined
      * @param {any} o The object being testing
-     * @return Boolean
+     * @return {boolean} the result
      */
     isUndefined: function(o) {
         return typeof o === '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:
-     * <pre>
-     * 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
-     * </pre>
-     * @method hasOwnProperty
-     * @param {any} o The object being testing
-     * @return Boolean
-     */
-    hasOwnProperty: function(o, prop) {
-        if (Object.prototype.hasOwnProperty) {
-            return o.hasOwnProperty(prop);
-        }
-        
-        return !YAHOO.lang.isUndefined(o[prop]) && 
-                o.constructor.prototype[prop] !== o[prop];
-    },
  
     /**
      * IE will not enumerate native functions in a derived object even if the
@@ -509,17 +594,18 @@
      * @static
      * @private
      */
-    _IEEnumFix: function(r, s) {
-        if (YAHOO.env.ua.ie) {
-            var add=["toString", "valueOf"], i;
-            for (i=0;i<add.length;i=i+1) {
-                var fname=add[i],f=s[fname];
-                if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
+    _IEEnumFix: (YAHOO.env.ua.ie) ? function(r, s) {
+            var i, fname, f;
+            for (i=0;i<ADD.length;i=i+1) {
+
+                fname = ADD[i];
+                f = s[fname];
+
+                if (L.isFunction(f) && f!=OP[fname]) {
                     r[fname]=f;
                 }
             }
-        }
-    },
+    } : function(){},
        
     /**
      * Utility to set up the prototype, constructor and superclass properties to
@@ -537,24 +623,26 @@
      */
     extend: function(subc, superc, overrides) {
         if (!superc||!subc) {
-            throw new Error("YAHOO.lang.extend failed, please check that " +
+            throw new Error("extend failed, please check that " +
                             "all dependencies are included.");
         }
-        var F = function() {};
+        var F = function() {}, i;
         F.prototype=superc.prototype;
         subc.prototype=new F();
         subc.prototype.constructor=subc;
         subc.superclass=superc.prototype;
-        if (superc.prototype.constructor == Object.prototype.constructor) {
+        if (superc.prototype.constructor == OP.constructor) {
             superc.prototype.constructor=superc;
         }
     
         if (overrides) {
-            for (var i in overrides) {
-                subc.prototype[i]=overrides[i];
+            for (i in overrides) {
+                if (L.hasOwnProperty(overrides, i)) {
+                    subc.prototype[i]=overrides[i];
+                }
             }
 
-            YAHOO.lang._IEEnumFix(subc.prototype, overrides);
+            L._IEEnumFix(subc.prototype, overrides);
         }
     },
    
@@ -584,19 +672,19 @@
         if (!s||!r) {
             throw new Error("Absorb failed, verify dependencies.");
         }
-        var a=arguments, i, p, override=a[2];
-        if (override && override!==true) { // only absorb the specified properties
+        var a=arguments, i, p, overrideList=a[2];
+        if (overrideList && overrideList!==true) { // only absorb the specified properties
             for (i=2; i<a.length; i=i+1) {
                 r[a[i]] = s[a[i]];
             }
         } else { // take everything, overwriting only if the third parameter is true
             for (p in s) { 
-                if (override || !r[p]) {
+                if (overrideList || !(p in r)) {
                     r[p] = s[p];
                 }
             }
             
-            YAHOO.lang._IEEnumFix(r, s);
+            L._IEEnumFix(r, s);
         }
     },
  
@@ -619,11 +707,11 @@
             throw new Error("Augment failed, verify dependencies.");
         }
         //var a=[].concat(arguments);
-        var a=[r.prototype,s.prototype];
-        for (var i=2;i<arguments.length;i=i+1) {
+        var a=[r.prototype,s.prototype], i;
+        for (i=2;i<arguments.length;i=i+1) {
             a.push(arguments[i]);
         }
-        YAHOO.lang.augmentObject.apply(this, a);
+        L.augmentObject.apply(this, a);
     },
 
       
@@ -639,7 +727,7 @@
      * @return {String} the dump result
      */
     dump: function(o, d) {
-        var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
+        var i,len,s=[],OBJ="{...}",FUN="f(){...}",
             COMMA=', ', ARROW=' => ';
 
         // Cast non-objects to string
@@ -646,23 +734,23 @@
         // Skip dates because the std toString is what we want
         // Skip HTMLElement-like objects because trying to dump 
         // an element will cause an unhandled exception in FF 2.x
-        if (!l.isObject(o)) {
+        if (!L.isObject(o)) {
             return o + "";
         } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
             return o;
-        } else if  (l.isFunction(o)) {
+        } else if  (L.isFunction(o)) {
             return FUN;
         }
 
         // dig into child objects the depth specifed. Default 3
-        d = (l.isNumber(d)) ? d : 3;
+        d = (L.isNumber(d)) ? d : 3;
 
         // arrays [1, 2, 3]
-        if (l.isArray(o)) {
+        if (L.isArray(o)) {
             s.push("[");
             for (i=0,len=o.length;i<len;i=i+1) {
-                if (l.isObject(o[i])) {
-                    s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                if (L.isObject(o[i])) {
+                    s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
                 } else {
                     s.push(o[i]);
                 }
@@ -676,10 +764,10 @@
         } else {
             s.push("{");
             for (i in o) {
-                if (l.hasOwnProperty(o, i)) {
+                if (L.hasOwnProperty(o, i)) {
                     s.push(i + ARROW);
-                    if (l.isObject(o[i])) {
-                        s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                    if (L.isObject(o[i])) {
+                        s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
                     } else {
                         s.push(o[i]);
                     }
@@ -719,8 +807,9 @@
      * @return {String} the substituted string
      */
     substitute: function (s, o, f) {
-        var i, j, k, key, v, meta, l=YAHOO.lang, saved=[], token, 
-            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}';
+        var i, j, k, key, v, meta, saved=[], token, 
+            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}',
+            dump, objstr;
 
 
         for (;;) {
@@ -751,27 +840,29 @@
                 v = f(key, v, meta);
             }
 
-            if (l.isObject(v)) {
-                if (l.isArray(v)) {
-                    v = l.dump(v, parseInt(meta, 10));
+            if (L.isObject(v)) {
+                if (L.isArray(v)) {
+                    v = L.dump(v, parseInt(meta, 10));
                 } else {
                     meta = meta || "";
 
                     // look for the keyword 'dump', if found force obj dump
-                    var dump = meta.indexOf(DUMP);
+                    dump = meta.indexOf(DUMP);
                     if (dump > -1) {
                         meta = meta.substring(4);
                     }
 
+                    objstr = v.toString();
+
                     // use the toString if it is not the Object toString 
                     // and the 'dump' meta info was not found
-                    if (v.toString===Object.prototype.toString||dump>-1) {
-                        v = l.dump(v, parseInt(meta, 10));
+                    if (objstr === OBJECT_TOSTRING || dump > -1) {
+                        v = L.dump(v, parseInt(meta, 10));
                     } else {
-                        v = v.toString();
+                        v = objstr;
                     }
                 }
-            } else if (!l.isString(v) && !l.isNumber(v)) {
+            } else if (!L.isString(v) && !L.isNumber(v)) {
                 // This {block} has no replace string. Save it for later.
                 v = "~-" + saved.length + "-~";
                 saved[saved.length] = token;
@@ -819,15 +910,15 @@
      * @return the new merged object
      */
     merge: function() {
-        var o={}, a=arguments;
-        for (var i=0, l=a.length; i<l; i=i+1) {
-            YAHOO.lang.augmentObject(o, a[i], true);
+        var o={}, a=arguments, l=a.length, i;
+        for (i=0; i<l; i=i+1) {
+            L.augmentObject(o, a[i], true);
         }
         return o;
     },
 
     /**
-     * Executes the supplied function in the scope of the supplied 
+     * Executes the supplied function in the context of the supplied 
      * object 'when' milliseconds later.  Executes the function a 
      * single time unless periodic is set to true.
      * @method later
@@ -834,7 +925,7 @@
      * @since 2.4.0
      * @param when {int} the number of milliseconds to wait until the fn 
      * is executed
-     * @param o the scope object
+     * @param o the context object
      * @param fn {Function|String} the function to execute or the name of 
      * the method in the 'o' object to execute
      * @param data [Array] data that is provided to the function.  This accepts
@@ -852,7 +943,7 @@
         o = o || {};
         var m=fn, d=data, f, r;
 
-        if (YAHOO.lang.isString(fn)) {
+        if (L.isString(fn)) {
             m = o[fn];
         }
 
@@ -860,12 +951,12 @@
             throw new TypeError("method undefined");
         }
 
-        if (!YAHOO.lang.isArray(d)) {
+        if (d && !L.isArray(d)) {
             d = [data];
         }
 
         f = function() {
-            m.apply(o, d);
+            m.apply(o, d || NOTHING);
         };
 
         r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
@@ -881,7 +972,7 @@
             }
         };
     },
-
+    
     /**
      * A convenience method for detecting a legitimate non-null value.
      * Returns false for null/undefined/NaN, true for other values, 
@@ -893,17 +984,48 @@
      */
     isValue: function(o) {
         // return (o || o === false || o === 0 || o === ''); // Infinity fails
-        var l = YAHOO.lang;
-return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
+return (L.isObject(o) || L.isString(o) || L.isNumber(o) || L.isBoolean(o));
     }
 
 };
 
+/**
+ * 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:
+ * <pre>
+ * 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
+ * </pre>
+ * @method hasOwnProperty
+ * @param {any} o The object being testing
+ * @param prop {string} the name of the property to test
+ * @return {boolean} the result
+ */
+L.hasOwnProperty = (OP.hasOwnProperty) ?
+    function(o, prop) {
+        return o && o.hasOwnProperty(prop);
+    } : function(o, prop) {
+        return !L.isUndefined(o[prop]) && 
+                o.constructor.prototype[prop] !== o[prop];
+    };
+
+// new lang wins
+OB.augmentObject(L, OB, true);
+
 /*
  * An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
  * @class YAHOO.util.Lang
  */
-YAHOO.util.Lang = YAHOO.lang;
+YAHOO.util.Lang = L;
  
 /**
  * Same as YAHOO.lang.augmentObject, except it only applies prototype 
@@ -921,7 +1043,7 @@
  *        be applied and will overwrite an existing property in
  *        the receiver
  */
-YAHOO.lang.augment = YAHOO.lang.augmentProto;
+L.augment = L.augmentProto;
 
 /**
  * An alias for <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
@@ -935,7 +1057,7 @@
  *        in the supplier will be used unless it would
  *        overwrite an existing property in the receiver
  */
-YAHOO.augment = YAHOO.lang.augmentProto;
+YAHOO.augment = L.augmentProto;
        
 /**
  * An alias for <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
@@ -947,6 +1069,7 @@
  *        subclass prototype.  These will override the
  *        matching items obtained from the superclass if present.
  */
-YAHOO.extend = YAHOO.lang.extend;
+YAHOO.extend = L.extend;
 
-YAHOO.register("yahoo", YAHOO, {version: "2.4.1", build: "742"});
+})();
+YAHOO.register("yahoo", YAHOO, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/event/event-debug.js
===================================================================
--- branches/2.8.x/wb/include/yui/event/event-debug.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/event/event-debug.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 
 /**
@@ -11,7 +11,7 @@
  *
  * @param {String}  type The type of event, which is passed to the callback
  *                  when the event fires
- * @param {Object}  oScope The context the event will fire from.  "this" will
+ * @param {Object}  context The context the event will fire from.  "this" will
  *                  refer to this object in the callback.  Default value: 
  *                  the window object.  The listener can override this.
  * @param {boolean} silent pass true to prevent the event from writing to
@@ -20,11 +20,15 @@
  *                  will receive. YAHOO.util.CustomEvent.LIST or 
  *                  YAHOO.util.CustomEvent.FLAT.  The default is
  *                  YAHOO.util.CustomEvent.LIST.
+ * @param fireOnce {boolean} If configured to fire once, the custom event 
+ * will only notify subscribers a single time regardless of how many times 
+ * the event is fired.  In addition, new subscribers will be notified 
+ * immediately if the event has already been fired.
  * @namespace YAHOO.util
  * @class CustomEvent
  * @constructor
  */
-YAHOO.util.CustomEvent = function(type, oScope, silent, signature) {
+YAHOO.util.CustomEvent = function(type, context, silent, signature, fireOnce) {
 
     /**
      * The type of event, returned to subscribers when the event fires
@@ -34,16 +38,15 @@
     this.type = type;
 
     /**
-     * The scope the the event will fire from by default.  Defaults to the window 
-     * obj
+     * The context the event will fire from by default. Defaults to the window obj.
      * @property scope
      * @type object
      */
-    this.scope = oScope || window;
+    this.scope = context || window;
 
     /**
-     * By default all custom events are logged in the debug build, set silent
-     * to true to disable debug outpu for this event.
+     * By default all custom events are logged in the debug build. Set silent to true 
+     * to disable debug output for this event.
      * @property silent
      * @type boolean
      */
@@ -50,6 +53,33 @@
     this.silent = silent;
 
     /**
+     * If configured to fire once, the custom event will only notify subscribers
+     * a single time regardless of how many times the event is fired.  In addition,
+     * new subscribers will be notified immediately if the event has already been
+     * fired.
+     * @property fireOnce
+     * @type boolean
+     * @default false
+     */
+    this.fireOnce = fireOnce;
+
+    /**
+     * Indicates whether or not this event has ever been fired.
+     * @property fired
+     * @type boolean
+     * @default false
+     */
+    this.fired = false;
+
+    /**
+     * For fireOnce events the arguments the event was fired with are stored
+     * so that new subscribers get the proper payload.
+     * @property firedWith
+     * @type Array
+     */
+    this.firedWith = null;
+
+    /**
      * Custom events support two styles of arguments provided to the event
      * subscribers.  
      * <ul>
@@ -98,13 +128,12 @@
          *
          * @event subscribeEvent
          * @type YAHOO.util.CustomEvent
-         * @param {Function} fn The function to execute
-         * @param {Object}   obj An object to be passed along when the event 
-         *                       fires
-         * @param {boolean|Object}  override If true, the obj passed in becomes 
-         *                                   the execution scope of the listener.
-         *                                   if an object, that object becomes the
-         *                                   the execution scope.
+         * @param fn {Function} The function to execute
+         * @param obj <Object> An object to be passed along when the event fires. 
+         * Defaults to the custom event.
+         * @param override <boolean|Object> If true, the obj passed in becomes the 
+         * execution context of the listener. If an object, that object becomes 
+         * the execution context. Defaults to the custom event.
          */
         this.subscribeEvent = 
                 new YAHOO.util.CustomEvent(onsubscribeType, this, true);
@@ -148,14 +177,11 @@
      * Subscribes the caller to this event
      * @method subscribe
      * @param {Function} fn        The function to execute
-     * @param {Object}   obj       An object to be passed along when the event 
-     *                             fires
-     * @param {boolean|Object}  override If true, the obj passed in becomes 
-     *                                   the execution scope of the listener.
-     *                                   if an object, that object becomes the
-     *                                   the execution scope.
+     * @param {Object}   obj       An object to be passed along when the event fires.
+     * overrideContext <boolean|Object> If true, the obj passed in becomes the execution 
+     * context of the listener. If an object, that object becomes the execution context.
      */
-    subscribe: function(fn, obj, override) {
+    subscribe: function(fn, obj, overrideContext) {
 
         if (!fn) {
 throw new Error("Invalid callback for subscriber to '" + this.type + "'");
@@ -162,10 +188,16 @@
         }
 
         if (this.subscribeEvent) {
-            this.subscribeEvent.fire(fn, obj, override);
+            this.subscribeEvent.fire(fn, obj, overrideContext);
         }
 
-        this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, override) );
+        var s = new YAHOO.util.Subscriber(fn, obj, overrideContext);
+
+        if (this.fireOnce && this.fired) {
+            this.notify(s, this.firedWith);
+        } else {
+            this.subscribers.push(s);
+        }
     },
 
     /**
@@ -200,7 +232,7 @@
 
     /**
      * Notifies the subscribers.  The callback functions will be executed
-     * from the scope specified when the event was created, and with the 
+     * from the context specified when the event was created, and with the 
      * following parameters:
      *   <ul>
      *   <li>The type of event</li>
@@ -215,15 +247,29 @@
      *                   true otherwise
      */
     fire: function() {
-        var len=this.subscribers.length;
-        if (!len && this.silent) {
-            return true;
+
+        this.lastError = null;
+
+        var errors = [],
+            len=this.subscribers.length;
+
+
+        var args=[].slice.call(arguments, 0), ret=true, i, rebuild=false;
+
+        if (this.fireOnce) {
+            if (this.fired) {
+                YAHOO.log('fireOnce event has already fired: ' + this.type);
+                return true;
+            } else {
+                this.firedWith = args;
+            }
         }
 
-        var args=[], ret=true, i, rebuild=false;
+        this.fired = true;
 
-        for (i=0; i<arguments.length; ++i) {
-            args.push(arguments[i]);
+        if (!len && this.silent) {
+            //YAHOO.log('DEBUG no subscribers');
+            return true;
         }
 
         if (!this.silent) {
@@ -233,62 +279,69 @@
                        "info", "Event"                  );
         }
 
+        // make a copy of the subscribers so that there are
+        // no index problems if one subscriber removes another.
+        var subs = this.subscribers.slice();
+
         for (i=0; i<len; ++i) {
-            var s = this.subscribers[i];
+            var s = subs[i];
             if (!s) {
                 rebuild=true;
             } else {
-                if (!this.silent) {
-                    YAHOO.log( this.type + "->" + (i+1) + ": " +  s, 
-                                "info", "Event" );
-                }
 
-                var scope = s.getScope(this.scope);
+                ret = this.notify(s, args);
 
-                if (this.signature == YAHOO.util.CustomEvent.FLAT) {
-                    var param = null;
-                    if (args.length > 0) {
-                        param = args[0];
-                    }
-
-                    try {
-                        ret = s.fn.call(scope, param, s.obj);
-                    } catch(e) {
-                        this.lastError = e;
-                        YAHOO.log(this + " subscriber exception: " + e,
-                                  "error", "Event");
-                    }
-                } else {
-                    try {
-                        ret = s.fn.call(scope, this.type, args, s.obj);
-                    } catch(ex) {
-                        this.lastError = ex;
-                        YAHOO.log(this + " subscriber exception: " + ex,
-                                  "error", "Event");
-                    }
-                }
                 if (false === ret) {
                     if (!this.silent) {
-                        YAHOO.log("Event cancelled, subscriber " + i + 
-                                  " of " + len, "info", "Event");
+                        YAHOO.log("Event stopped, sub " + i + " of " + len, "info", "Event");
                     }
 
-                    //break;
-                    return false;
+                    break;
                 }
             }
         }
 
-        if (rebuild) {
-            var newlist=[],subs=this.subscribers;
-            for (i=0,len=subs.length; i<len; i=i+1) {
-                newlist.push(subs[i]);
+        return (ret !== false);
+    },
+
+    notify: function(s, args) {
+
+        var ret, param=null, scope = s.getScope(this.scope),
+                 throwErrors = YAHOO.util.Event.throwErrors;
+
+        if (!this.silent) {
+            YAHOO.log( this.type + "-> " + s, "info", "Event" );
+        }
+
+        if (this.signature == YAHOO.util.CustomEvent.FLAT) {
+
+            if (args.length > 0) {
+                param = args[0];
             }
 
-            this.subscribers=newlist;
+            try {
+                ret = s.fn.call(scope, param, s.obj);
+            } catch(e) {
+                this.lastError = e;
+                // errors.push(e);
+                YAHOO.log(this + " subscriber exception: " + e, "error", "Event");
+                if (throwErrors) {
+                    throw e;
+                }
+            }
+        } else {
+            try {
+                ret = s.fn.call(scope, this.type, args, s.obj);
+            } catch(ex) {
+                this.lastError = ex;
+                YAHOO.log(this + " subscriber exception: " + ex, "error", "Event");
+                if (throwErrors) {
+                    throw ex;
+                }
+            }
         }
 
-        return true;
+        return ret;
     },
 
     /**
@@ -297,13 +350,14 @@
      * @return {int} The number of listeners unsubscribed
      */
     unsubscribeAll: function() {
-        for (var i=0, len=this.subscribers.length; i<len; ++i) {
-            this._delete(len - 1 - i);
+        var l = this.subscribers.length, i;
+        for (i=l-1; i>-1; i--) {
+            this._delete(i);
         }
 
         this.subscribers=[];
 
-        return i;
+        return l;
     },
 
     /**
@@ -317,7 +371,8 @@
             delete s.obj;
         }
 
-        this.subscribers[index]=null;
+        // this.subscribers[index]=null;
+        this.subscribers.splice(index, 1);
     },
 
     /**
@@ -325,7 +380,7 @@
      */
     toString: function() {
          return "CustomEvent: " + "'" + this.type  + "', " + 
-             "scope: " + this.scope;
+             "context: " + this.scope;
 
     }
 };
@@ -336,12 +391,12 @@
  * Stores the subscriber information to be used when the event fires.
  * @param {Function} fn       The function to execute
  * @param {Object}   obj      An object to be passed along when the event fires
- * @param {boolean}  override If true, the obj passed in becomes the execution
- *                            scope of the listener
+ * @param {boolean}  overrideContext If true, the obj passed in becomes the execution
+ *                            context of the listener
  * @class Subscriber
  * @constructor
  */
-YAHOO.util.Subscriber = function(fn, obj, override) {
+YAHOO.util.Subscriber = function(fn, obj, overrideContext) {
 
     /**
      * The callback that will be execute when the event fires
@@ -359,32 +414,32 @@
     this.obj = YAHOO.lang.isUndefined(obj) ? null : obj;
 
     /**
-     * The default execution scope for the event listener is defined when the
+     * The default execution context for the event listener is defined when the
      * event is created (usually the object which contains the event).
-     * By setting override to true, the execution scope becomes the custom
-     * object passed in by the subscriber.  If override is an object, that 
-     * object becomes the scope.
-     * @property override
+     * By setting overrideContext to true, the execution context becomes the custom
+     * object passed in by the subscriber.  If overrideContext is an object, that 
+     * object becomes the context.
+     * @property overrideContext
      * @type boolean|object
      */
-    this.override = override;
+    this.overrideContext = overrideContext;
 
 };
 
 /**
- * Returns the execution scope for this listener.  If override was set to true
- * the custom obj will be the scope.  If override is an object, that is the
- * scope, otherwise the default scope will be used.
+ * Returns the execution context for this listener.  If overrideContext was set to true
+ * the custom obj will be the context.  If overrideContext is an object, that is the
+ * context, otherwise the default context will be used.
  * @method getScope
- * @param {Object} defaultScope the scope to use if this listener does not
+ * @param {Object} defaultScope the context to use if this listener does not
  *                              override it.
  */
 YAHOO.util.Subscriber.prototype.getScope = function(defaultScope) {
-    if (this.override) {
-        if (this.override === true) {
+    if (this.overrideContext) {
+        if (this.overrideContext === true) {
             return this.obj;
         } else {
-            return this.override;
+            return this.overrideContext;
         }
     }
     return defaultScope;
@@ -413,7 +468,7 @@
  */
 YAHOO.util.Subscriber.prototype.toString = function() {
     return "Subscriber { obj: " + this.obj  + 
-           ", override: " +  (this.override || "no") + " }";
+           ", overrideContext: " +  (this.overrideContext || "no") + " }";
 };
 
 /**
@@ -449,7 +504,7 @@
          * @static
          * @private
          */
-        var loadComplete =  false;
+        var loadComplete =  false,
 
         /**
          * Cache of wrapped listeners
@@ -458,8 +513,9 @@
          * @static
          * @private
          */
-        var listeners = [];
+        listeners = [],
 
+
         /**
          * User-defined unload function that will be fired before all events
          * are detached
@@ -468,26 +524,9 @@
          * @static
          * @private
          */
-        var unloadListeners = [];
+        unloadListeners = [],
 
         /**
-         * Cache of DOM0 event handlers to work around issues with DOM2 events
-         * in Safari
-         * @property legacyEvents
-         * @static
-         * @private
-         */
-        var legacyEvents = [];
-
-        /**
-         * Listener stack for DOM0 events
-         * @property legacyHandlers
-         * @static
-         * @private
-         */
-        var legacyHandlers = [];
-
-        /**
          * The number of times to poll after window.onload.  This number is
          * increased if additional late-bound handlers are requested after
          * the page load.
@@ -495,7 +534,7 @@
          * @static
          * @private
          */
-        var retryCount = 0;
+        retryCount = 0,
 
         /**
          * onAvailable listeners
@@ -503,23 +542,15 @@
          * @static
          * @private
          */
-        var onAvailStack = [];
+        onAvailStack = [],
 
         /**
-         * Lookup table for legacy events
-         * @property legacyMap
-         * @static
-         * @private
-         */
-        var legacyMap = [];
-
-        /**
          * Counter for auto id generation
          * @property counter
          * @static
          * @private
          */
-        var counter = 0;
+        counter = 0,
         
         /**
          * Normalized keycodes for webkit/safari
@@ -529,7 +560,7 @@
          * @static
          * @final
          */
-        var webkitKeymap = {
+         webkitKeymap = {
             63232: 38, // up
             63233: 40, // down
             63234: 37, // left
@@ -538,15 +569,22 @@
             63277: 34, // page down
             25: 9      // SHIFT-TAB (Safari provides a different key code in
                        // this case, even though the shiftKey modifier is set)
-        };
+        },
 
+		isIE = YAHOO.env.ua.ie,
+
+        // String constants used by the addFocusListener and removeFocusListener methods
+		
+       	FOCUSIN = "focusin",
+       	FOCUSOUT = "focusout";
+
         return {
 
             /**
              * The number of times we should look for elements that are not
              * in the DOM at the time the event is requested after the document
-             * has been loaded.  The default is 4000@amp;10 ms, so it will poll
-             * for 40 seconds or until all outstanding handlers are bound
+             * has been loaded.  The default is 500@amp;40 ms, so it will poll
+             * for 20 seconds or until all outstanding handlers are bound
              * (whichever comes first).
              * @property POLL_RETRYS
              * @type int
@@ -553,7 +591,7 @@
              * @static
              * @final
              */
-            POLL_RETRYS: 4000,
+            POLL_RETRYS: 500,
 
             /**
              * The poll interval in milliseconds
@@ -562,7 +600,7 @@
              * @static
              * @final
              */
-            POLL_INTERVAL: 10,
+            POLL_INTERVAL: 40,
 
             /**
              * Element to bind, int constant
@@ -592,7 +630,7 @@
             FN: 2,
 
             /**
-             * Function wrapped for scope correction and cleanup, int constant
+             * Function wrapped for context correction and cleanup, int constant
              * @property WFN
              * @type int
              * @static
@@ -612,7 +650,7 @@
             UNLOAD_OBJ: 3,
 
             /**
-             * Adjusted scope, either the element we are registering the event
+             * Adjusted context, either the element we are registering the event
              * on or the custom object passed in by the listener, int constant
              * @property ADJ_SCOPE
              * @type int
@@ -631,7 +669,7 @@
             OBJ: 5,
 
             /**
-             * The original scope parameter passed into addListener
+             * The original context parameter passed into addListener
              * @property OVERRIDE
              * @type int
              * @static
@@ -640,6 +678,15 @@
             OVERRIDE: 6,
 
             /**
+             * The original capture parameter passed into addListener
+             * @property CAPTURE
+             * @type int
+             * @static
+             * @final
+             */
+			CAPTURE: 7,
+
+            /**
              * addListener/removeListener can throw errors in unexpected scenarios.
              * These errors are suppressed, the method returns false, and this property
              * is set
@@ -675,7 +722,7 @@
              * @static
              * @deprecated use YAHOO.env.ua.ie
              */
-            isIE: YAHOO.env.ua.ie,
+            isIE: isIE,
 
             /**
              * poll handle
@@ -693,7 +740,20 @@
              */
              _dri: null,
 
+
             /**
+             * Map of special event types
+             * @property _specialTypes
+             * @static
+             * @private
+             */
+			_specialTypes: {
+				focusin: (isIE ? "focusin" : "focus"),
+				focusout: (isIE ? "focusout" : "blur")
+			},
+
+
+            /**
              * True when the document is initially usable
              * @property DOMReady
              * @type boolean
@@ -702,6 +762,18 @@
             DOMReady: false,
 
             /**
+             * Errors thrown by subscribers of custom events are caught
+             * and the error message is written to the debug console.  If
+             * this property is set to true, it will also re-throw the
+             * error.
+             * @property throwErrors
+             * @type boolean
+             * @default false
+             */
+            throwErrors: false,
+
+
+            /**
              * @method startInterval
              * @static
              * @private
@@ -708,9 +780,10 @@
              */
             startInterval: function() {
                 if (!this._interval) {
-                    var self = this;
-                    var callback = function() { self._tryPreloadAttach(); };
-                    this._interval = setInterval(callback, this.POLL_INTERVAL);
+                    // var self = this;
+                    // var callback = function() { self._tryPreloadAttach(); };
+                    // this._interval = setInterval(callback, this.POLL_INTERVAL);
+                    this._interval = YAHOO.lang.later(this.POLL_INTERVAL, this, this._tryPreloadAttach, null, true);
                 }
             },
 
@@ -727,29 +800,31 @@
              *
              * @method onAvailable
              *
-             * @param {string||string[]}   p_id the id of the element, or an array
+             * @param {string||string[]}   id the id of the element, or an array
              * of ids to look for.
-             * @param {function} p_fn what to execute when the element is found.
-             * @param {object}   p_obj an optional object to be passed back as
-             *                   a parameter to p_fn.
-             * @param {boolean|object}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj, if set to an object it
-             *                   will execute in the scope of that object
+             * @param {function} fn what to execute when the element is found.
+             * @param {object}   obj an optional object to be passed back as
+             *                   a parameter to fn.
+             * @param {boolean|object}  overrideContext If set to true, fn will execute
+             *                   in the context of obj, if set to an object it
+             *                   will execute in the context of that object
              * @param checkContent {boolean} check child node readiness (onContentReady)
              * @static
              */
-            onAvailable: function(p_id, p_fn, p_obj, p_override, checkContent) {
+            onAvailable: function(id, fn, obj, overrideContext, checkContent) {
 
-                var a = (YAHOO.lang.isString(p_id)) ? [p_id] : p_id;
+                var a = (YAHOO.lang.isString(id)) ? [id] : id;
 
                 for (var i=0; i<a.length; i=i+1) {
                     onAvailStack.push({id:         a[i], 
-                                       fn:         p_fn, 
-                                       obj:        p_obj, 
-                                       override:   p_override, 
+                                       fn:         fn, 
+                                       obj:        obj, 
+                                       overrideContext:   overrideContext, 
                                        checkReady: checkContent });
                 }
+
                 retryCount = this.POLL_RETRYS;
+
                 this.startInterval();
             },
 
@@ -763,18 +838,18 @@
              *
              * @method onContentReady
              *
-             * @param {string}   p_id the id of the element to look for.
-             * @param {function} p_fn what to execute when the element is ready.
-             * @param {object}   p_obj an optional object to be passed back as
-             *                   a parameter to p_fn.
-             * @param {boolean|object}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj.  If an object, p_fn will
-             *                   exectute in the scope of that object
+             * @param {string}   id the id of the element to look for.
+             * @param {function} fn what to execute when the element is ready.
+             * @param {object}   obj an optional object to be passed back as
+             *                   a parameter to fn.
+             * @param {boolean|object}  overrideContext If set to true, fn will execute
+             *                   in the context of obj.  If an object, fn will
+             *                   exectute in the context of that object
              *
              * @static
              */
-            onContentReady: function(p_id, p_fn, p_obj, p_override) {
-                this.onAvailable(p_id, p_fn, p_obj, p_override, true);
+            onContentReady: function(id, fn, obj, overrideContext) {
+                this.onAvailable(id, fn, obj, overrideContext, true);
             },
 
             /**
@@ -800,37 +875,25 @@
              *
              * @method onDOMReady
              *
-             * @param {function} p_fn what to execute when the element is found.
-             * @param {object}   p_obj an optional object to be passed back as
-             *                   a parameter to p_fn.
-             * @param {boolean|object}  p_scope If set to true, p_fn will execute
-             *                   in the scope of p_obj, if set to an object it
-             *                   will execute in the scope of that object
+             * @param {function} fn what to execute when the element is found.
+             * @param {object}   obj an optional object to be passed back as
+             *                   a parameter to fn.
+             * @param {boolean|object}  overrideContext If set to true, fn will execute
+             *                   in the context of obj, if set to an object it
+             *                   will execute in the context of that object
              *
              * @static
              */
-            onDOMReady: function(p_fn, p_obj, p_override) {
-                if (this.DOMReady) {
-                    setTimeout(function() {
-                        var s = window;
-                        if (p_override) {
-                            if (p_override === true) {
-                                s = p_obj;
-                            } else {
-                                s = p_override;
-                            }
-                        }
-                        p_fn.call(s, "DOMReady", [], p_obj);
-                    }, 0);
-                } else {
-                    this.DOMReadyEvent.subscribe(p_fn, p_obj, p_override);
-                }
+            // onDOMReady: function(fn, obj, overrideContext) {
+            onDOMReady: function() {
+                this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent, arguments);
             },
 
+
             /**
              * Appends an event handler
              *
-             * @method addListener
+             * @method _addListener
              *
              * @param {String|HTMLElement|Array|NodeList} el An id, an element 
              *  reference, or a collection of ids and/or elements to assign the 
@@ -839,21 +902,22 @@
              * @param {Function} fn        The method the event invokes
              * @param {Object}   obj    An arbitrary object that will be 
              *                             passed as a parameter to the handler
-             * @param {Boolean|object}  override  If true, the obj passed in becomes
-             *                             the execution scope of the listener. If an
+             * @param {Boolean|object}  overrideContext  If true, the obj passed in becomes
+             *                             the execution context of the listener. If an
              *                             object, this object becomes the execution
-             *                             scope.
+             *                             context.
+             * @param {boolen}      capture capture or bubble phase
              * @return {Boolean} True if the action was successful or defered,
              *                        false if one or more of the elements 
              *                        could not have the listener attached,
              *                        or if the operation throws an exception.
+             * @private
              * @static
              */
-            addListener: function(el, sType, fn, obj, override) {
+            _addListener: function(el, sType, fn, obj, overrideContext, bCapture) {
 
                 if (!fn || !fn.call) {
-// throw new TypeError(sType + " addListener call failed, callback undefined");
-YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event");
+                    YAHOO.log(sType + " addListener failed, invalid callback", "error", "Event");
                     return false;
                 }
 
@@ -865,7 +929,7 @@
                                        sType, 
                                        fn, 
                                        obj, 
-                                       override) && ok;
+                                       overrideContext) && ok;
                     }
                     return ok;
 
@@ -883,7 +947,7 @@
                     } else {
                         // defer adding the event until the element is available
                         this.onAvailable(el, function() {
-                           YAHOO.util.Event.on(el, sType, fn, obj, override);
+                           YAHOO.util.Event._addListener(el, sType, fn, obj, overrideContext, bCapture);
                         });
 
                         return true;
@@ -903,21 +967,21 @@
                 // handles explicitly during our one unload event.
                 if ("unload" == sType && obj !== this) {
                     unloadListeners[unloadListeners.length] =
-                            [el, sType, fn, obj, override];
+                            [el, sType, fn, obj, overrideContext];
                     return true;
                 }
 
                 // this.logger.debug("Adding handler: " + el + ", " + sType);
 
-                // if the user chooses to override the scope, we use the custom
-                // object passed in, otherwise the executing scope will be the
+                // if the user chooses to override the context, we use the custom
+                // object passed in, otherwise the executing context will be the
                 // HTML element that the event is registered on
-                var scope = el;
-                if (override) {
-                    if (override === true) {
-                        scope = obj;
+                var context = el;
+                if (overrideContext) {
+                    if (overrideContext === true) {
+                        context = obj;
                     } else {
-                        scope = override;
+                        context = overrideContext;
                     }
                 }
 
@@ -924,127 +988,177 @@
                 // wrap the function so we can return the obj object when
                 // the event fires;
                 var wrappedFn = function(e) {
-                        return fn.call(scope, YAHOO.util.Event.getEvent(e, el), 
+                        return fn.call(context, YAHOO.util.Event.getEvent(e, el), 
                                 obj);
                     };
 
-                var li = [el, sType, fn, wrappedFn, scope, obj, override];
+                var li = [el, sType, fn, wrappedFn, context, obj, overrideContext, bCapture];
                 var index = listeners.length;
                 // cache the listener so we can try to automatically unload
                 listeners[index] = li;
 
-                if (this.useLegacyEvent(el, sType)) {
-                    var legacyIndex = this.getLegacyIndex(el, sType);
+                try {
+                    this._simpleAdd(el, sType, wrappedFn, bCapture);
+                } catch(ex) {
+                    // handle an error trying to attach an event.  If it fails
+                    // we need to clean up the cache
+                    this.lastError = ex;
+                    this.removeListener(el, sType, fn);
+                    return false;
+                }
 
-                    // Add a new dom0 wrapper if one is not detected for this
-                    // element
-                    if ( legacyIndex == -1 || 
-                                el != legacyEvents[legacyIndex][0] ) {
+                return true;
+                
+            },
 
-                        legacyIndex = legacyEvents.length;
-                        legacyMap[el.id + sType] = legacyIndex;
+            /**
+             * Checks to see if the type requested is a special type 
+			 * (as defined by the _specialTypes hash), and (if so) returns 
+			 * the special type name.
+             *
+             * @method _getType
+             *
+             * @param {String}   sType     The type to look up
+             * @private
+             */
+			_getType: function (type) {
+			
+				return this._specialTypes[type] || type;
+				
+			},
 
-                        // cache the signature for the DOM0 event, and 
-                        // include the existing handler for the event, if any
-                        legacyEvents[legacyIndex] = 
-                            [el, sType, el["on" + sType]];
-                        legacyHandlers[legacyIndex] = [];
 
-                        el["on" + sType] = 
-                            function(e) {
-                                YAHOO.util.Event.fireLegacyEvent(
-                                    YAHOO.util.Event.getEvent(e), legacyIndex);
-                            };
-                    }
+            /**
+             * Appends an event handler
+             *
+             * @method addListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to assign the 
+             *  listener to.
+             * @param {String}   sType     The type of event to append
+             * @param {Function} fn        The method the event invokes
+             * @param {Object}   obj    An arbitrary object that will be 
+             *                             passed as a parameter to the handler
+             * @param {Boolean|object}  overrideContext  If true, the obj passed in becomes
+             *                             the execution context of the listener. If an
+             *                             object, this object becomes the execution
+             *                             context.
+             * @return {Boolean} True if the action was successful or defered,
+             *                        false if one or more of the elements 
+             *                        could not have the listener attached,
+             *                        or if the operation throws an exception.
+             * @static
+             */
+            addListener: function (el, sType, fn, obj, overrideContext) {
 
-                    // add a reference to the wrapped listener to our custom
-                    // stack of events
-                    //legacyHandlers[legacyIndex].push(index);
-                    legacyHandlers[legacyIndex].push(li);
+				var capture = ((sType == FOCUSIN || sType == FOCUSOUT) && !YAHOO.env.ua.ie) ? true : false;
 
-                } else {
-                    try {
-                        this._simpleAdd(el, sType, wrappedFn, false);
-                    } catch(ex) {
-                        // handle an error trying to attach an event.  If it fails
-                        // we need to clean up the cache
-                        this.lastError = ex;
-                        this.removeListener(el, sType, fn);
-                        return false;
-                    }
-                }
+                return this._addListener(el, this._getType(sType), fn, obj, overrideContext, capture);
 
-                return true;
-                
-            },
+        	},
 
+
             /**
-             * When using legacy events, the handler is routed to this object
-             * so we can fire our custom listener stack.
-             * @method fireLegacyEvent
+             * Attaches a focusin event listener to the specified element for 
+ 			 * the purpose of listening for the focus event on the element's 
+             * descendants.
+             * @method addFocusListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to assign the 
+             *  listener to.
+             * @param {Function} fn        The method the event invokes
+             * @param {Object}   obj    An arbitrary object that will be 
+             *                             passed as a parameter to the handler
+             * @param {Boolean|object}  overrideContext  If true, the obj passed in becomes
+             *                             the execution context of the listener. If an
+             *                             object, this object becomes the execution
+             *                             context.
+             * @return {Boolean} True if the action was successful or defered,
+             *                        false if one or more of the elements 
+             *                        could not have the listener attached,
+             *                        or if the operation throws an exception.
              * @static
-             * @private
+			* @deprecated use YAHOO.util.Event.on and specify "focusin" as the event type.
              */
-            fireLegacyEvent: function(e, legacyIndex) {
-                // this.logger.debug("fireLegacyEvent " + legacyIndex);
-                var ok=true,le,lh,li,scope,ret;
-                
-                lh = legacyHandlers[legacyIndex];
-                for (var i=0,len=lh.length; i<len; ++i) {
-                    li = lh[i];
-                    if ( li && li[this.WFN] ) {
-                        scope = li[this.ADJ_SCOPE];
-                        ret = li[this.WFN].call(scope, e);
-                        ok = (ok && ret);
-                    }
-                }
+            addFocusListener: function (el, fn, obj, overrideContext) {
+                return this.on(el, FOCUSIN, fn, obj, overrideContext);
+            },          
 
-                // Fire the original handler if we replaced one.  We fire this
-                // after the other events to keep stopPropagation/preventDefault
-                // that happened in the DOM0 handler from touching our DOM2
-                // substitute
-                le = legacyEvents[legacyIndex];
-                if (le && le[2]) {
-                    le[2](e);
-                }
-                
-                return ok;
-            },
 
             /**
-             * Returns the legacy event index that matches the supplied 
-             * signature
-             * @method getLegacyIndex
+             * Removes a focusin event listener to the specified element for 
+			 * the purpose of listening for the focus event on the element's 
+             * descendants.
+             *
+             * @method removeFocusListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to remove
+             *  the listener from.
+             * @param {Function} fn the method the event invokes.  If fn is
+             *  undefined, then all event handlers for the type of event are 
+             *  removed.
+             * @return {boolean} true if the unbind was successful, false 
+             *  otherwise.
              * @static
-             * @private
+         	 * @deprecated use YAHOO.util.Event.removeListener and specify "focusin" as the event type.
              */
-            getLegacyIndex: function(el, sType) {
-                var key = this.generateId(el) + sType;
-                if (typeof legacyMap[key] == "undefined") { 
-                    return -1;
-                } else {
-                    return legacyMap[key];
-                }
+            removeFocusListener: function (el, fn) { 
+                return this.removeListener(el, FOCUSIN, fn);
             },
 
             /**
-             * Logic that determines when we should automatically use legacy
-             * events instead of DOM2 events.  Currently this is limited to old
-             * Safari browsers with a broken preventDefault
-             * @method useLegacyEvent
+             * Attaches a focusout event listener to the specified element for 
+			 * the purpose of listening for the blur event on the element's 
+			 * descendants.
+             *
+             * @method addBlurListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to assign the 
+             *  listener to.
+             * @param {Function} fn        The method the event invokes
+             * @param {Object}   obj    An arbitrary object that will be 
+             *                             passed as a parameter to the handler
+             * @param {Boolean|object}  overrideContext  If true, the obj passed in becomes
+             *                             the execution context of the listener. If an
+             *                             object, this object becomes the execution
+             *                             context.
+             * @return {Boolean} True if the action was successful or defered,
+             *                        false if one or more of the elements 
+             *                        could not have the listener attached,
+             *                        or if the operation throws an exception.
              * @static
-             * @private
+         	 * @deprecated use YAHOO.util.Event.on and specify "focusout" as the event type.
              */
-            useLegacyEvent: function(el, sType) {
-                if (this.webkit && ("click"==sType || "dblclick"==sType)) {
-                    var v = parseInt(this.webkit, 10);
-                    if (!isNaN(v) && v<418) {
-                        return true;
-                    }
-                }
-                return false;
+            addBlurListener: function (el, fn, obj, overrideContext) {
+                return this.on(el, FOCUSOUT, fn, obj, overrideContext);
+            },          
+
+            /**
+             * Removes a focusout event listener to the specified element for 
+			 * the purpose of listening for the blur event on the element's 
+			 * descendants.
+             *
+             * @method removeBlurListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to remove
+             *  the listener from.
+             * @param {Function} fn the method the event invokes.  If fn is
+             *  undefined, then all event handlers for the type of event are 
+             *  removed.
+             * @return {boolean} true if the unbind was successful, false 
+             *  otherwise.
+             * @static
+         	 * @deprecated use YAHOO.util.Event.removeListener and specify "focusout" as the event type.
+             */
+            removeBlurListener: function (el, fn) { 
+                return this.removeListener(el, FOCUSOUT, fn);
             },
-                    
+
             /**
              * Removes an event listener
              *
@@ -1064,6 +1178,8 @@
             removeListener: function(el, sType, fn) {
                 var i, len, li;
 
+				sType = this._getType(sType);
+
                 // The el argument can be a string
                 if (typeof el == "string") {
                     el = this.getEl(el);
@@ -1070,7 +1186,7 @@
                 // The el argument can be an array of elements or element ids.
                 } else if ( this._isValidCollection(el)) {
                     var ok = true;
-                    for (i=0,len=el.length; i<len; ++i) {
+                    for (i=el.length-1; i>-1; i--) {
                         ok = ( this.removeListener(el[i], sType, fn) && ok );
                     }
                     return ok;
@@ -1084,14 +1200,14 @@
 
                 if ("unload" == sType) {
 
-                    for (i=0, len=unloadListeners.length; i<len; i++) {
+                    for (i=unloadListeners.length-1; i>-1; i--) {
                         li = unloadListeners[i];
                         if (li && 
                             li[0] == el && 
                             li[1] == sType && 
                             li[2] == fn) {
-                                //unloadListeners.splice(i, 1);
-                                unloadListeners[i]=null;
+                                unloadListeners.splice(i, 1);
+                                // unloadListeners[i]=null;
                                 return true;
                         }
                     }
@@ -1107,7 +1223,7 @@
                 var index = arguments[3];
   
                 if ("undefined" === typeof index) {
-                    index = this._getCacheIndex(el, sType, fn);
+                    index = this._getCacheIndex(listeners, el, sType, fn);
                 }
 
                 if (index >= 0) {
@@ -1121,37 +1237,20 @@
 
                 // this.logger.debug("Removing handler: " + el + ", " + sType);
 
-                if (this.useLegacyEvent(el, sType)) {
-                    var legacyIndex = this.getLegacyIndex(el, sType);
-                    var llist = legacyHandlers[legacyIndex];
-                    if (llist) {
-                        for (i=0, len=llist.length; i<len; ++i) {
-                            li = llist[i];
-                            if (li && 
-                                li[this.EL] == el && 
-                                li[this.TYPE] == sType && 
-                                li[this.FN] == fn) {
-                                    //llist.splice(i, 1);
-                                    llist[i]=null;
-                                    break;
-                            }
-                        }
-                    }
+				var bCapture = cacheItem[this.CAPTURE] === true ? true : false;
 
-                } else {
-                    try {
-                        this._simpleRemove(el, sType, cacheItem[this.WFN], false);
-                    } catch(ex) {
-                        this.lastError = ex;
-                        return false;
-                    }
+                try {
+                    this._simpleRemove(el, sType, cacheItem[this.WFN], bCapture);
+                } catch(ex) {
+                    this.lastError = ex;
+                    return false;
                 }
 
                 // removed the wrapped handler
                 delete listeners[index][this.WFN];
                 delete listeners[index][this.FN];
-                //listeners.splice(index, 1);
-                listeners[index]=null;
+                listeners.splice(index, 1);
+                // listeners[index]=null;
 
                 return true;
 
@@ -1184,12 +1283,14 @@
              * @return {HTMLElement} the normized node
              * @static
              */
-            resolveTextNode: function(node) {
-                if (node && 3 == node.nodeType) {
-                    return node.parentNode;
-                } else {
-                    return node;
-                }
+            resolveTextNode: function(n) {
+                try {
+                    if (n && 3 == n.nodeType) {
+                        return n.parentNode;
+                    }
+                } catch(e) { }
+
+                return n;
             },
 
             /**
@@ -1351,32 +1452,6 @@
                     }
                 }
 
-                // IE events that target non-browser objects (e.g., VML
-                // canvas) will sometimes throw errors when you try to
-                // inspect the properties of the event target.  We try to
-                // detect this condition, and provide a dummy target (the bound
-                // element) to eliminate spurious errors.  
-
-                // the implementation caused unexpected results in some 
-                // implementations, so this has been rolled back for now
-                /* 
-                if (ev && this.isIE) {
-
-                    try {
-
-                        var el = ev.srcElement;
-
-                    } catch(ex) {
-
-                        YAHOO.log("Inspecting the target caused an error, " +
-                            "setting the target to the bound element.", "warn");
-                         
-                        ev.target = boundEl;
-                    }
-
-                }
-                */
-
                 return ev;
             },
 
@@ -1390,7 +1465,7 @@
             getCharCode: function(ev) {
                 var code = ev.keyCode || ev.charCode || 0;
 
-                // webkit normalization
+                // webkit key normalization
                 if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
                     code = webkitKeymap[code];
                 }
@@ -1404,9 +1479,9 @@
              * @static
              * @private
              */
-            _getCacheIndex: function(el, sType, fn) {
-                for (var i=0,len=listeners.length; i<len; ++i) {
-                    var li = listeners[i];
+            _getCacheIndex: function(a, el, sType, fn) {
+                for (var i=0, l=a.length; i<l; i=i+1) {
+                    var li = a[i];
                     if ( li                 && 
                          li[this.FN] == fn  && 
                          li[this.EL] == el  && 
@@ -1460,8 +1535,7 @@
                              !o.alert              && // o is not a window
                              typeof o[0] !== "undefined" );
                 } catch(ex) {
-                    YAHOO.log("_isValidCollection error, assuming that " +
-                " this is a cross frame problem and not a collection", "warn");
+                    YAHOO.log("node access error (xframe?)", "warn");
                     return false;
                 }
 
@@ -1502,7 +1576,7 @@
              * Custom event the fires when the dom is initially usable
              * @event DOMReadyEvent
              */
-            DOMReadyEvent: new YAHOO.util.CustomEvent("DOMReady", this),
+            DOMReadyEvent: new YAHOO.util.CustomEvent("DOMReady", YAHOO, 0, 0, 1),
 
             /**
              * hook up any deferred listeners
@@ -1525,11 +1599,6 @@
                     // before the window load notification
                     EU._tryPreloadAttach();
 
-                    // Remove the listener to assist with the IE memory issue, but not
-                    // for other browsers because FF 1.0x does not like it.
-                    //if (this.isIE) {
-                        //EU._simpleRemove(window, "load", EU._load);
-                    //}
                 }
             },
 
@@ -1563,8 +1632,18 @@
              */
             _tryPreloadAttach: function() {
 
+                if (onAvailStack.length === 0) {
+                    retryCount = 0;
+                    if (this._interval) {
+                        // clearInterval(this._interval);
+                        this._interval.cancel();
+                        this._interval = null;
+                    } 
+                    return;
+                }
+
                 if (this.locked) {
-                    return false;
+                    return;
                 }
 
                 if (this.isIE) {
@@ -1571,10 +1650,9 @@
                     // Hold off if DOMReady has not fired and check current
                     // readyState to protect against the IE operation aborted
                     // issue.
-                    //if (!this.DOMReady || "complete" !== document.readyState) {
                     if (!this.DOMReady) {
                         this.startInterval();
-                        return false;
+                        return;
                     }
                 }
 
@@ -1588,7 +1666,7 @@
                 // tested appropriately
                 var tryAgain = !loadComplete;
                 if (!tryAgain) {
-                    tryAgain = (retryCount > 0);
+                    tryAgain = (retryCount > 0 && onAvailStack.length > 0);
                 }
 
                 // onAvailable
@@ -1595,43 +1673,31 @@
                 var notAvail = [];
 
                 var executeItem = function (el, item) {
-                    var scope = el;
-                    if (item.override) {
-                        if (item.override === true) {
-                            scope = item.obj;
+                    var context = el;
+                    if (item.overrideContext) {
+                        if (item.overrideContext === true) {
+                            context = item.obj;
                         } else {
-                            scope = item.override;
+                            context = item.overrideContext;
                         }
                     }
-                    item.fn.call(scope, item.obj);
+                    item.fn.call(context, item.obj);
                 };
 
-                var i,len,item,el;
+                var i, len, item, el, ready=[];
 
-                // onAvailable
-                for (i=0,len=onAvailStack.length; i<len; ++i) {
+                // onAvailable onContentReady
+                for (i=0, len=onAvailStack.length; i<len; i=i+1) {
                     item = onAvailStack[i];
-                    if (item && !item.checkReady) {
+                    if (item) {
                         el = this.getEl(item.id);
                         if (el) {
-                            executeItem(el, item);
-                            onAvailStack[i] = null;
-                        } else {
-                            notAvail.push(item);
-                        }
-                    }
-                }
-
-                // onContentReady
-                for (i=0,len=onAvailStack.length; i<len; ++i) {
-                    item = onAvailStack[i];
-                    if (item && item.checkReady) {
-                        el = this.getEl(item.id);
-
-                        if (el) {
-                            // The element is available, but not necessarily ready
-                            // @todo should we test parentNode.nextSibling?
-                            if (loadComplete || el.nextSibling) {
+                            if (item.checkReady) {
+                                if (loadComplete || el.nextSibling || !tryAgain) {
+                                    ready.push(item);
+                                    onAvailStack[i] = null;
+                                }
+                            } else {
                                 executeItem(el, item);
                                 onAvailStack[i] = null;
                             }
@@ -1640,21 +1706,35 @@
                         }
                     }
                 }
+                
+                // make sure onContentReady fires after onAvailable
+                for (i=0, len=ready.length; i<len; i=i+1) {
+                    item = ready[i];
+                    executeItem(this.getEl(item.id), item);
+                }
 
-                retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
 
+                retryCount--;
+
                 if (tryAgain) {
-                    // we may need to strip the nulled out items here
+                    for (i=onAvailStack.length-1; i>-1; i--) {
+                        item = onAvailStack[i];
+                        if (!item || !item.id) {
+                            onAvailStack.splice(i, 1);
+                        }
+                    }
+
                     this.startInterval();
                 } else {
-                    clearInterval(this._interval);
-                    this._interval = null;
+                    if (this._interval) {
+                        // clearInterval(this._interval);
+                        this._interval.cancel();
+                        this._interval = null;
+                    }
                 }
 
                 this.locked = false;
 
-                return true;
-
             },
 
             /**
@@ -1673,11 +1753,9 @@
                 var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
                 var elListeners = this.getListeners(oEl, sType), i, len;
                 if (elListeners) {
-                    for (i=0,len=elListeners.length; i<len ; ++i) {
+                    for (i=elListeners.length-1; i>-1; i--) {
                         var l = elListeners[i];
-                        // can't use the index on the changing collection
-                        this.removeListener(oEl, l.type, l.fn, l.index);
-                        //this.removeListener(oEl, l.type, l.fn);
+                        this.removeListener(oEl, l.type, l.fn);
                     }
                 }
 
@@ -1699,8 +1777,8 @@
              * &nbsp;&nbsp;type:   (string)   the type of event
              * &nbsp;&nbsp;fn:     (function) the callback supplied to addListener
              * &nbsp;&nbsp;obj:    (object)   the custom object supplied to addListener
-             * &nbsp;&nbsp;adjust: (boolean|object)  whether or not to adjust the default scope
-             * &nbsp;&nbsp;scope: (boolean)  the derived scope based on the adjust parameter
+             * &nbsp;&nbsp;adjust: (boolean|object)  whether or not to adjust the default context
+             * &nbsp;&nbsp;scope: (boolean)  the derived context based on the adjust parameter
              * &nbsp;&nbsp;index:  (int)      its position in the Event util listener cache
              * @static
              */           
@@ -1711,6 +1789,7 @@
                 } else if (sType === "unload") {
                     searchLists = [unloadListeners];
                 } else {
+					sType = this._getType(sType);
                     searchLists = [listeners];
                 }
 
@@ -1718,7 +1797,7 @@
 
                 for (var j=0;j<searchLists.length; j=j+1) {
                     var searchList = searchLists[j];
-                    if (searchList && searchList.length > 0) {
+                    if (searchList) {
                         for (var i=0,len=searchList.length; i<len ; ++i) {
                             var l = searchList[i];
                             if ( l  && l[this.EL] === oEl && 
@@ -1748,79 +1827,45 @@
              */
             _unload: function(e) {
 
-                var EU = YAHOO.util.Event, i, j, l, len, index;
+                var EU = YAHOO.util.Event, i, j, l, len, index,
+                         ul = unloadListeners.slice(), context;
 
                 // execute and clear stored unload listeners
-                for (i=0,len=unloadListeners.length; i<len; ++i) {
-                    l = unloadListeners[i];
+                for (i=0, len=unloadListeners.length; i<len; ++i) {
+                    l = ul[i];
                     if (l) {
-                        var scope = window;
+                        context = window;
                         if (l[EU.ADJ_SCOPE]) {
                             if (l[EU.ADJ_SCOPE] === true) {
-                                scope = l[EU.UNLOAD_OBJ];
+                                context = l[EU.UNLOAD_OBJ];
                             } else {
-                                scope = l[EU.ADJ_SCOPE];
+                                context = l[EU.ADJ_SCOPE];
                             }
                         }
-                        l[EU.FN].call(scope, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
-                        unloadListeners[i] = null;
-                        l=null;
-                        scope=null;
+                        l[EU.FN].call(context, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
+                        ul[i] = null;
                     }
                 }
 
+                l = null;
+                context = null;
                 unloadListeners = null;
 
-                // call clearAttributes or remove listeners to handle IE memory leaks
-                if (YAHOO.env.ua.ie && listeners && listeners.length > 0) {
-                    j = listeners.length;
-                    while (j) {
-                        index = j-1;
-                        l = listeners[index];
+                // Remove listeners to handle IE memory leaks
+                // 2.5.0 listeners are removed for all browsers again.  FireFox preserves
+                // at least some listeners between page refreshes, potentially causing
+                // errors during page load (mouseover listeners firing before they
+                // should if the user moves the mouse at the correct moment).
+                if (listeners) {
+                    for (j=listeners.length-1; j>-1; j--) {
+                        l = listeners[j];
                         if (l) {
-                            //try {
-                                //l[EU.EL].clearAttributes(); // errors on window objects
-                            //} catch(ex) {
-                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
-                            //}
+                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], j);
                         } 
-                        j--;
                     }
                     l=null;
                 }
 
-                /*
-                // remove all listeners
-                if (listeners && listeners.length > 0) {
-                    j = listeners.length;
-                    while (j) {
-                        index = j-1;
-                        l = listeners[index];
-                        if (l) {
-                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
-                        } 
-                        j = j - 1;
-                    }
-                    l=null;
-                }
-                */
-
-                /*
-                // kill legacy events
-                for (i=0,len=legacyEvents.length; i<len; ++i) {
-                    // dereference the element
-                    //delete legacyEvents[i][0];
-                    legacyEvents[i][0] = null;
-
-                    // delete the array item
-                    //delete legacyEvents[i];
-                    legacyEvents[i] = null;
-                }
-
-                */
-
-                legacyEvents = null;
-
                 EU._simpleRemove(window, "unload", EU._unload);
 
             },
@@ -1871,28 +1916,10 @@
              * @static
              * @deprecated still here for backwards compatibility
              */
-            regCE: function() {
-                // does nothing
-            },
+            regCE: function() {},
 
-/*
-            testIEReady: function (){
-                var n = document.createElement('p'), ready = false;
-                try {
-                    // throws an error until the doc is ready
-                    n.doScroll('left'); 
-                    ready = true;
-                } catch(ex){ 
-                    // document is not ready
-                }
-
-                n = null;
-                return ready;
-            },
-*/
-
             /**
-             * Adds a DOM event directly without the caching, cleanup, scope adj, etc
+             * Adds a DOM event directly without the caching, cleanup, context adj, etc
              *
              * @method _simpleAdd
              * @param {HTMLElement} el      the element to bind the handler to
@@ -1955,97 +1982,64 @@
          */
         EU.on = EU.addListener;
 
-        /////////////////////////////////////////////////////////////
-        // DOMReady
-        // based on work by: Dean Edwards/John Resig/Matthias Miller 
+        /**
+         * YAHOO.util.Event.onFocus is an alias for addFocusListener
+         * @method onFocus
+         * @see addFocusListener
+         * @static
+		 * @deprecated use YAHOO.util.Event.on and specify "focusin" as the event type.
+         */
+        EU.onFocus = EU.addFocusListener;
 
+        /**
+         * YAHOO.util.Event.onBlur is an alias for addBlurListener
+         * @method onBlur
+         * @see addBlurListener
+         * @static
+		 * @deprecated use YAHOO.util.Event.on and specify "focusout" as the event type.
+         */     
+        EU.onBlur = EU.addBlurListener;
+
+/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
+
         // Internet Explorer: use the readyState of a defered script.
         // This isolates what appears to be a safe moment to manipulate
         // the DOM prior to when the document's readyState suggests
         // it is safe to do so.
         if (EU.isIE) {
-
-            // Process onAvailable/onContentReady items when when the 
-            // DOM is ready.
-            YAHOO.util.Event.onDOMReady(
-                    YAHOO.util.Event._tryPreloadAttach,
-                    YAHOO.util.Event, true);
-
-            /*
-
-            //YAHOO.log("-" + document.readyState + "-");
-
-            var el, d=document, b=d.body;
-
-            // If the library is being injected after window.onload, it
-            // is not safe to document.write the script tag.  Detecting
-            // this state doesn't appear possible, so we expect a flag
-            // in YAHOO_config to be set if the library is being injected.
-            if (("undefined" !== typeof YAHOO_config) && YAHOO_config.injecting) {
-
-                el = document.createElement("script");
-                var p=d.getElementsByTagName("head")[0] || b;
-                p.insertBefore(el, p.firstChild);
-
-            } else {
-                //YAHOO.log("-dw-");
-    d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');
-                el=document.getElementById("_yui_eu_dr");
-            }
-            
-
-            if (el) {
-                el.onreadystatechange = function() {
-                    //YAHOO.log(";comp-" + this.readyState + ";");
-                    if ("complete" === this.readyState) {
-                        this.parentNode.removeChild(this);
-                        YAHOO.util.Event._ready();
+            if (self !== self.top) {
+                document.onreadystatechange = function() {
+                    if (document.readyState == 'complete') {
+                        document.onreadystatechange = null;
+                        EU._ready();
                     }
                 };
             } else {
-                // The library was likely injected into the page
-                // rendering onDOMReady unreliable
-                // YAHOO.util.Event._ready();
-            }
 
-            el=null;
-
-            */
-
-/*
-            (function (){
+                // Process onAvailable/onContentReady items when the 
+                // DOM is ready.
+                YAHOO.util.Event.onDOMReady(
+                        YAHOO.util.Event._tryPreloadAttach,
+                        YAHOO.util.Event, true);
+                
                 var n = document.createElement('p');  
-                try {
-                    // throws an error if doc is not ready
-                    n.doScroll('left');
-                    n = null;
-                    YAHOO.util.Event._ready();
-                } catch (ex){
-                    n = null;
-setTimeout(arguments.callee, YAHOO.util.Event.POLL_INTERVAL);
-                }
-            })();
-*/
 
-            EU._dri = setInterval(function() {
-                var n = document.createElement('p');  
-                try {
-                    // throws an error if doc is not ready
-                    n.doScroll('left');
-                    clearInterval(EU._dri);
-                    EU._dri = null;
-                    EU._ready();
-                    n = null;
-                } catch (ex) { 
-                    n = null;
-                }
-            }, EU.POLL_INTERVAL); 
+                EU._dri = setInterval(function() {
+                    try {
+                        // throws an error if doc is not ready
+                        n.doScroll('left');
+                        clearInterval(EU._dri);
+                        EU._dri = null;
+                        EU._ready();
+                        n = null;
+                    } catch (ex) { 
+                    }
+                }, EU.POLL_INTERVAL); 
+            }
 
-        
-        // Safari: The document's readyState in Safari currently will
+        // The document's readyState in Safari currently will
         // change to loaded/complete before images are loaded.
-        //} else if (EU.webkit) {
-        } else if (EU.webkit) {
+        } else if (EU.webkit && EU.webkit < 525) {
 
             EU._dri = setInterval(function() {
                 var rs=document.readyState;
@@ -2057,11 +2051,9 @@
             }, EU.POLL_INTERVAL); 
 
         // FireFox and Opera: These browsers provide a event for this
-        // moment.
+        // moment.  The latest WebKit releases now support this event.
         } else {
 
-            // @todo will this fire when the library is injected?
-
             EU._simpleAdd(document, "DOMContentLoaded", EU._ready);
 
         }
@@ -2111,16 +2103,16 @@
      * @param p_fn       {function} the function to exectute when the event fires
      * @param p_obj      {Object}   An object to be passed along when the event 
      *                              fires
-     * @param p_override {boolean}  If true, the obj passed in becomes the 
+     * @param overrideContext {boolean}  If true, the obj passed in becomes the 
      *                              execution scope of the listener
      */
-    subscribe: function(p_type, p_fn, p_obj, p_override) {
+    subscribe: function(p_type, p_fn, p_obj, overrideContext) {
 
         this.__yui_events = this.__yui_events || {};
         var ce = this.__yui_events[p_type];
 
         if (ce) {
-            ce.subscribe(p_fn, p_obj, p_override);
+            ce.subscribe(p_fn, p_obj, overrideContext);
         } else {
             this.__yui_subscribers = this.__yui_subscribers || {};
             var subs = this.__yui_subscribers;
@@ -2128,7 +2120,7 @@
                 subs[p_type] = [];
             }
             subs[p_type].push(
-                { fn: p_fn, obj: p_obj, override: p_override } );
+                { fn: p_fn, obj: p_obj, overrideContext: overrideContext } );
         }
     },
 
@@ -2199,6 +2191,13 @@
      *      This is false by default.
      *    </li>
      *    <li>
+     *      fireOnce: if true, the custom event will only notify subscribers
+     *      once regardless of the number of times the event is fired.  In
+     *      addition, new subscribers will be executed immediately if the
+     *      event has already fired.
+     *      This is false by default.
+     *    </li>
+     *    <li>
      *      onSubscribeCallback: specifies a callback to execute when the
      *      event has a new subscriber.  This will fire immediately for
      *      each queued subscriber if any exist prior to the creation of
@@ -2212,18 +2211,16 @@
     createEvent: function(p_type, p_config) {
 
         this.__yui_events = this.__yui_events || {};
-        var opts = p_config || {};
-        var events = this.__yui_events;
+        var opts = p_config || {},
+            events = this.__yui_events, ce;
 
         if (events[p_type]) {
 YAHOO.log("EventProvider createEvent skipped: '"+p_type+"' already exists");
         } else {
 
-            var scope  = opts.scope  || this;
-            var silent = (opts.silent);
+            ce = new YAHOO.util.CustomEvent(p_type, opts.scope || this, opts.silent,
+                         YAHOO.util.CustomEvent.FLAT, opts.fireOnce);
 
-            var ce = new YAHOO.util.CustomEvent(p_type, scope, silent,
-                    YAHOO.util.CustomEvent.FLAT);
             events[p_type] = ce;
 
             if (opts.onSubscribeCallback) {
@@ -2235,7 +2232,7 @@
 
             if (qs) {
                 for (var i=0; i<qs.length; ++i) {
-                    ce.subscribe(qs[i].fn, qs[i].obj, qs[i].override);
+                    ce.subscribe(qs[i].fn, qs[i].obj, qs[i].overrideContext);
                 }
             }
         }
@@ -2253,8 +2250,6 @@
      *   <li>The custom object (if any) that was passed into the subscribe() 
      *       method</li>
      *   </ul>
-     * If the custom event has not been explicitly created, it will be
-     * created now with the default config, scoped to the host object
      * @method fireEvent
      * @param p_type    {string}  the type, or name of the event
      * @param arguments {Object*} an arbitrary set of parameters to pass to 
@@ -2262,7 +2257,7 @@
      * @return {boolean} the return value from CustomEvent.fire
      *                   
      */
-    fireEvent: function(p_type, arg1, arg2, etc) {
+    fireEvent: function(p_type) {
 
         this.__yui_events = this.__yui_events || {};
         var ce = this.__yui_events[p_type];
@@ -2296,6 +2291,10 @@
 
 };
 
+(function() {
+
+    var Event = YAHOO.util.Event, Lang = YAHOO.lang;
+
 /**
 * KeyListener is a utility that provides an easy interface for listening for
 * keydown/keyup events fired against DOM elements.
@@ -2372,11 +2371,11 @@
     */
     this.disabledEvent = new YAHOO.util.CustomEvent("disabled");
 
-    if (typeof attachTo == 'string') {
-        attachTo = document.getElementById(attachTo);
+    if (Lang.isString(attachTo)) {
+        attachTo = document.getElementById(attachTo); // No Dom util
     }
 
-    if (typeof handler == 'function') {
+    if (Lang.isFunction(handler)) {
         keyEvent.subscribe(handler);
     } else {
         keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
@@ -2405,26 +2404,22 @@
             e.altKey   == keyData.alt &&
             e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
             
-            var dataItem;
+            var dataItem, keys = keyData.keys, key;
 
-            if (keyData.keys instanceof Array) {
-                for (var i=0;i<keyData.keys.length;i++) {
-                    dataItem = keyData.keys[i];
+            if (YAHOO.lang.isArray(keys)) {
+                for (var i=0;i<keys.length;i++) {
+                    dataItem = keys[i];
+                    key = Event.getCharCode(e);
 
-                    if (dataItem == e.charCode ) {
-                        keyEvent.fire(e.charCode, e);
+                    if (dataItem == key) {
+                        keyEvent.fire(key, e);
                         break;
-                    } else if (dataItem == e.keyCode) {
-                        keyEvent.fire(e.keyCode, e);
-                        break;
                     }
                 }
             } else {
-                dataItem = keyData.keys;
-                if (dataItem == e.charCode ) {
-                    keyEvent.fire(e.charCode, e);
-                } else if (dataItem == e.keyCode) {
-                    keyEvent.fire(e.keyCode, e);
+                key = Event.getCharCode(e);
+                if (keys == key ) {
+                    keyEvent.fire(key, e);
                 }
             }
         }
@@ -2437,7 +2432,7 @@
     */
     this.enable = function() {
         if (! this.enabled) {
-            YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);
+            Event.on(attachTo, event, handleKeyPress);
             this.enabledEvent.fire(keyData);
         }
         /**
@@ -2455,7 +2450,7 @@
     */
     this.disable = function() {
         if (this.enabled) {
-            YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);
+            Event.removeListener(attachTo, event, handleKeyPress);
             this.disabledEvent.fire(keyData);
         }
         this.enabled = false;
@@ -2473,23 +2468,25 @@
 
 };
 
+var KeyListener = YAHOO.util.KeyListener;
+
 /**
-* Constant representing the DOM "keydown" event.
-* @property YAHOO.util.KeyListener.KEYDOWN
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYDOWN = "keydown";
+ * Constant representing the DOM "keydown" event.
+ * @property YAHOO.util.KeyListener.KEYDOWN
+ * @static
+ * @final
+ * @type String
+ */
+KeyListener.KEYDOWN = "keydown";
 
 /**
-* Constant representing the DOM "keyup" event.
-* @property YAHOO.util.KeyListener.KEYUP
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYUP = "keyup";
+ * Constant representing the DOM "keyup" event.
+ * @property YAHOO.util.KeyListener.KEYUP
+ * @static
+ * @final
+ * @type String
+ */
+KeyListener.KEYUP = "keyup";
 
 /**
  * keycode constants for a subset of the special keys
@@ -2497,7 +2494,7 @@
  * @static
  * @final
  */
-YAHOO.util.KeyListener.KEY = {
+KeyListener.KEY = {
     ALT          : 18,
     BACK_SPACE   : 8,
     CAPS_LOCK    : 20,
@@ -2522,4 +2519,6 @@
     TAB          : 9,
     UP           : 38
 };
-YAHOO.register("event", YAHOO.util.Event, {version: "2.4.1", build: "742"});
+
+})();
+YAHOO.register("event", YAHOO.util.Event, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/event/event.js
===================================================================
--- branches/2.8.x/wb/include/yui/event/event.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/event/event.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 
 /**
@@ -11,7 +11,7 @@
  *
  * @param {String}  type The type of event, which is passed to the callback
  *                  when the event fires
- * @param {Object}  oScope The context the event will fire from.  "this" will
+ * @param {Object}  context The context the event will fire from.  "this" will
  *                  refer to this object in the callback.  Default value: 
  *                  the window object.  The listener can override this.
  * @param {boolean} silent pass true to prevent the event from writing to
@@ -20,11 +20,15 @@
  *                  will receive. YAHOO.util.CustomEvent.LIST or 
  *                  YAHOO.util.CustomEvent.FLAT.  The default is
  *                  YAHOO.util.CustomEvent.LIST.
+ * @param fireOnce {boolean} If configured to fire once, the custom event 
+ * will only notify subscribers a single time regardless of how many times 
+ * the event is fired.  In addition, new subscribers will be notified 
+ * immediately if the event has already been fired.
  * @namespace YAHOO.util
  * @class CustomEvent
  * @constructor
  */
-YAHOO.util.CustomEvent = function(type, oScope, silent, signature) {
+YAHOO.util.CustomEvent = function(type, context, silent, signature, fireOnce) {
 
     /**
      * The type of event, returned to subscribers when the event fires
@@ -34,16 +38,15 @@
     this.type = type;
 
     /**
-     * The scope the the event will fire from by default.  Defaults to the window 
-     * obj
+     * The context the event will fire from by default. Defaults to the window obj.
      * @property scope
      * @type object
      */
-    this.scope = oScope || window;
+    this.scope = context || window;
 
     /**
-     * By default all custom events are logged in the debug build, set silent
-     * to true to disable debug outpu for this event.
+     * By default all custom events are logged in the debug build. Set silent to true 
+     * to disable debug output for this event.
      * @property silent
      * @type boolean
      */
@@ -50,6 +53,33 @@
     this.silent = silent;
 
     /**
+     * If configured to fire once, the custom event will only notify subscribers
+     * a single time regardless of how many times the event is fired.  In addition,
+     * new subscribers will be notified immediately if the event has already been
+     * fired.
+     * @property fireOnce
+     * @type boolean
+     * @default false
+     */
+    this.fireOnce = fireOnce;
+
+    /**
+     * Indicates whether or not this event has ever been fired.
+     * @property fired
+     * @type boolean
+     * @default false
+     */
+    this.fired = false;
+
+    /**
+     * For fireOnce events the arguments the event was fired with are stored
+     * so that new subscribers get the proper payload.
+     * @property firedWith
+     * @type Array
+     */
+    this.firedWith = null;
+
+    /**
      * Custom events support two styles of arguments provided to the event
      * subscribers.  
      * <ul>
@@ -97,13 +127,12 @@
          *
          * @event subscribeEvent
          * @type YAHOO.util.CustomEvent
-         * @param {Function} fn The function to execute
-         * @param {Object}   obj An object to be passed along when the event 
-         *                       fires
-         * @param {boolean|Object}  override If true, the obj passed in becomes 
-         *                                   the execution scope of the listener.
-         *                                   if an object, that object becomes the
-         *                                   the execution scope.
+         * @param fn {Function} The function to execute
+         * @param obj <Object> An object to be passed along when the event fires. 
+         * Defaults to the custom event.
+         * @param override <boolean|Object> If true, the obj passed in becomes the 
+         * execution context of the listener. If an object, that object becomes 
+         * the execution context. Defaults to the custom event.
          */
         this.subscribeEvent = 
                 new YAHOO.util.CustomEvent(onsubscribeType, this, true);
@@ -147,14 +176,11 @@
      * Subscribes the caller to this event
      * @method subscribe
      * @param {Function} fn        The function to execute
-     * @param {Object}   obj       An object to be passed along when the event 
-     *                             fires
-     * @param {boolean|Object}  override If true, the obj passed in becomes 
-     *                                   the execution scope of the listener.
-     *                                   if an object, that object becomes the
-     *                                   the execution scope.
+     * @param {Object}   obj       An object to be passed along when the event fires.
+     * overrideContext <boolean|Object> If true, the obj passed in becomes the execution 
+     * context of the listener. If an object, that object becomes the execution context.
      */
-    subscribe: function(fn, obj, override) {
+    subscribe: function(fn, obj, overrideContext) {
 
         if (!fn) {
 throw new Error("Invalid callback for subscriber to '" + this.type + "'");
@@ -161,10 +187,16 @@
         }
 
         if (this.subscribeEvent) {
-            this.subscribeEvent.fire(fn, obj, override);
+            this.subscribeEvent.fire(fn, obj, overrideContext);
         }
 
-        this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, override) );
+        var s = new YAHOO.util.Subscriber(fn, obj, overrideContext);
+
+        if (this.fireOnce && this.fired) {
+            this.notify(s, this.firedWith);
+        } else {
+            this.subscribers.push(s);
+        }
     },
 
     /**
@@ -199,7 +231,7 @@
 
     /**
      * Notifies the subscribers.  The callback functions will be executed
-     * from the scope specified when the event was created, and with the 
+     * from the context specified when the event was created, and with the 
      * following parameters:
      *   <ul>
      *   <li>The type of event</li>
@@ -214,68 +246,91 @@
      *                   true otherwise
      */
     fire: function() {
-        var len=this.subscribers.length;
-        if (!len && this.silent) {
-            return true;
+
+        this.lastError = null;
+
+        var errors = [],
+            len=this.subscribers.length;
+
+
+        var args=[].slice.call(arguments, 0), ret=true, i, rebuild=false;
+
+        if (this.fireOnce) {
+            if (this.fired) {
+                return true;
+            } else {
+                this.firedWith = args;
+            }
         }
 
-        var args=[], ret=true, i, rebuild=false;
+        this.fired = true;
 
-        for (i=0; i<arguments.length; ++i) {
-            args.push(arguments[i]);
+        if (!len && this.silent) {
+            return true;
         }
 
         if (!this.silent) {
         }
 
+        // make a copy of the subscribers so that there are
+        // no index problems if one subscriber removes another.
+        var subs = this.subscribers.slice();
+
         for (i=0; i<len; ++i) {
-            var s = this.subscribers[i];
+            var s = subs[i];
             if (!s) {
                 rebuild=true;
             } else {
-                if (!this.silent) {
-                }
 
-                var scope = s.getScope(this.scope);
+                ret = this.notify(s, args);
 
-                if (this.signature == YAHOO.util.CustomEvent.FLAT) {
-                    var param = null;
-                    if (args.length > 0) {
-                        param = args[0];
-                    }
-
-                    try {
-                        ret = s.fn.call(scope, param, s.obj);
-                    } catch(e) {
-                        this.lastError = e;
-                    }
-                } else {
-                    try {
-                        ret = s.fn.call(scope, this.type, args, s.obj);
-                    } catch(ex) {
-                        this.lastError = ex;
-                    }
-                }
                 if (false === ret) {
                     if (!this.silent) {
                     }
 
-                    //break;
-                    return false;
+                    break;
                 }
             }
         }
 
-        if (rebuild) {
-            var newlist=[],subs=this.subscribers;
-            for (i=0,len=subs.length; i<len; i=i+1) {
-                newlist.push(subs[i]);
+        return (ret !== false);
+    },
+
+    notify: function(s, args) {
+
+        var ret, param=null, scope = s.getScope(this.scope),
+                 throwErrors = YAHOO.util.Event.throwErrors;
+
+        if (!this.silent) {
+        }
+
+        if (this.signature == YAHOO.util.CustomEvent.FLAT) {
+
+            if (args.length > 0) {
+                param = args[0];
             }
 
-            this.subscribers=newlist;
+            try {
+                ret = s.fn.call(scope, param, s.obj);
+            } catch(e) {
+                this.lastError = e;
+                // errors.push(e);
+                if (throwErrors) {
+                    throw e;
+                }
+            }
+        } else {
+            try {
+                ret = s.fn.call(scope, this.type, args, s.obj);
+            } catch(ex) {
+                this.lastError = ex;
+                if (throwErrors) {
+                    throw ex;
+                }
+            }
         }
 
-        return true;
+        return ret;
     },
 
     /**
@@ -284,13 +339,14 @@
      * @return {int} The number of listeners unsubscribed
      */
     unsubscribeAll: function() {
-        for (var i=0, len=this.subscribers.length; i<len; ++i) {
-            this._delete(len - 1 - i);
+        var l = this.subscribers.length, i;
+        for (i=l-1; i>-1; i--) {
+            this._delete(i);
         }
 
         this.subscribers=[];
 
-        return i;
+        return l;
     },
 
     /**
@@ -304,7 +360,8 @@
             delete s.obj;
         }
 
-        this.subscribers[index]=null;
+        // this.subscribers[index]=null;
+        this.subscribers.splice(index, 1);
     },
 
     /**
@@ -312,7 +369,7 @@
      */
     toString: function() {
          return "CustomEvent: " + "'" + this.type  + "', " + 
-             "scope: " + this.scope;
+             "context: " + this.scope;
 
     }
 };
@@ -323,12 +380,12 @@
  * Stores the subscriber information to be used when the event fires.
  * @param {Function} fn       The function to execute
  * @param {Object}   obj      An object to be passed along when the event fires
- * @param {boolean}  override If true, the obj passed in becomes the execution
- *                            scope of the listener
+ * @param {boolean}  overrideContext If true, the obj passed in becomes the execution
+ *                            context of the listener
  * @class Subscriber
  * @constructor
  */
-YAHOO.util.Subscriber = function(fn, obj, override) {
+YAHOO.util.Subscriber = function(fn, obj, overrideContext) {
 
     /**
      * The callback that will be execute when the event fires
@@ -346,32 +403,32 @@
     this.obj = YAHOO.lang.isUndefined(obj) ? null : obj;
 
     /**
-     * The default execution scope for the event listener is defined when the
+     * The default execution context for the event listener is defined when the
      * event is created (usually the object which contains the event).
-     * By setting override to true, the execution scope becomes the custom
-     * object passed in by the subscriber.  If override is an object, that 
-     * object becomes the scope.
-     * @property override
+     * By setting overrideContext to true, the execution context becomes the custom
+     * object passed in by the subscriber.  If overrideContext is an object, that 
+     * object becomes the context.
+     * @property overrideContext
      * @type boolean|object
      */
-    this.override = override;
+    this.overrideContext = overrideContext;
 
 };
 
 /**
- * Returns the execution scope for this listener.  If override was set to true
- * the custom obj will be the scope.  If override is an object, that is the
- * scope, otherwise the default scope will be used.
+ * Returns the execution context for this listener.  If overrideContext was set to true
+ * the custom obj will be the context.  If overrideContext is an object, that is the
+ * context, otherwise the default context will be used.
  * @method getScope
- * @param {Object} defaultScope the scope to use if this listener does not
+ * @param {Object} defaultScope the context to use if this listener does not
  *                              override it.
  */
 YAHOO.util.Subscriber.prototype.getScope = function(defaultScope) {
-    if (this.override) {
-        if (this.override === true) {
+    if (this.overrideContext) {
+        if (this.overrideContext === true) {
             return this.obj;
         } else {
-            return this.override;
+            return this.overrideContext;
         }
     }
     return defaultScope;
@@ -400,7 +457,7 @@
  */
 YAHOO.util.Subscriber.prototype.toString = function() {
     return "Subscriber { obj: " + this.obj  + 
-           ", override: " +  (this.override || "no") + " }";
+           ", overrideContext: " +  (this.overrideContext || "no") + " }";
 };
 
 /**
@@ -436,7 +493,7 @@
          * @static
          * @private
          */
-        var loadComplete =  false;
+        var loadComplete =  false,
 
         /**
          * Cache of wrapped listeners
@@ -445,8 +502,9 @@
          * @static
          * @private
          */
-        var listeners = [];
+        listeners = [],
 
+
         /**
          * User-defined unload function that will be fired before all events
          * are detached
@@ -455,26 +513,9 @@
          * @static
          * @private
          */
-        var unloadListeners = [];
+        unloadListeners = [],
 
         /**
-         * Cache of DOM0 event handlers to work around issues with DOM2 events
-         * in Safari
-         * @property legacyEvents
-         * @static
-         * @private
-         */
-        var legacyEvents = [];
-
-        /**
-         * Listener stack for DOM0 events
-         * @property legacyHandlers
-         * @static
-         * @private
-         */
-        var legacyHandlers = [];
-
-        /**
          * The number of times to poll after window.onload.  This number is
          * increased if additional late-bound handlers are requested after
          * the page load.
@@ -482,7 +523,7 @@
          * @static
          * @private
          */
-        var retryCount = 0;
+        retryCount = 0,
 
         /**
          * onAvailable listeners
@@ -490,23 +531,15 @@
          * @static
          * @private
          */
-        var onAvailStack = [];
+        onAvailStack = [],
 
         /**
-         * Lookup table for legacy events
-         * @property legacyMap
-         * @static
-         * @private
-         */
-        var legacyMap = [];
-
-        /**
          * Counter for auto id generation
          * @property counter
          * @static
          * @private
          */
-        var counter = 0;
+        counter = 0,
         
         /**
          * Normalized keycodes for webkit/safari
@@ -516,7 +549,7 @@
          * @static
          * @final
          */
-        var webkitKeymap = {
+         webkitKeymap = {
             63232: 38, // up
             63233: 40, // down
             63234: 37, // left
@@ -525,15 +558,22 @@
             63277: 34, // page down
             25: 9      // SHIFT-TAB (Safari provides a different key code in
                        // this case, even though the shiftKey modifier is set)
-        };
+        },
 
+		isIE = YAHOO.env.ua.ie,
+
+        // String constants used by the addFocusListener and removeFocusListener methods
+		
+       	FOCUSIN = "focusin",
+       	FOCUSOUT = "focusout";
+
         return {
 
             /**
              * The number of times we should look for elements that are not
              * in the DOM at the time the event is requested after the document
-             * has been loaded.  The default is 4000@amp;10 ms, so it will poll
-             * for 40 seconds or until all outstanding handlers are bound
+             * has been loaded.  The default is 500@amp;40 ms, so it will poll
+             * for 20 seconds or until all outstanding handlers are bound
              * (whichever comes first).
              * @property POLL_RETRYS
              * @type int
@@ -540,7 +580,7 @@
              * @static
              * @final
              */
-            POLL_RETRYS: 4000,
+            POLL_RETRYS: 500,
 
             /**
              * The poll interval in milliseconds
@@ -549,7 +589,7 @@
              * @static
              * @final
              */
-            POLL_INTERVAL: 10,
+            POLL_INTERVAL: 40,
 
             /**
              * Element to bind, int constant
@@ -579,7 +619,7 @@
             FN: 2,
 
             /**
-             * Function wrapped for scope correction and cleanup, int constant
+             * Function wrapped for context correction and cleanup, int constant
              * @property WFN
              * @type int
              * @static
@@ -599,7 +639,7 @@
             UNLOAD_OBJ: 3,
 
             /**
-             * Adjusted scope, either the element we are registering the event
+             * Adjusted context, either the element we are registering the event
              * on or the custom object passed in by the listener, int constant
              * @property ADJ_SCOPE
              * @type int
@@ -618,7 +658,7 @@
             OBJ: 5,
 
             /**
-             * The original scope parameter passed into addListener
+             * The original context parameter passed into addListener
              * @property OVERRIDE
              * @type int
              * @static
@@ -627,6 +667,15 @@
             OVERRIDE: 6,
 
             /**
+             * The original capture parameter passed into addListener
+             * @property CAPTURE
+             * @type int
+             * @static
+             * @final
+             */
+			CAPTURE: 7,
+
+            /**
              * addListener/removeListener can throw errors in unexpected scenarios.
              * These errors are suppressed, the method returns false, and this property
              * is set
@@ -662,7 +711,7 @@
              * @static
              * @deprecated use YAHOO.env.ua.ie
              */
-            isIE: YAHOO.env.ua.ie,
+            isIE: isIE,
 
             /**
              * poll handle
@@ -680,7 +729,20 @@
              */
              _dri: null,
 
+
             /**
+             * Map of special event types
+             * @property _specialTypes
+             * @static
+             * @private
+             */
+			_specialTypes: {
+				focusin: (isIE ? "focusin" : "focus"),
+				focusout: (isIE ? "focusout" : "blur")
+			},
+
+
+            /**
              * True when the document is initially usable
              * @property DOMReady
              * @type boolean
@@ -689,6 +751,18 @@
             DOMReady: false,
 
             /**
+             * Errors thrown by subscribers of custom events are caught
+             * and the error message is written to the debug console.  If
+             * this property is set to true, it will also re-throw the
+             * error.
+             * @property throwErrors
+             * @type boolean
+             * @default false
+             */
+            throwErrors: false,
+
+
+            /**
              * @method startInterval
              * @static
              * @private
@@ -695,9 +769,10 @@
              */
             startInterval: function() {
                 if (!this._interval) {
-                    var self = this;
-                    var callback = function() { self._tryPreloadAttach(); };
-                    this._interval = setInterval(callback, this.POLL_INTERVAL);
+                    // var self = this;
+                    // var callback = function() { self._tryPreloadAttach(); };
+                    // this._interval = setInterval(callback, this.POLL_INTERVAL);
+                    this._interval = YAHOO.lang.later(this.POLL_INTERVAL, this, this._tryPreloadAttach, null, true);
                 }
             },
 
@@ -714,29 +789,31 @@
              *
              * @method onAvailable
              *
-             * @param {string||string[]}   p_id the id of the element, or an array
+             * @param {string||string[]}   id the id of the element, or an array
              * of ids to look for.
-             * @param {function} p_fn what to execute when the element is found.
-             * @param {object}   p_obj an optional object to be passed back as
-             *                   a parameter to p_fn.
-             * @param {boolean|object}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj, if set to an object it
-             *                   will execute in the scope of that object
+             * @param {function} fn what to execute when the element is found.
+             * @param {object}   obj an optional object to be passed back as
+             *                   a parameter to fn.
+             * @param {boolean|object}  overrideContext If set to true, fn will execute
+             *                   in the context of obj, if set to an object it
+             *                   will execute in the context of that object
              * @param checkContent {boolean} check child node readiness (onContentReady)
              * @static
              */
-            onAvailable: function(p_id, p_fn, p_obj, p_override, checkContent) {
+            onAvailable: function(id, fn, obj, overrideContext, checkContent) {
 
-                var a = (YAHOO.lang.isString(p_id)) ? [p_id] : p_id;
+                var a = (YAHOO.lang.isString(id)) ? [id] : id;
 
                 for (var i=0; i<a.length; i=i+1) {
                     onAvailStack.push({id:         a[i], 
-                                       fn:         p_fn, 
-                                       obj:        p_obj, 
-                                       override:   p_override, 
+                                       fn:         fn, 
+                                       obj:        obj, 
+                                       overrideContext:   overrideContext, 
                                        checkReady: checkContent });
                 }
+
                 retryCount = this.POLL_RETRYS;
+
                 this.startInterval();
             },
 
@@ -750,18 +827,18 @@
              *
              * @method onContentReady
              *
-             * @param {string}   p_id the id of the element to look for.
-             * @param {function} p_fn what to execute when the element is ready.
-             * @param {object}   p_obj an optional object to be passed back as
-             *                   a parameter to p_fn.
-             * @param {boolean|object}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj.  If an object, p_fn will
-             *                   exectute in the scope of that object
+             * @param {string}   id the id of the element to look for.
+             * @param {function} fn what to execute when the element is ready.
+             * @param {object}   obj an optional object to be passed back as
+             *                   a parameter to fn.
+             * @param {boolean|object}  overrideContext If set to true, fn will execute
+             *                   in the context of obj.  If an object, fn will
+             *                   exectute in the context of that object
              *
              * @static
              */
-            onContentReady: function(p_id, p_fn, p_obj, p_override) {
-                this.onAvailable(p_id, p_fn, p_obj, p_override, true);
+            onContentReady: function(id, fn, obj, overrideContext) {
+                this.onAvailable(id, fn, obj, overrideContext, true);
             },
 
             /**
@@ -787,37 +864,25 @@
              *
              * @method onDOMReady
              *
-             * @param {function} p_fn what to execute when the element is found.
-             * @param {object}   p_obj an optional object to be passed back as
-             *                   a parameter to p_fn.
-             * @param {boolean|object}  p_scope If set to true, p_fn will execute
-             *                   in the scope of p_obj, if set to an object it
-             *                   will execute in the scope of that object
+             * @param {function} fn what to execute when the element is found.
+             * @param {object}   obj an optional object to be passed back as
+             *                   a parameter to fn.
+             * @param {boolean|object}  overrideContext If set to true, fn will execute
+             *                   in the context of obj, if set to an object it
+             *                   will execute in the context of that object
              *
              * @static
              */
-            onDOMReady: function(p_fn, p_obj, p_override) {
-                if (this.DOMReady) {
-                    setTimeout(function() {
-                        var s = window;
-                        if (p_override) {
-                            if (p_override === true) {
-                                s = p_obj;
-                            } else {
-                                s = p_override;
-                            }
-                        }
-                        p_fn.call(s, "DOMReady", [], p_obj);
-                    }, 0);
-                } else {
-                    this.DOMReadyEvent.subscribe(p_fn, p_obj, p_override);
-                }
+            // onDOMReady: function(fn, obj, overrideContext) {
+            onDOMReady: function() {
+                this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent, arguments);
             },
 
+
             /**
              * Appends an event handler
              *
-             * @method addListener
+             * @method _addListener
              *
              * @param {String|HTMLElement|Array|NodeList} el An id, an element 
              *  reference, or a collection of ids and/or elements to assign the 
@@ -826,20 +891,21 @@
              * @param {Function} fn        The method the event invokes
              * @param {Object}   obj    An arbitrary object that will be 
              *                             passed as a parameter to the handler
-             * @param {Boolean|object}  override  If true, the obj passed in becomes
-             *                             the execution scope of the listener. If an
+             * @param {Boolean|object}  overrideContext  If true, the obj passed in becomes
+             *                             the execution context of the listener. If an
              *                             object, this object becomes the execution
-             *                             scope.
+             *                             context.
+             * @param {boolen}      capture capture or bubble phase
              * @return {Boolean} True if the action was successful or defered,
              *                        false if one or more of the elements 
              *                        could not have the listener attached,
              *                        or if the operation throws an exception.
+             * @private
              * @static
              */
-            addListener: function(el, sType, fn, obj, override) {
+            _addListener: function(el, sType, fn, obj, overrideContext, bCapture) {
 
                 if (!fn || !fn.call) {
-// throw new TypeError(sType + " addListener call failed, callback undefined");
                     return false;
                 }
 
@@ -851,7 +917,7 @@
                                        sType, 
                                        fn, 
                                        obj, 
-                                       override) && ok;
+                                       overrideContext) && ok;
                     }
                     return ok;
 
@@ -869,7 +935,7 @@
                     } else {
                         // defer adding the event until the element is available
                         this.onAvailable(el, function() {
-                           YAHOO.util.Event.on(el, sType, fn, obj, override);
+                           YAHOO.util.Event._addListener(el, sType, fn, obj, overrideContext, bCapture);
                         });
 
                         return true;
@@ -888,20 +954,20 @@
                 // handles explicitly during our one unload event.
                 if ("unload" == sType && obj !== this) {
                     unloadListeners[unloadListeners.length] =
-                            [el, sType, fn, obj, override];
+                            [el, sType, fn, obj, overrideContext];
                     return true;
                 }
 
 
-                // if the user chooses to override the scope, we use the custom
-                // object passed in, otherwise the executing scope will be the
+                // if the user chooses to override the context, we use the custom
+                // object passed in, otherwise the executing context will be the
                 // HTML element that the event is registered on
-                var scope = el;
-                if (override) {
-                    if (override === true) {
-                        scope = obj;
+                var context = el;
+                if (overrideContext) {
+                    if (overrideContext === true) {
+                        context = obj;
                     } else {
-                        scope = override;
+                        context = overrideContext;
                     }
                 }
 
@@ -908,126 +974,177 @@
                 // wrap the function so we can return the obj object when
                 // the event fires;
                 var wrappedFn = function(e) {
-                        return fn.call(scope, YAHOO.util.Event.getEvent(e, el), 
+                        return fn.call(context, YAHOO.util.Event.getEvent(e, el), 
                                 obj);
                     };
 
-                var li = [el, sType, fn, wrappedFn, scope, obj, override];
+                var li = [el, sType, fn, wrappedFn, context, obj, overrideContext, bCapture];
                 var index = listeners.length;
                 // cache the listener so we can try to automatically unload
                 listeners[index] = li;
 
-                if (this.useLegacyEvent(el, sType)) {
-                    var legacyIndex = this.getLegacyIndex(el, sType);
+                try {
+                    this._simpleAdd(el, sType, wrappedFn, bCapture);
+                } catch(ex) {
+                    // handle an error trying to attach an event.  If it fails
+                    // we need to clean up the cache
+                    this.lastError = ex;
+                    this.removeListener(el, sType, fn);
+                    return false;
+                }
 
-                    // Add a new dom0 wrapper if one is not detected for this
-                    // element
-                    if ( legacyIndex == -1 || 
-                                el != legacyEvents[legacyIndex][0] ) {
+                return true;
+                
+            },
 
-                        legacyIndex = legacyEvents.length;
-                        legacyMap[el.id + sType] = legacyIndex;
+            /**
+             * Checks to see if the type requested is a special type 
+			 * (as defined by the _specialTypes hash), and (if so) returns 
+			 * the special type name.
+             *
+             * @method _getType
+             *
+             * @param {String}   sType     The type to look up
+             * @private
+             */
+			_getType: function (type) {
+			
+				return this._specialTypes[type] || type;
+				
+			},
 
-                        // cache the signature for the DOM0 event, and 
-                        // include the existing handler for the event, if any
-                        legacyEvents[legacyIndex] = 
-                            [el, sType, el["on" + sType]];
-                        legacyHandlers[legacyIndex] = [];
 
-                        el["on" + sType] = 
-                            function(e) {
-                                YAHOO.util.Event.fireLegacyEvent(
-                                    YAHOO.util.Event.getEvent(e), legacyIndex);
-                            };
-                    }
+            /**
+             * Appends an event handler
+             *
+             * @method addListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to assign the 
+             *  listener to.
+             * @param {String}   sType     The type of event to append
+             * @param {Function} fn        The method the event invokes
+             * @param {Object}   obj    An arbitrary object that will be 
+             *                             passed as a parameter to the handler
+             * @param {Boolean|object}  overrideContext  If true, the obj passed in becomes
+             *                             the execution context of the listener. If an
+             *                             object, this object becomes the execution
+             *                             context.
+             * @return {Boolean} True if the action was successful or defered,
+             *                        false if one or more of the elements 
+             *                        could not have the listener attached,
+             *                        or if the operation throws an exception.
+             * @static
+             */
+            addListener: function (el, sType, fn, obj, overrideContext) {
 
-                    // add a reference to the wrapped listener to our custom
-                    // stack of events
-                    //legacyHandlers[legacyIndex].push(index);
-                    legacyHandlers[legacyIndex].push(li);
+				var capture = ((sType == FOCUSIN || sType == FOCUSOUT) && !YAHOO.env.ua.ie) ? true : false;
 
-                } else {
-                    try {
-                        this._simpleAdd(el, sType, wrappedFn, false);
-                    } catch(ex) {
-                        // handle an error trying to attach an event.  If it fails
-                        // we need to clean up the cache
-                        this.lastError = ex;
-                        this.removeListener(el, sType, fn);
-                        return false;
-                    }
-                }
+                return this._addListener(el, this._getType(sType), fn, obj, overrideContext, capture);
 
-                return true;
-                
-            },
+        	},
 
+
             /**
-             * When using legacy events, the handler is routed to this object
-             * so we can fire our custom listener stack.
-             * @method fireLegacyEvent
+             * Attaches a focusin event listener to the specified element for 
+ 			 * the purpose of listening for the focus event on the element's 
+             * descendants.
+             * @method addFocusListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to assign the 
+             *  listener to.
+             * @param {Function} fn        The method the event invokes
+             * @param {Object}   obj    An arbitrary object that will be 
+             *                             passed as a parameter to the handler
+             * @param {Boolean|object}  overrideContext  If true, the obj passed in becomes
+             *                             the execution context of the listener. If an
+             *                             object, this object becomes the execution
+             *                             context.
+             * @return {Boolean} True if the action was successful or defered,
+             *                        false if one or more of the elements 
+             *                        could not have the listener attached,
+             *                        or if the operation throws an exception.
              * @static
-             * @private
+			* @deprecated use YAHOO.util.Event.on and specify "focusin" as the event type.
              */
-            fireLegacyEvent: function(e, legacyIndex) {
-                var ok=true,le,lh,li,scope,ret;
-                
-                lh = legacyHandlers[legacyIndex];
-                for (var i=0,len=lh.length; i<len; ++i) {
-                    li = lh[i];
-                    if ( li && li[this.WFN] ) {
-                        scope = li[this.ADJ_SCOPE];
-                        ret = li[this.WFN].call(scope, e);
-                        ok = (ok && ret);
-                    }
-                }
+            addFocusListener: function (el, fn, obj, overrideContext) {
+                return this.on(el, FOCUSIN, fn, obj, overrideContext);
+            },          
 
-                // Fire the original handler if we replaced one.  We fire this
-                // after the other events to keep stopPropagation/preventDefault
-                // that happened in the DOM0 handler from touching our DOM2
-                // substitute
-                le = legacyEvents[legacyIndex];
-                if (le && le[2]) {
-                    le[2](e);
-                }
-                
-                return ok;
-            },
 
             /**
-             * Returns the legacy event index that matches the supplied 
-             * signature
-             * @method getLegacyIndex
+             * Removes a focusin event listener to the specified element for 
+			 * the purpose of listening for the focus event on the element's 
+             * descendants.
+             *
+             * @method removeFocusListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to remove
+             *  the listener from.
+             * @param {Function} fn the method the event invokes.  If fn is
+             *  undefined, then all event handlers for the type of event are 
+             *  removed.
+             * @return {boolean} true if the unbind was successful, false 
+             *  otherwise.
              * @static
-             * @private
+         	 * @deprecated use YAHOO.util.Event.removeListener and specify "focusin" as the event type.
              */
-            getLegacyIndex: function(el, sType) {
-                var key = this.generateId(el) + sType;
-                if (typeof legacyMap[key] == "undefined") { 
-                    return -1;
-                } else {
-                    return legacyMap[key];
-                }
+            removeFocusListener: function (el, fn) { 
+                return this.removeListener(el, FOCUSIN, fn);
             },
 
             /**
-             * Logic that determines when we should automatically use legacy
-             * events instead of DOM2 events.  Currently this is limited to old
-             * Safari browsers with a broken preventDefault
-             * @method useLegacyEvent
+             * Attaches a focusout event listener to the specified element for 
+			 * the purpose of listening for the blur event on the element's 
+			 * descendants.
+             *
+             * @method addBlurListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to assign the 
+             *  listener to.
+             * @param {Function} fn        The method the event invokes
+             * @param {Object}   obj    An arbitrary object that will be 
+             *                             passed as a parameter to the handler
+             * @param {Boolean|object}  overrideContext  If true, the obj passed in becomes
+             *                             the execution context of the listener. If an
+             *                             object, this object becomes the execution
+             *                             context.
+             * @return {Boolean} True if the action was successful or defered,
+             *                        false if one or more of the elements 
+             *                        could not have the listener attached,
+             *                        or if the operation throws an exception.
              * @static
-             * @private
+         	 * @deprecated use YAHOO.util.Event.on and specify "focusout" as the event type.
              */
-            useLegacyEvent: function(el, sType) {
-                if (this.webkit && ("click"==sType || "dblclick"==sType)) {
-                    var v = parseInt(this.webkit, 10);
-                    if (!isNaN(v) && v<418) {
-                        return true;
-                    }
-                }
-                return false;
+            addBlurListener: function (el, fn, obj, overrideContext) {
+                return this.on(el, FOCUSOUT, fn, obj, overrideContext);
+            },          
+
+            /**
+             * Removes a focusout event listener to the specified element for 
+			 * the purpose of listening for the blur event on the element's 
+			 * descendants.
+             *
+             * @method removeBlurListener
+             *
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to remove
+             *  the listener from.
+             * @param {Function} fn the method the event invokes.  If fn is
+             *  undefined, then all event handlers for the type of event are 
+             *  removed.
+             * @return {boolean} true if the unbind was successful, false 
+             *  otherwise.
+             * @static
+         	 * @deprecated use YAHOO.util.Event.removeListener and specify "focusout" as the event type.
+             */
+            removeBlurListener: function (el, fn) { 
+                return this.removeListener(el, FOCUSOUT, fn);
             },
-                    
+
             /**
              * Removes an event listener
              *
@@ -1047,6 +1164,8 @@
             removeListener: function(el, sType, fn) {
                 var i, len, li;
 
+				sType = this._getType(sType);
+
                 // The el argument can be a string
                 if (typeof el == "string") {
                     el = this.getEl(el);
@@ -1053,7 +1172,7 @@
                 // The el argument can be an array of elements or element ids.
                 } else if ( this._isValidCollection(el)) {
                     var ok = true;
-                    for (i=0,len=el.length; i<len; ++i) {
+                    for (i=el.length-1; i>-1; i--) {
                         ok = ( this.removeListener(el[i], sType, fn) && ok );
                     }
                     return ok;
@@ -1066,14 +1185,14 @@
 
                 if ("unload" == sType) {
 
-                    for (i=0, len=unloadListeners.length; i<len; i++) {
+                    for (i=unloadListeners.length-1; i>-1; i--) {
                         li = unloadListeners[i];
                         if (li && 
                             li[0] == el && 
                             li[1] == sType && 
                             li[2] == fn) {
-                                //unloadListeners.splice(i, 1);
-                                unloadListeners[i]=null;
+                                unloadListeners.splice(i, 1);
+                                // unloadListeners[i]=null;
                                 return true;
                         }
                     }
@@ -1089,7 +1208,7 @@
                 var index = arguments[3];
   
                 if ("undefined" === typeof index) {
-                    index = this._getCacheIndex(el, sType, fn);
+                    index = this._getCacheIndex(listeners, el, sType, fn);
                 }
 
                 if (index >= 0) {
@@ -1101,37 +1220,20 @@
                 }
 
 
-                if (this.useLegacyEvent(el, sType)) {
-                    var legacyIndex = this.getLegacyIndex(el, sType);
-                    var llist = legacyHandlers[legacyIndex];
-                    if (llist) {
-                        for (i=0, len=llist.length; i<len; ++i) {
-                            li = llist[i];
-                            if (li && 
-                                li[this.EL] == el && 
-                                li[this.TYPE] == sType && 
-                                li[this.FN] == fn) {
-                                    //llist.splice(i, 1);
-                                    llist[i]=null;
-                                    break;
-                            }
-                        }
-                    }
+				var bCapture = cacheItem[this.CAPTURE] === true ? true : false;
 
-                } else {
-                    try {
-                        this._simpleRemove(el, sType, cacheItem[this.WFN], false);
-                    } catch(ex) {
-                        this.lastError = ex;
-                        return false;
-                    }
+                try {
+                    this._simpleRemove(el, sType, cacheItem[this.WFN], bCapture);
+                } catch(ex) {
+                    this.lastError = ex;
+                    return false;
                 }
 
                 // removed the wrapped handler
                 delete listeners[index][this.WFN];
                 delete listeners[index][this.FN];
-                //listeners.splice(index, 1);
-                listeners[index]=null;
+                listeners.splice(index, 1);
+                // listeners[index]=null;
 
                 return true;
 
@@ -1164,12 +1266,14 @@
              * @return {HTMLElement} the normized node
              * @static
              */
-            resolveTextNode: function(node) {
-                if (node && 3 == node.nodeType) {
-                    return node.parentNode;
-                } else {
-                    return node;
-                }
+            resolveTextNode: function(n) {
+                try {
+                    if (n && 3 == n.nodeType) {
+                        return n.parentNode;
+                    }
+                } catch(e) { }
+
+                return n;
             },
 
             /**
@@ -1331,30 +1435,6 @@
                     }
                 }
 
-                // IE events that target non-browser objects (e.g., VML
-                // canvas) will sometimes throw errors when you try to
-                // inspect the properties of the event target.  We try to
-                // detect this condition, and provide a dummy target (the bound
-                // element) to eliminate spurious errors.  
-
-                // the implementation caused unexpected results in some 
-                // implementations, so this has been rolled back for now
-                /* 
-                if (ev && this.isIE) {
-
-                    try {
-
-                        var el = ev.srcElement;
-
-                    } catch(ex) {
-
-                         
-                        ev.target = boundEl;
-                    }
-
-                }
-                */
-
                 return ev;
             },
 
@@ -1368,7 +1448,7 @@
             getCharCode: function(ev) {
                 var code = ev.keyCode || ev.charCode || 0;
 
-                // webkit normalization
+                // webkit key normalization
                 if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
                     code = webkitKeymap[code];
                 }
@@ -1382,9 +1462,9 @@
              * @static
              * @private
              */
-            _getCacheIndex: function(el, sType, fn) {
-                for (var i=0,len=listeners.length; i<len; ++i) {
-                    var li = listeners[i];
+            _getCacheIndex: function(a, el, sType, fn) {
+                for (var i=0, l=a.length; i<l; i=i+1) {
+                    var li = a[i];
                     if ( li                 && 
                          li[this.FN] == fn  && 
                          li[this.EL] == el  && 
@@ -1478,7 +1558,7 @@
              * Custom event the fires when the dom is initially usable
              * @event DOMReadyEvent
              */
-            DOMReadyEvent: new YAHOO.util.CustomEvent("DOMReady", this),
+            DOMReadyEvent: new YAHOO.util.CustomEvent("DOMReady", YAHOO, 0, 0, 1),
 
             /**
              * hook up any deferred listeners
@@ -1501,11 +1581,6 @@
                     // before the window load notification
                     EU._tryPreloadAttach();
 
-                    // Remove the listener to assist with the IE memory issue, but not
-                    // for other browsers because FF 1.0x does not like it.
-                    //if (this.isIE) {
-                        //EU._simpleRemove(window, "load", EU._load);
-                    //}
                 }
             },
 
@@ -1539,8 +1614,18 @@
              */
             _tryPreloadAttach: function() {
 
+                if (onAvailStack.length === 0) {
+                    retryCount = 0;
+                    if (this._interval) {
+                        // clearInterval(this._interval);
+                        this._interval.cancel();
+                        this._interval = null;
+                    } 
+                    return;
+                }
+
                 if (this.locked) {
-                    return false;
+                    return;
                 }
 
                 if (this.isIE) {
@@ -1547,10 +1632,9 @@
                     // Hold off if DOMReady has not fired and check current
                     // readyState to protect against the IE operation aborted
                     // issue.
-                    //if (!this.DOMReady || "complete" !== document.readyState) {
                     if (!this.DOMReady) {
                         this.startInterval();
-                        return false;
+                        return;
                     }
                 }
 
@@ -1563,7 +1647,7 @@
                 // tested appropriately
                 var tryAgain = !loadComplete;
                 if (!tryAgain) {
-                    tryAgain = (retryCount > 0);
+                    tryAgain = (retryCount > 0 && onAvailStack.length > 0);
                 }
 
                 // onAvailable
@@ -1570,43 +1654,31 @@
                 var notAvail = [];
 
                 var executeItem = function (el, item) {
-                    var scope = el;
-                    if (item.override) {
-                        if (item.override === true) {
-                            scope = item.obj;
+                    var context = el;
+                    if (item.overrideContext) {
+                        if (item.overrideContext === true) {
+                            context = item.obj;
                         } else {
-                            scope = item.override;
+                            context = item.overrideContext;
                         }
                     }
-                    item.fn.call(scope, item.obj);
+                    item.fn.call(context, item.obj);
                 };
 
-                var i,len,item,el;
+                var i, len, item, el, ready=[];
 
-                // onAvailable
-                for (i=0,len=onAvailStack.length; i<len; ++i) {
+                // onAvailable onContentReady
+                for (i=0, len=onAvailStack.length; i<len; i=i+1) {
                     item = onAvailStack[i];
-                    if (item && !item.checkReady) {
+                    if (item) {
                         el = this.getEl(item.id);
                         if (el) {
-                            executeItem(el, item);
-                            onAvailStack[i] = null;
-                        } else {
-                            notAvail.push(item);
-                        }
-                    }
-                }
-
-                // onContentReady
-                for (i=0,len=onAvailStack.length; i<len; ++i) {
-                    item = onAvailStack[i];
-                    if (item && item.checkReady) {
-                        el = this.getEl(item.id);
-
-                        if (el) {
-                            // The element is available, but not necessarily ready
-                            // @todo should we test parentNode.nextSibling?
-                            if (loadComplete || el.nextSibling) {
+                            if (item.checkReady) {
+                                if (loadComplete || el.nextSibling || !tryAgain) {
+                                    ready.push(item);
+                                    onAvailStack[i] = null;
+                                }
+                            } else {
                                 executeItem(el, item);
                                 onAvailStack[i] = null;
                             }
@@ -1615,21 +1687,35 @@
                         }
                     }
                 }
+                
+                // make sure onContentReady fires after onAvailable
+                for (i=0, len=ready.length; i<len; i=i+1) {
+                    item = ready[i];
+                    executeItem(this.getEl(item.id), item);
+                }
 
-                retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
 
+                retryCount--;
+
                 if (tryAgain) {
-                    // we may need to strip the nulled out items here
+                    for (i=onAvailStack.length-1; i>-1; i--) {
+                        item = onAvailStack[i];
+                        if (!item || !item.id) {
+                            onAvailStack.splice(i, 1);
+                        }
+                    }
+
                     this.startInterval();
                 } else {
-                    clearInterval(this._interval);
-                    this._interval = null;
+                    if (this._interval) {
+                        // clearInterval(this._interval);
+                        this._interval.cancel();
+                        this._interval = null;
+                    }
                 }
 
                 this.locked = false;
 
-                return true;
-
             },
 
             /**
@@ -1648,11 +1734,9 @@
                 var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
                 var elListeners = this.getListeners(oEl, sType), i, len;
                 if (elListeners) {
-                    for (i=0,len=elListeners.length; i<len ; ++i) {
+                    for (i=elListeners.length-1; i>-1; i--) {
                         var l = elListeners[i];
-                        // can't use the index on the changing collection
-                        this.removeListener(oEl, l.type, l.fn, l.index);
-                        //this.removeListener(oEl, l.type, l.fn);
+                        this.removeListener(oEl, l.type, l.fn);
                     }
                 }
 
@@ -1674,8 +1758,8 @@
              * &nbsp;&nbsp;type:   (string)   the type of event
              * &nbsp;&nbsp;fn:     (function) the callback supplied to addListener
              * &nbsp;&nbsp;obj:    (object)   the custom object supplied to addListener
-             * &nbsp;&nbsp;adjust: (boolean|object)  whether or not to adjust the default scope
-             * &nbsp;&nbsp;scope: (boolean)  the derived scope based on the adjust parameter
+             * &nbsp;&nbsp;adjust: (boolean|object)  whether or not to adjust the default context
+             * &nbsp;&nbsp;scope: (boolean)  the derived context based on the adjust parameter
              * &nbsp;&nbsp;index:  (int)      its position in the Event util listener cache
              * @static
              */           
@@ -1686,6 +1770,7 @@
                 } else if (sType === "unload") {
                     searchLists = [unloadListeners];
                 } else {
+					sType = this._getType(sType);
                     searchLists = [listeners];
                 }
 
@@ -1693,7 +1778,7 @@
 
                 for (var j=0;j<searchLists.length; j=j+1) {
                     var searchList = searchLists[j];
-                    if (searchList && searchList.length > 0) {
+                    if (searchList) {
                         for (var i=0,len=searchList.length; i<len ; ++i) {
                             var l = searchList[i];
                             if ( l  && l[this.EL] === oEl && 
@@ -1723,79 +1808,45 @@
              */
             _unload: function(e) {
 
-                var EU = YAHOO.util.Event, i, j, l, len, index;
+                var EU = YAHOO.util.Event, i, j, l, len, index,
+                         ul = unloadListeners.slice(), context;
 
                 // execute and clear stored unload listeners
-                for (i=0,len=unloadListeners.length; i<len; ++i) {
-                    l = unloadListeners[i];
+                for (i=0, len=unloadListeners.length; i<len; ++i) {
+                    l = ul[i];
                     if (l) {
-                        var scope = window;
+                        context = window;
                         if (l[EU.ADJ_SCOPE]) {
                             if (l[EU.ADJ_SCOPE] === true) {
-                                scope = l[EU.UNLOAD_OBJ];
+                                context = l[EU.UNLOAD_OBJ];
                             } else {
-                                scope = l[EU.ADJ_SCOPE];
+                                context = l[EU.ADJ_SCOPE];
                             }
                         }
-                        l[EU.FN].call(scope, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
-                        unloadListeners[i] = null;
-                        l=null;
-                        scope=null;
+                        l[EU.FN].call(context, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
+                        ul[i] = null;
                     }
                 }
 
+                l = null;
+                context = null;
                 unloadListeners = null;
 
-                // call clearAttributes or remove listeners to handle IE memory leaks
-                if (YAHOO.env.ua.ie && listeners && listeners.length > 0) {
-                    j = listeners.length;
-                    while (j) {
-                        index = j-1;
-                        l = listeners[index];
+                // Remove listeners to handle IE memory leaks
+                // 2.5.0 listeners are removed for all browsers again.  FireFox preserves
+                // at least some listeners between page refreshes, potentially causing
+                // errors during page load (mouseover listeners firing before they
+                // should if the user moves the mouse at the correct moment).
+                if (listeners) {
+                    for (j=listeners.length-1; j>-1; j--) {
+                        l = listeners[j];
                         if (l) {
-                            //try {
-                                //l[EU.EL].clearAttributes(); // errors on window objects
-                            //} catch(ex) {
-                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
-                            //}
+                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], j);
                         } 
-                        j--;
                     }
                     l=null;
                 }
 
-                /*
-                // remove all listeners
-                if (listeners && listeners.length > 0) {
-                    j = listeners.length;
-                    while (j) {
-                        index = j-1;
-                        l = listeners[index];
-                        if (l) {
-                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
-                        } 
-                        j = j - 1;
-                    }
-                    l=null;
-                }
-                */
-
-                /*
-                // kill legacy events
-                for (i=0,len=legacyEvents.length; i<len; ++i) {
-                    // dereference the element
-                    //delete legacyEvents[i][0];
-                    legacyEvents[i][0] = null;
-
-                    // delete the array item
-                    //delete legacyEvents[i];
-                    legacyEvents[i] = null;
-                }
-
-                */
-
-                legacyEvents = null;
-
                 EU._simpleRemove(window, "unload", EU._unload);
 
             },
@@ -1846,28 +1897,10 @@
              * @static
              * @deprecated still here for backwards compatibility
              */
-            regCE: function() {
-                // does nothing
-            },
+            regCE: function() {},
 
-/*
-            testIEReady: function (){
-                var n = document.createElement('p'), ready = false;
-                try {
-                    // throws an error until the doc is ready
-                    n.doScroll('left'); 
-                    ready = true;
-                } catch(ex){ 
-                    // document is not ready
-                }
-
-                n = null;
-                return ready;
-            },
-*/
-
             /**
-             * Adds a DOM event directly without the caching, cleanup, scope adj, etc
+             * Adds a DOM event directly without the caching, cleanup, context adj, etc
              *
              * @method _simpleAdd
              * @param {HTMLElement} el      the element to bind the handler to
@@ -1930,94 +1963,64 @@
          */
         EU.on = EU.addListener;
 
-        /////////////////////////////////////////////////////////////
-        // DOMReady
-        // based on work by: Dean Edwards/John Resig/Matthias Miller 
+        /**
+         * YAHOO.util.Event.onFocus is an alias for addFocusListener
+         * @method onFocus
+         * @see addFocusListener
+         * @static
+		 * @deprecated use YAHOO.util.Event.on and specify "focusin" as the event type.
+         */
+        EU.onFocus = EU.addFocusListener;
 
+        /**
+         * YAHOO.util.Event.onBlur is an alias for addBlurListener
+         * @method onBlur
+         * @see addBlurListener
+         * @static
+		 * @deprecated use YAHOO.util.Event.on and specify "focusout" as the event type.
+         */     
+        EU.onBlur = EU.addBlurListener;
+
+/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
+
         // Internet Explorer: use the readyState of a defered script.
         // This isolates what appears to be a safe moment to manipulate
         // the DOM prior to when the document's readyState suggests
         // it is safe to do so.
         if (EU.isIE) {
-
-            // Process onAvailable/onContentReady items when when the 
-            // DOM is ready.
-            YAHOO.util.Event.onDOMReady(
-                    YAHOO.util.Event._tryPreloadAttach,
-                    YAHOO.util.Event, true);
-
-            /*
-
-
-            var el, d=document, b=d.body;
-
-            // If the library is being injected after window.onload, it
-            // is not safe to document.write the script tag.  Detecting
-            // this state doesn't appear possible, so we expect a flag
-            // in YAHOO_config to be set if the library is being injected.
-            if (("undefined" !== typeof YAHOO_config) && YAHOO_config.injecting) {
-
-                el = document.createElement("script");
-                var p=d.getElementsByTagName("head")[0] || b;
-                p.insertBefore(el, p.firstChild);
-
-            } else {
-    d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');
-                el=document.getElementById("_yui_eu_dr");
-            }
-            
-
-            if (el) {
-                el.onreadystatechange = function() {
-                    if ("complete" === this.readyState) {
-                        this.parentNode.removeChild(this);
-                        YAHOO.util.Event._ready();
+            if (self !== self.top) {
+                document.onreadystatechange = function() {
+                    if (document.readyState == 'complete') {
+                        document.onreadystatechange = null;
+                        EU._ready();
                     }
                 };
             } else {
-                // The library was likely injected into the page
-                // rendering onDOMReady unreliable
-                // YAHOO.util.Event._ready();
-            }
 
-            el=null;
-
-            */
-
-/*
-            (function (){
+                // Process onAvailable/onContentReady items when the 
+                // DOM is ready.
+                YAHOO.util.Event.onDOMReady(
+                        YAHOO.util.Event._tryPreloadAttach,
+                        YAHOO.util.Event, true);
+                
                 var n = document.createElement('p');  
-                try {
-                    // throws an error if doc is not ready
-                    n.doScroll('left');
-                    n = null;
-                    YAHOO.util.Event._ready();
-                } catch (ex){
-                    n = null;
-setTimeout(arguments.callee, YAHOO.util.Event.POLL_INTERVAL);
-                }
-            })();
-*/
 
-            EU._dri = setInterval(function() {
-                var n = document.createElement('p');  
-                try {
-                    // throws an error if doc is not ready
-                    n.doScroll('left');
-                    clearInterval(EU._dri);
-                    EU._dri = null;
-                    EU._ready();
-                    n = null;
-                } catch (ex) { 
-                    n = null;
-                }
-            }, EU.POLL_INTERVAL); 
+                EU._dri = setInterval(function() {
+                    try {
+                        // throws an error if doc is not ready
+                        n.doScroll('left');
+                        clearInterval(EU._dri);
+                        EU._dri = null;
+                        EU._ready();
+                        n = null;
+                    } catch (ex) { 
+                    }
+                }, EU.POLL_INTERVAL); 
+            }
 
-        
-        // Safari: The document's readyState in Safari currently will
+        // The document's readyState in Safari currently will
         // change to loaded/complete before images are loaded.
-        //} else if (EU.webkit) {
-        } else if (EU.webkit) {
+        } else if (EU.webkit && EU.webkit < 525) {
 
             EU._dri = setInterval(function() {
                 var rs=document.readyState;
@@ -2029,11 +2032,9 @@
             }, EU.POLL_INTERVAL); 
 
         // FireFox and Opera: These browsers provide a event for this
-        // moment.
+        // moment.  The latest WebKit releases now support this event.
         } else {
 
-            // @todo will this fire when the library is injected?
-
             EU._simpleAdd(document, "DOMContentLoaded", EU._ready);
 
         }
@@ -2083,16 +2084,16 @@
      * @param p_fn       {function} the function to exectute when the event fires
      * @param p_obj      {Object}   An object to be passed along when the event 
      *                              fires
-     * @param p_override {boolean}  If true, the obj passed in becomes the 
+     * @param overrideContext {boolean}  If true, the obj passed in becomes the 
      *                              execution scope of the listener
      */
-    subscribe: function(p_type, p_fn, p_obj, p_override) {
+    subscribe: function(p_type, p_fn, p_obj, overrideContext) {
 
         this.__yui_events = this.__yui_events || {};
         var ce = this.__yui_events[p_type];
 
         if (ce) {
-            ce.subscribe(p_fn, p_obj, p_override);
+            ce.subscribe(p_fn, p_obj, overrideContext);
         } else {
             this.__yui_subscribers = this.__yui_subscribers || {};
             var subs = this.__yui_subscribers;
@@ -2100,7 +2101,7 @@
                 subs[p_type] = [];
             }
             subs[p_type].push(
-                { fn: p_fn, obj: p_obj, override: p_override } );
+                { fn: p_fn, obj: p_obj, overrideContext: overrideContext } );
         }
     },
 
@@ -2171,6 +2172,13 @@
      *      This is false by default.
      *    </li>
      *    <li>
+     *      fireOnce: if true, the custom event will only notify subscribers
+     *      once regardless of the number of times the event is fired.  In
+     *      addition, new subscribers will be executed immediately if the
+     *      event has already fired.
+     *      This is false by default.
+     *    </li>
+     *    <li>
      *      onSubscribeCallback: specifies a callback to execute when the
      *      event has a new subscriber.  This will fire immediately for
      *      each queued subscriber if any exist prior to the creation of
@@ -2184,17 +2192,15 @@
     createEvent: function(p_type, p_config) {
 
         this.__yui_events = this.__yui_events || {};
-        var opts = p_config || {};
-        var events = this.__yui_events;
+        var opts = p_config || {},
+            events = this.__yui_events, ce;
 
         if (events[p_type]) {
         } else {
 
-            var scope  = opts.scope  || this;
-            var silent = (opts.silent);
+            ce = new YAHOO.util.CustomEvent(p_type, opts.scope || this, opts.silent,
+                         YAHOO.util.CustomEvent.FLAT, opts.fireOnce);
 
-            var ce = new YAHOO.util.CustomEvent(p_type, scope, silent,
-                    YAHOO.util.CustomEvent.FLAT);
             events[p_type] = ce;
 
             if (opts.onSubscribeCallback) {
@@ -2206,7 +2212,7 @@
 
             if (qs) {
                 for (var i=0; i<qs.length; ++i) {
-                    ce.subscribe(qs[i].fn, qs[i].obj, qs[i].override);
+                    ce.subscribe(qs[i].fn, qs[i].obj, qs[i].overrideContext);
                 }
             }
         }
@@ -2224,8 +2230,6 @@
      *   <li>The custom object (if any) that was passed into the subscribe() 
      *       method</li>
      *   </ul>
-     * If the custom event has not been explicitly created, it will be
-     * created now with the default config, scoped to the host object
      * @method fireEvent
      * @param p_type    {string}  the type, or name of the event
      * @param arguments {Object*} an arbitrary set of parameters to pass to 
@@ -2233,7 +2237,7 @@
      * @return {boolean} the return value from CustomEvent.fire
      *                   
      */
-    fireEvent: function(p_type, arg1, arg2, etc) {
+    fireEvent: function(p_type) {
 
         this.__yui_events = this.__yui_events || {};
         var ce = this.__yui_events[p_type];
@@ -2266,6 +2270,10 @@
 
 };
 
+(function() {
+
+    var Event = YAHOO.util.Event, Lang = YAHOO.lang;
+
 /**
 * KeyListener is a utility that provides an easy interface for listening for
 * keydown/keyup events fired against DOM elements.
@@ -2339,11 +2347,11 @@
     */
     this.disabledEvent = new YAHOO.util.CustomEvent("disabled");
 
-    if (typeof attachTo == 'string') {
-        attachTo = document.getElementById(attachTo);
+    if (Lang.isString(attachTo)) {
+        attachTo = document.getElementById(attachTo); // No Dom util
     }
 
-    if (typeof handler == 'function') {
+    if (Lang.isFunction(handler)) {
         keyEvent.subscribe(handler);
     } else {
         keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
@@ -2372,26 +2380,22 @@
             e.altKey   == keyData.alt &&
             e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
             
-            var dataItem;
+            var dataItem, keys = keyData.keys, key;
 
-            if (keyData.keys instanceof Array) {
-                for (var i=0;i<keyData.keys.length;i++) {
-                    dataItem = keyData.keys[i];
+            if (YAHOO.lang.isArray(keys)) {
+                for (var i=0;i<keys.length;i++) {
+                    dataItem = keys[i];
+                    key = Event.getCharCode(e);
 
-                    if (dataItem == e.charCode ) {
-                        keyEvent.fire(e.charCode, e);
+                    if (dataItem == key) {
+                        keyEvent.fire(key, e);
                         break;
-                    } else if (dataItem == e.keyCode) {
-                        keyEvent.fire(e.keyCode, e);
-                        break;
                     }
                 }
             } else {
-                dataItem = keyData.keys;
-                if (dataItem == e.charCode ) {
-                    keyEvent.fire(e.charCode, e);
-                } else if (dataItem == e.keyCode) {
-                    keyEvent.fire(e.keyCode, e);
+                key = Event.getCharCode(e);
+                if (keys == key ) {
+                    keyEvent.fire(key, e);
                 }
             }
         }
@@ -2404,7 +2408,7 @@
     */
     this.enable = function() {
         if (! this.enabled) {
-            YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);
+            Event.on(attachTo, event, handleKeyPress);
             this.enabledEvent.fire(keyData);
         }
         /**
@@ -2422,7 +2426,7 @@
     */
     this.disable = function() {
         if (this.enabled) {
-            YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);
+            Event.removeListener(attachTo, event, handleKeyPress);
             this.disabledEvent.fire(keyData);
         }
         this.enabled = false;
@@ -2440,23 +2444,25 @@
 
 };
 
+var KeyListener = YAHOO.util.KeyListener;
+
 /**
-* Constant representing the DOM "keydown" event.
-* @property YAHOO.util.KeyListener.KEYDOWN
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYDOWN = "keydown";
+ * Constant representing the DOM "keydown" event.
+ * @property YAHOO.util.KeyListener.KEYDOWN
+ * @static
+ * @final
+ * @type String
+ */
+KeyListener.KEYDOWN = "keydown";
 
 /**
-* Constant representing the DOM "keyup" event.
-* @property YAHOO.util.KeyListener.KEYUP
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYUP = "keyup";
+ * Constant representing the DOM "keyup" event.
+ * @property YAHOO.util.KeyListener.KEYUP
+ * @static
+ * @final
+ * @type String
+ */
+KeyListener.KEYUP = "keyup";
 
 /**
  * keycode constants for a subset of the special keys
@@ -2464,7 +2470,7 @@
  * @static
  * @final
  */
-YAHOO.util.KeyListener.KEY = {
+KeyListener.KEY = {
     ALT          : 18,
     BACK_SPACE   : 8,
     CAPS_LOCK    : 20,
@@ -2489,4 +2495,6 @@
     TAB          : 9,
     UP           : 38
 };
-YAHOO.register("event", YAHOO.util.Event, {version: "2.4.1", build: "742"});
+
+})();
+YAHOO.register("event", YAHOO.util.Event, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/event/event-min.js
===================================================================
--- branches/2.8.x/wb/include/yui/event/event-min.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/event/event-min.js	(revision 1263)
@@ -1,9 +1,11 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
-YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){var D=this.subscribers.length;if(!D&&this.silent){return true;}var H=[],F=true,C,I=false;for(C=0;C<arguments.length;++C){H.push(arguments[C]);}if(!this.silent){}for(C=0;C<D;++C){var L=this.subscribers[C];if(!L){I=true;}else{if(!this.silent){}var K=L.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var A=null;if(H.length>0){A=H[0];}try{F=L.fn.call(K,A,L.obj);}catch(E){this.lastError=E;}}else{try{F=L.fn.call(K,this.type,H,L.obj);}catch(G){this.lastError=G;}}if(false===F){if(!this.silent){}return false;}}}if(I){var J=[],B=this.subscribers;for(C=0,D=B.length;C<D;C=C+1){J.push(B[C]);}this.subscribers=J;}return true;},unsubscribeAll:function(){for(var B=0,A=this.subscribers.length;B<A;++B){this._delete(A-1-B);}this.subscribers=[];return B;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers[A]=null;},toString:function(){return"CustomEvent: '"+this.type+"', scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M];for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=0,R=L.length;O<R;++O){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=0,R=J.length;O<R;O++){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J[O]=null;return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M[O]=null;break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I[Q]=null;return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(K){if(K&&3==K.nodeType){return K.parentNode;}else{return K;}},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];
-},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;++M){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}if(this.isIE){if(!this.DOMReady){this.startInterval();return false;}}this.locked=true;var P=!H;if(!P){P=(C>0);}var O=[];var Q=function(S,T){var R=S;if(T.override){if(T.override===true){R=T.obj;}else{R=T.override;}}T.fn.call(R,T.obj);};var L,K,N,M;for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&!N.checkReady){M=this.getEl(N.id);if(M){Q(M,N);F[L]=null;}else{O.push(N);}}}for(L=0,K=F.length;L<K;++L){N=F[L];if(N&&N.checkReady){M=this.getEl(N.id);if(M){if(H||M.nextSibling){Q(M,N);F[L]=null;}}else{O.push(N);}}}C=(O.length===0)?0:C-1;if(P){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=0,K=Q.length;N<K;++N){var L=Q[N];this.removeListener(M,L.type,L.fn,L.index);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T&&T.length>0){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var Q=YAHOO.util.Event,O,N,L,K,M;for(O=0,K=J.length;O<K;++O){L=J[O];if(L){var P=window;if(L[Q.ADJ_SCOPE]){if(L[Q.ADJ_SCOPE]===true){P=L[Q.UNLOAD_OBJ];}else{P=L[Q.ADJ_SCOPE];}}L[Q.FN].call(P,Q.getEvent(R,L[Q.EL]),L[Q.UNLOAD_OBJ]);J[O]=null;L=null;P=null;}}J=null;if(YAHOO.env.ua.ie&&I&&I.length>0){N=I.length;while(N){M=N-1;L=I[M];if(L){Q.removeListener(L[Q.EL],L[Q.TYPE],L[Q.FN],M);}N--;}L=null;}G=null;Q._simpleRemove(window,"unload",Q._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var A=YAHOO.util.Event;A.on=A.addListener;if(A.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);A._dri=setInterval(function(){var C=document.createElement("p");try{C.doScroll("left");clearInterval(A._dri);A._dri=null;A._ready();C=null;}catch(B){C=null;}},A.POLL_INTERVAL);}else{if(A.webkit){A._dri=setInterval(function(){var B=document.readyState;if("loaded"==B||"complete"==B){clearInterval(A._dri);A._dri=null;A._ready();}},A.POLL_INTERVAL);}else{A._simpleAdd(document,"DOMContentLoaded",A._ready);}}A._simpleAdd(window,"load",A._load);A._simpleAdd(window,"unload",A._unload);A._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};
-var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.4.1",build:"742"});
\ No newline at end of file
+YAHOO.util.CustomEvent=function(D,C,B,A,E){this.type=D;this.scope=C||window;this.silent=B;this.fireOnce=E;this.fired=false;this.firedWith=null;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var F="_YUICEOnSubscribe";if(D!==F){this.subscribeEvent=new YAHOO.util.CustomEvent(F,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,D){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,D);}var A=new YAHOO.util.Subscriber(B,C,D);if(this.fireOnce&&this.fired){this.notify(A,this.firedWith);}else{this.subscribers.push(A);}},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var H=[],A=this.subscribers.length;var D=[].slice.call(arguments,0),C=true,F,B=false;if(this.fireOnce){if(this.fired){return true;}else{this.firedWith=D;}}this.fired=true;if(!A&&this.silent){return true;}if(!this.silent){}var E=this.subscribers.slice();for(F=0;F<A;++F){var G=E[F];if(!G){B=true;}else{C=this.notify(G,D);if(false===C){if(!this.silent){}break;}}}return(C!==false);},notify:function(F,C){var B,H=null,E=F.getScope(this.scope),A=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(C.length>0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.obj);}catch(D){this.lastError=D;if(A){throw D;}}}return B;},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var G=false,H=[],J=[],A=0,E=[],B=0,C={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},D=YAHOO.env.ua.ie,F="focusin",I="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:D,_interval:null,_dri:null,_specialTypes:{focusin:(D?"focusin":"focus"),focusout:(D?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(Q,M,O,P,N){var K=(YAHOO.lang.isString(Q))?[Q]:Q;for(var L=0;L<K.length;L=L+1){E.push({id:K[L],fn:M,obj:O,overrideContext:P,checkReady:N});}A=this.POLL_RETRYS;this.startInterval();},onContentReady:function(N,K,L,M){this.onAvailable(N,K,L,M,true);},onDOMReady:function(){this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent,arguments);},_addListener:function(M,K,V,P,T,Y){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var Q=0,S=M.length;Q<S;++Q){W=this.on(M[Q],K,V,P,T)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var O=this.getEl(M);if(O){M=O;}else{this.onAvailable(M,function(){YAHOO.util.Event._addListener(M,K,V,P,T,Y);});return true;}}}if(!M){return false;}if("unload"==K&&P!==this){J[J.length]=[M,K,V,P,T];return true;}var L=M;if(T){if(T===true){L=P;}else{L=T;}}var N=function(Z){return V.call(L,YAHOO.util.Event.getEvent(Z,M),P);};var X=[M,K,V,N,L,P,T,Y];var R=H.length;H[R]=X;try{this._simpleAdd(M,K,N,Y);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}return true;},_getType:function(K){return this._specialTypes[K]||K;},addListener:function(M,P,L,N,O){var K=((P==F||P==I)&&!YAHOO.env.ua.ie)?true:false;return this._addListener(M,this._getType(P),L,N,O,K);},addFocusListener:function(L,K,M,N){return this.on(L,F,K,M,N);},removeFocusListener:function(L,K){return this.removeListener(L,F,K);},addBlurListener:function(L,K,M,N){return this.on(L,I,K,M,N);},removeBlurListener:function(L,K){return this.removeListener(L,I,K);},removeListener:function(L,K,R){var M,P,U;K=this._getType(K);if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var S=true;for(M=L.length-1;M>-1;M--){S=(this.removeListener(L[M],K,R)&&S);}return S;}}if(!R||!R.call){return this.purgeElement(L,false,K);}if("unload"==K){for(M=J.length-1;M>-1;M--){U=J[M];if(U&&U[0]==L&&U[1]==K&&U[2]==R){J.splice(M,1);return true;}}return false;}var N=null;var O=arguments[3];if("undefined"===typeof O){O=this._getCacheIndex(H,L,K,R);}if(O>=0){N=H[O];}if(!L||!N){return false;}var T=N[this.CAPTURE]===true?true:false;try{this._simpleRemove(L,K,N[this.WFN],T);}catch(Q){this.lastError=Q;return false;}delete H[O][this.WFN];delete H[O][this.FN];H.splice(O,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;
+}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in C)){K=C[K];}return K;},_getCacheIndex:function(M,P,Q,O){for(var N=0,L=M.length;N<L;N=N+1){var K=M[N];if(K&&K[this.FN]==O&&K[this.EL]==P&&K[this.TYPE]==Q){return N;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+B;++B;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",YAHOO,0,0,1),_load:function(L){if(!G){G=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(E.length===0){A=0;if(this._interval){this._interval.cancel();this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var Q=!G;if(!Q){Q=(A>0&&E.length>0);}var P=[];var R=function(T,U){var S=T;if(U.overrideContext){if(U.overrideContext===true){S=U.obj;}else{S=U.overrideContext;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=E.length;L<K;L=L+1){O=E[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(G||N.nextSibling||!Q){M.push(O);E[L]=null;}}else{R(N,O);E[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}A--;if(Q){for(L=E.length-1;L>-1;L--){O=E[L];if(!O||!O.id){E.splice(L,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[H,J];}else{if(K==="unload"){L=[J];}else{K=this._getType(K);L=[H];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var L=YAHOO.util.Event,O,N,M,Q,P,S=J.slice(),K;for(O=0,Q=J.length;O<Q;++O){M=S[O];if(M){K=window;if(M[L.ADJ_SCOPE]){if(M[L.ADJ_SCOPE]===true){K=M[L.UNLOAD_OBJ];}else{K=M[L.ADJ_SCOPE];}}M[L.FN].call(K,L.getEvent(R,M[L.EL]),M[L.UNLOAD_OBJ]);S[O]=null;}}M=null;K=null;J=null;if(H){for(N=H.length-1;N>-1;N--){M=H[N];if(M){L.removeListener(M[L.EL],M[L.TYPE],M[L.FN],N);}}M=null;}L._simpleRemove(window,"unload",L._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
+/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
+if(EU.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;EU._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);
+},createEvent:function(B,G){this.__yui_events=this.__yui_events||{};var E=G||{},D=this.__yui_events,F;if(D[B]){}else{F=new YAHOO.util.CustomEvent(B,E.scope||this,E.silent,YAHOO.util.CustomEvent.FLAT,E.fireOnce);D[B]=F;if(E.onSubscribeCallback){F.subscribeEvent.subscribe(E.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var A=this.__yui_subscribers[B];if(A){for(var C=0;C<A.length;++C){F.subscribe(A[C].fn,A[C].obj,A[C].overrideContext);}}}return D[B];},fireEvent:function(B){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[B];if(!D){return null;}var A=[];for(var C=1;C<arguments.length;++C){A.push(arguments[C]);}return D.fire.apply(D,A);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.8.0r4",build:"2449"});
\ No newline at end of file
Index: branches/2.8.x/wb/include/yui/event/index.php
===================================================================
--- branches/2.8.x/wb/include/yui/event/index.php	(revision 1262)
+++ branches/2.8.x/wb/include/yui/event/index.php	(revision 1263)
@@ -1,28 +1,55 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-header("Location: ../../../index.php");
-
+<?php
+/*
+*
+*                       About WebsiteBaker
+*
+* Website Baker is a PHP-based Content Management System (CMS)
+* designed with one goal in mind: to enable its users to produce websites
+* with ease.
+*
+*                       LICENSE INFORMATION
+*
+* WebsiteBaker is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* WebsiteBaker is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*
+*                   WebsiteBaker Extra Information
+*
+*
+*/
+/**
+ *
+ * @category        backend
+ * @package         yui
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @filesource		$HeadURL$
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ *
+ * @author          WebsiteBaker Project
+ * @link			http://www.websitebaker2.org/
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @link			http://start.websitebaker2.org/impressum-datenschutz.php
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @version         $Id$
+ * @platform        WebsiteBaker 2.8.x
+ * @requirements    PHP 4.3.4 and higher
+ * @lastmodified    $Date$
+ *
+ */
+
+header("Location: ../../../index.php");
+
 ?>
\ No newline at end of file

Property changes on: branches/2.8.x/wb/include/yui/event/index.php
___________________________________________________________________
Modified: svn:keywords
## -1 +1,4 ##
-Id
\ No newline at end of property
+Id
+Revision
+HeadURL
+Date
\ No newline at end of property
Index: branches/2.8.x/wb/include/yui/dragdrop/dragdrop-debug.js
===================================================================
--- branches/2.8.x/wb/include/yui/dragdrop/dragdrop-debug.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/dragdrop/dragdrop-debug.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 /**
  * The drag and drop utility provides a framework for building drag and drop
@@ -30,11 +30,125 @@
  */
 YAHOO.util.DragDropMgr = function() {
 
-    var Event = YAHOO.util.Event;
+    var Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom;
 
     return {
-
         /**
+        * This property is used to turn on global use of the shim element on all DragDrop instances, defaults to false for backcompat. (Use: YAHOO.util.DDM.useShim = true)
+        * @property useShim
+        * @type Boolean
+        * @static
+        */
+        useShim: false,
+        /**
+        * This property is used to determine if the shim is active over the screen, default false.
+        * @private
+        * @property _shimActive
+        * @type Boolean
+        * @static
+        */
+        _shimActive: false,
+        /**
+        * This property is used when useShim is set on a DragDrop object to store the current state of DDM.useShim so it can be reset when a drag operation is done.
+        * @private
+        * @property _shimState
+        * @type Boolean
+        * @static
+        */
+        _shimState: false,
+        /**
+        * This property is used when useShim is set to true, it will set the opacity on the shim to .5 for debugging. Use: (YAHOO.util.DDM._debugShim = true;)
+        * @private
+        * @property _debugShim
+        * @type Boolean
+        * @static
+        */
+        _debugShim: false,
+        /**
+        * This method will create a shim element (giving it the id of yui-ddm-shim), it also attaches the mousemove and mouseup listeners to it and attaches a scroll listener on the window
+        * @private
+        * @method _sizeShim
+        * @static
+        */
+        _createShim: function() {
+            YAHOO.log('Creating Shim Element', 'info', 'DragDropMgr');
+            var s = document.createElement('div');
+            s.id = 'yui-ddm-shim';
+            if (document.body.firstChild) {
+                document.body.insertBefore(s, document.body.firstChild);
+            } else {
+                document.body.appendChild(s);
+            }
+            s.style.display = 'none';
+            s.style.backgroundColor = 'red';
+            s.style.position = 'absolute';
+            s.style.zIndex = '99999';
+            Dom.setStyle(s, 'opacity', '0');
+            this._shim = s;
+            Event.on(s, "mouseup",   this.handleMouseUp, this, true);
+            Event.on(s, "mousemove", this.handleMouseMove, this, true);
+            Event.on(window, 'scroll', this._sizeShim, this, true);
+        },
+        /**
+        * This method will size the shim, called from activate and on window scroll event
+        * @private
+        * @method _sizeShim
+        * @static
+        */
+        _sizeShim: function() {
+            if (this._shimActive) {
+                YAHOO.log('Sizing Shim', 'info', 'DragDropMgr');
+                var s = this._shim;
+                s.style.height = Dom.getDocumentHeight() + 'px';
+                s.style.width = Dom.getDocumentWidth() + 'px';
+                s.style.top = '0';
+                s.style.left = '0';
+            }
+        },
+        /**
+        * This method will create the shim element if needed, then show the shim element, size the element and set the _shimActive property to true
+        * @private
+        * @method _activateShim
+        * @static
+        */
+        _activateShim: function() {
+            if (this.useShim) {
+                YAHOO.log('Activating Shim', 'info', 'DragDropMgr');
+                if (!this._shim) {
+                    this._createShim();
+                }
+                this._shimActive = true;
+                var s = this._shim,
+                    o = '0';
+                if (this._debugShim) {
+                    o = '.5';
+                }
+                Dom.setStyle(s, 'opacity', o);
+                this._sizeShim();
+                s.style.display = 'block';
+            }
+        },
+        /**
+        * This method will hide the shim element and set the _shimActive property to false
+        * @private
+        * @method _deactivateShim
+        * @static
+        */
+        _deactivateShim: function() {
+            YAHOO.log('Deactivating Shim', 'info', 'DragDropMgr');
+            this._shim.style.display = 'none';
+            this._shimActive = false;
+        },
+        /**
+        * The HTML element created to use as a shim over the document to track mouse movements
+        * @private
+        * @property _shim
+        * @type HTMLElement
+        * @static
+        */
+        _shim: null,
+        /**
          * Two dimensional Array of registered DragDrop objects.  The first 
          * dimension is the DragDrop item group, the second the DragDrop 
          * object.
@@ -229,7 +343,6 @@
             this.init();
 
             YAHOO.log("DragDropMgr onload", "info", "DragDropMgr");
-
             Event.on(document, "mouseup",   this.handleMouseUp, this, true);
             Event.on(document, "mousemove", this.handleMouseMove, this, true);
             Event.on(window,   "unload",    this._onUnload, this, true);
@@ -400,10 +513,13 @@
          */
         _remove: function(oDD) {
             for (var g in oDD.groups) {
-                if (g && this.ids[g][oDD.id]) {
-                    delete this.ids[g][oDD.id];
-                    //YAHOO.log("NEW LEN " + this.ids.length, "warn");
+                if (g) {
+                    var item = this.ids[g];
+                    if (item && item[oDD.id]) {
+                        delete item[oDD.id];
+                    }
                 }
+                
             }
             delete this.handleIds[oDD.id];
         },
@@ -539,6 +655,7 @@
          * @static
          */
         handleMouseDown: function(e, oDD) {
+            //this._activateShim();
 
             this.currentTarget = YAHOO.util.Event.getTarget(e);
 
@@ -565,7 +682,7 @@
         },
 
         /**
-         * Fired when either the drag pixel threshol or the mousedown hold 
+         * Fired when either the drag pixel threshold or the mousedown hold 
          * time threshold has been met.
          * @method startDrag
          * @param x {int} the X position of the original mousedown
@@ -573,14 +690,21 @@
          * @static
          */
         startDrag: function(x, y) {
+            if (this.dragCurrent && this.dragCurrent.useShim) {
+                this._shimState = this.useShim;
+                this.useShim = true;
+            }
+            this._activateShim();
             YAHOO.log("firing drag start events", "info", "DragDropMgr");
             clearTimeout(this.clickTimeout);
             var dc = this.dragCurrent;
-            if (dc) {
+            if (dc && dc.events.b4StartDrag) {
                 dc.b4StartDrag(x, y);
+                dc.fireEvent('b4StartDragEvent', { x: x, y: y });
             }
-            if (dc) {
+            if (dc && dc.events.startDrag) {
                 dc.startDrag(x, y);
+                dc.fireEvent('startDragEvent', { x: x, y: y });
             }
             this.dragThreshMet = true;
         },
@@ -600,7 +724,8 @@
                 if (this.dragThreshMet) {
                     YAHOO.log("mouseup detected - completing drag", "info", "DragDropMgr");
                     if (this.fromTimeout) {
-                        YAHOO.log('fromTimeout is true (mouse didn\'t move), call handleMouseDown so we can get the dragOver event', 'info', 'DragDropMgr');
+                        YAHOO.log('fromTimeout is true (mouse didn\'t move), call handleMouseMove so we can get the dragOver event', 'info', 'DragDropMgr');
+                        this.fromTimeout = false;
                         this.handleMouseMove(e);
                     }
                     this.fromTimeout = false;
@@ -651,17 +776,33 @@
          */
         stopDrag: function(e, silent) {
             // YAHOO.log("mouseup - removing event handlers");
-
+            var dc = this.dragCurrent;
             // Fire the drag end event for the item that was dragged
-            if (this.dragCurrent && !silent) {
+            if (dc && !silent) {
                 if (this.dragThreshMet) {
                     YAHOO.log("firing endDrag events", "info", "DragDropMgr");
-                    this.dragCurrent.b4EndDrag(e);
-                    this.dragCurrent.endDrag(e);
+                    if (dc.events.b4EndDrag) {
+                        dc.b4EndDrag(e);
+                        dc.fireEvent('b4EndDragEvent', { e: e });
+                    }
+                    if (dc.events.endDrag) {
+                        dc.endDrag(e);
+                        dc.fireEvent('endDragEvent', { e: e });
+                    }
                 }
+                if (dc.events.mouseUp) {
+                    YAHOO.log("firing dragdrop onMouseUp event", "info", "DragDropMgr");
+                    dc.onMouseUp(e);
+                    dc.fireEvent('mouseUpEvent', { e: e });
+                }
+            }
 
-                YAHOO.log("firing dragdrop onMouseUp event", "info", "DragDropMgr");
-                this.dragCurrent.onMouseUp(e);
+            if (this._shimActive) {
+                this._deactivateShim();
+                if (this.dragCurrent && this.dragCurrent.useShim) {
+                    this.useShim = this._shimState;
+                    this._shimState = false;
+                }
             }
 
             this.dragCurrent = null;
@@ -684,7 +825,7 @@
          */
         handleMouseMove: function(e) {
             //YAHOO.log("handlemousemove");
-            
+
             var dc = this.dragCurrent;
             if (dc) {
                 // YAHOO.log("no current drag obj");
@@ -697,6 +838,14 @@
                     YAHOO.log("button failure", "info", "DragDropMgr");
                     this.stopEvent(e);
                     return this.handleMouseUp(e);
+                } else {
+                    if (e.clientX < 0 || e.clientY < 0) {
+                        //This will stop the element from leaving the viewport in FF, Opera & Safari
+                        //Not turned on yet
+                        //YAHOO.log("Either clientX or clientY is negative, stop the event.", "info", "DragDropMgr");
+                        //this.stopEvent(e);
+                        //return false;
+                    }
                 }
 
                 if (!this.dragThreshMet) {
@@ -711,9 +860,13 @@
                 }
 
                 if (this.dragThreshMet) {
-                    dc.b4Drag(e);
-                    if (dc) {
+                    if (dc && dc.events.b4Drag) {
+                        dc.b4Drag(e);
+                        dc.fireEvent('b4DragEvent', { e: e});
+                    }
+                    if (dc && dc.events.drag) {
                         dc.onDrag(e);
+                        dc.fireEvent('dragEvent', { e: e});
                     }
                     if (dc) {
                         this.fireEvents(e, false);
@@ -748,6 +901,7 @@
                 pt = new YAHOO.util.Point(x,y),
                 pos = dc.getTargetCoord(pt.x, pt.y),
                 el = dc.getDragEl(),
+                events = ['out', 'over', 'drop', 'enter'],
                 curRegion = new YAHOO.util.Region( pos.y, 
                                                pos.x + el.offsetWidth,
                                                pos.y + el.offsetHeight, 
@@ -754,12 +908,14 @@
                                                pos.x ),
             
                 oldOvers = [], // cache the previous dragOver array
-                outEvts   = [],
-                overEvts  = [],
-                dropEvts  = [],
-                enterEvts = [],
                 inGroupsObj  = {},
-                inGroups  = [];
+                inGroups  = [],
+                data = {
+                    outEvts: [],
+                    overEvts: [],
+                    dropEvts: [],
+                    enterEvts: []
+                };
 
 
             // Check to see if the object(s) we were hovering over is no longer 
@@ -772,7 +928,7 @@
                     continue;
                 }
                 if (! this.isOverTarget(pt, ddo, this.mode, curRegion)) {
-                    outEvts.push( ddo );
+                    data.outEvts.push( ddo );
                 }
 
                 oldOvers[i] = true;
@@ -797,16 +953,16 @@
                             inGroupsObj[sGroup] = true;
                             // look for drop interactions
                             if (isDrop) {
-                                dropEvts.push( oDD );
+                                data.dropEvts.push( oDD );
                             // look for drag enter and drag over interactions
                             } else {
 
                                 // initial drag over: dragEnter fires
                                 if (!oldOvers[oDD.id]) {
-                                    enterEvts.push( oDD );
+                                    data.enterEvts.push( oDD );
                                 // subsequent drag overs: dragOver fires
                                 } else {
-                                    overEvts.push( oDD );
+                                    data.overEvts.push( oDD );
                                 }
 
                                 this.dragOvers[oDD.id] = oDD;
@@ -817,10 +973,10 @@
             }
 
             this.interactionInfo = {
-                out:       outEvts,
-                enter:     enterEvts,
-                over:      overEvts,
-                drop:      dropEvts,
+                out:       data.outEvts,
+                enter:     data.enterEvts,
+                over:      data.overEvts,
+                drop:      data.dropEvts,
                 point:     pt,
                 draggedRegion:    curRegion,
                 sourceRegion: this.locationCache[dc.id],
@@ -833,95 +989,50 @@
             }
 
             // notify about a drop that did not find a target
-            if (isDrop && !dropEvts.length) {
+            if (isDrop && !data.dropEvts.length) {
                 YAHOO.log(dc.id + " dropped, but not on a target", "info", "DragDropMgr");
                 this.interactionInfo.validDrop = false;
-                dc.onInvalidDrop(e);
+                if (dc.events.invalidDrop) {
+                    dc.onInvalidDrop(e);
+                    dc.fireEvent('invalidDropEvent', { e: e });
+                }
             }
-
-
-            if (this.mode) {
-                if (outEvts.length) {
-                    YAHOO.log(dc.id+" onDragOut: " + outEvts, "info", "DragDropMgr");
-                    dc.b4DragOut(e, outEvts);
-                    if (dc) {
-                        dc.onDragOut(e, outEvts);
-                    }
+            for (i = 0; i < events.length; i++) {
+                var tmp = null;
+                if (data[events[i] + 'Evts']) {
+                    tmp = data[events[i] + 'Evts'];
                 }
-
-                if (enterEvts.length) {
-                    YAHOO.log(dc.id+" onDragEnter: " + enterEvts + " (group: " + inGroups + ")", "info", "DragDropMgr");
-                    if (dc) {
-                        dc.onDragEnter(e, enterEvts, inGroups);
+                if (tmp && tmp.length) {
+                    var type = events[i].charAt(0).toUpperCase() + events[i].substr(1),
+                        ev = 'onDrag' + type,
+                        b4 = 'b4Drag' + type,
+                        cev = 'drag' + type + 'Event',
+                        check = 'drag' + type;
+                    if (this.mode) {
+                        YAHOO.log(dc.id + ' ' + ev + ': ' + tmp, "info", "DragDropMgr");
+                        if (dc.events[b4]) {
+                            dc[b4](e, tmp, inGroups);
+                            dc.fireEvent(b4 + 'Event', { event: e, info: tmp, group: inGroups });
+                            
+                        }
+                        if (dc.events[check]) {
+                            dc[ev](e, tmp, inGroups);
+                            dc.fireEvent(cev, { event: e, info: tmp, group: inGroups });
+                        }
+                    } else {
+                        for (var b = 0, len = tmp.length; b < len; ++b) {
+                            YAHOO.log(dc.id + ' ' + ev + ': ' + tmp[b].id, "info", "DragDropMgr");
+                            if (dc.events[b4]) {
+                                dc[b4](e, tmp[b].id, inGroups[0]);
+                                dc.fireEvent(b4 + 'Event', { event: e, info: tmp[b].id, group: inGroups[0] });
+                            }
+                            if (dc.events[check]) {
+                                dc[ev](e, tmp[b].id, inGroups[0]);
+                                dc.fireEvent(cev, { event: e, info: tmp[b].id, group: inGroups[0] });
+                            }
+                        }
                     }
                 }
-
-                if (overEvts.length) {
-                    YAHOO.log(dc.id+" onDragOver: " + overEvts + " (group: " + inGroups + ")", "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragOver(e, overEvts, inGroups);
-                    }
-
-                    if (dc) {
-                        dc.onDragOver(e, overEvts, inGroups);
-                    }
-                }
-
-                if (dropEvts.length) {
-                    YAHOO.log(dc.id+" onDragDrop: " + dropEvts + " (group: " + inGroups + ")", "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragDrop(e, dropEvts, inGroups);
-                    }
-                    if (dc) {
-                        dc.onDragDrop(e, dropEvts, inGroups);
-                    }
-                }
-
-            } else {
-                // fire dragout events
-                var len = 0;
-                for (i=0, len=outEvts.length; i<len; ++i) {
-                    YAHOO.log(dc.id+" onDragOut: " + outEvts[i].id, "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragOut(e, outEvts[i].id, inGroups[0]);
-                    }
-                    if (dc) {
-                        dc.onDragOut(e, outEvts[i].id, inGroups[0]);
-                    }
-                }
-                 
-                // fire enter events
-                for (i=0,len=enterEvts.length; i<len; ++i) {
-                    YAHOO.log(dc.id + " onDragEnter " + enterEvts[i].id + " (group: " + inGroups + ")", "info", "DragDropMgr");
-                    // dc.b4DragEnter(e, oDD.id);
-
-                    if (dc) {
-                        dc.onDragEnter(e, enterEvts[i].id, inGroups[0]);
-                    }
-                }
-         
-                // fire over events
-                for (i=0,len=overEvts.length; i<len; ++i) {
-                    YAHOO.log(dc.id + " onDragOver " + overEvts[i].id + " (group: " + inGroups + ")", "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragOver(e, overEvts[i].id, inGroups[0]);
-                    }
-                    if (dc) {
-                        dc.onDragOver(e, overEvts[i].id, inGroups[0]);
-                    }
-                }
-
-                // fire drop events
-                for (i=0, len=dropEvts.length; i<len; ++i) {
-                    YAHOO.log(dc.id + " dropped on " + dropEvts[i].id + " (group: " + inGroups + ")", "info", "DragDropMgr");
-                    if (dc) {
-                        dc.b4DragDrop(e, dropEvts[i].id, inGroups[0]);
-                    }
-                    if (dc) {
-                        dc.onDragDrop(e, dropEvts[i].id, inGroups[0]);
-                    }
-                }
-
             }
         },
 
@@ -1124,6 +1235,7 @@
 
             oTarget.overlap = null;
 
+
             // Get the current location of the drag element, this is the
             // location of the mouse event less the delta that represents
             // where the original mousedown happened on the element.  We
@@ -1531,8 +1643,21 @@
 };
 
 YAHOO.util.DragDrop.prototype = {
-
     /**
+     * An Object Literal containing the events that we will be using: mouseDown, b4MouseDown, mouseUp, b4StartDrag, startDrag, b4EndDrag, endDrag, mouseUp, drag, b4Drag, invalidDrop, b4DragOut, dragOut, dragEnter, b4DragOver, dragOver, b4DragDrop, dragDrop
+     * By setting any of these to false, then event will not be fired.
+     * @property events
+     * @type object
+     */
+    events: null,
+    /**
+    * @method on
+    * @description Shortcut for EventProvider.subscribe, see <a href="YAHOO.util.EventProvider.html#subscribe">YAHOO.util.EventProvider.subscribe</a>
+    */
+    on: function() {
+        this.subscribe.apply(this, arguments);
+    },
+    /**
      * The id of the element associated with this object.  This is what we 
      * refer to as the "linked element" because the size and position of 
      * this element is used to determine when the drag and drop objects have 
@@ -1664,6 +1789,13 @@
     dragOnly: false,
 
     /**
+     * If this flag is true, a shim will be placed over the screen/viewable area to track mouse events. Should help with dragging elements over iframes and other controls.
+     * @property useShim
+     * @type Boolean
+     */
+    useShim: false,
+
+    /**
      * Cached reference to the linked element
      * @property _domRef
      * @private
@@ -2008,7 +2140,12 @@
         this.initTarget(id, sGroup, config);
         Event.on(this._domRef || this.id, "mousedown", 
                         this.handleMouseDown, this, true);
+
         // Event.on(this.id, "selectstart", Event.preventDefault);
+        for (var i in this.events) {
+            this.createEvent(i + 'Event');
+        }
+        
     },
 
     /**
@@ -2024,6 +2161,8 @@
         // configuration attributes 
         this.config = config || {};
 
+        this.events = {};
+
         // create a local reference to the drag and drop manager
         this.DDM = YAHOO.util.DDM;
 
@@ -2075,7 +2214,35 @@
      * @method applyConfig
      */
     applyConfig: function() {
+        this.events = {
+            mouseDown: true,
+            b4MouseDown: true,
+            mouseUp: true,
+            b4StartDrag: true,
+            startDrag: true,
+            b4EndDrag: true,
+            endDrag: true,
+            drag: true,
+            b4Drag: true,
+            invalidDrop: true,
+            b4DragOut: true,
+            dragOut: true,
+            dragEnter: true,
+            b4DragOver: true,
+            dragOver: true,
+            b4DragDrop: true,
+            dragDrop: true
+        };
+        
+        if (this.config.events) {
+            for (var i in this.config.events) {
+                if (this.config.events[i] === false) {
+                    this.events[i] = false;
+                }
+            }
+        }
 
+
         // configurable properties: 
         //    padding, isTarget, maintainOffset, primaryButtonOnly
         this.padding           = this.config.padding || [0, 0, 0, 0];
@@ -2083,6 +2250,7 @@
         this.maintainOffset    = (this.config.maintainOffset);
         this.primaryButtonOnly = (this.config.primaryButtonOnly !== false);
         this.dragOnly = ((this.config.dragOnly === true) ? true : false);
+        this.useShim = ((this.config.useShim === true) ? true : false);
     },
 
     /**
@@ -2131,7 +2299,11 @@
         var el = this.getEl();
 
         if (!this.DDM.verifyEl(el)) {
-            this.logger.log(this.id + " element is broken");
+            if (el && el.style && (el.style.display == 'none')) {
+                this.logger.log(this.id + " can not get initial position, element style is display: none");
+            } else {
+                this.logger.log(this.id + " element is broken");
+            }
             return;
         }
 
@@ -2294,10 +2466,19 @@
         this.logger.log("firing onMouseDown events");
 
         // firing the mousedown events prior to calculating positions
-        var b4Return = this.b4MouseDown(e);
-        var mDownReturn = this.onMouseDown(e);
+        var b4Return = this.b4MouseDown(e),
+        b4Return2 = true;
 
-        if ((b4Return === false) || (mDownReturn === false)) {
+        if (this.events.b4MouseDown) {
+            b4Return2 = this.fireEvent('b4MouseDownEvent', e);
+        }
+        var mDownReturn = this.onMouseDown(e),
+            mDownReturn2 = true;
+        if (this.events.mouseDown) {
+            mDownReturn2 = this.fireEvent('mouseDownEvent', e);
+        }
+
+        if ((b4Return === false) || (mDownReturn === false) || (b4Return2 === false) || (mDownReturn2 === false)) {
             this.logger.log('b4MouseDown or onMouseDown returned false, exiting drag');
             return;
         }
@@ -2342,10 +2523,9 @@
      * @description Method validates that the clicked element
      * was indeed the handle or a valid child of the handle
      * @param {Event} e 
-     * @private
      */
     clickValidator: function(e) {
-        var target = Event.getTarget(e);
+        var target = YAHOO.util.Event.getTarget(e);
         return ( this.isValidHandleChild(target) &&
                     (this.id == this.handleElId || 
                         this.DDM.handleWasClicked(target, this.id)) );
@@ -2711,7 +2891,100 @@
     }
 
 };
+YAHOO.augment(YAHOO.util.DragDrop, YAHOO.util.EventProvider);
 
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 })();
 /**
  * A DragDrop implementation where the linked element follows the 
@@ -2735,7 +3008,7 @@
 
     /**
      * When set to true, the utility automatically tries to scroll the browser
-     * window wehn a drag and drop element is dragged near the viewport boundary.
+     * window when a drag and drop element is dragged near the viewport boundary.
      * Defaults to true.
      * @property scroll
      * @type boolean
@@ -2804,6 +3077,7 @@
         if (!this.deltaSetXY) {
             var aCoord = [oCoord.x, oCoord.y];
             YAHOO.util.Dom.setXY(el, aCoord);
+
             var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
             var newTop  = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
 
@@ -2811,12 +3085,9 @@
         } else {
             YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px");
             YAHOO.util.Dom.setStyle(el, "top",  (oCoord.y + this.deltaSetXY[1]) + "px");
-            //el.style.left = (oCoord.x + this.deltaSetXY[0]) + "px";
-            //el.style.top = (oCoord.y + this.deltaSetXY[1]) + "px";
         }
         
         this.cachePosition(oCoord.x, oCoord.y);
-        //DAV
         var self = this;
         setTimeout(function() {
             self.autoScroll.call(self, oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
@@ -2991,6 +3262,98 @@
 
     */
 
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 });
 /**
  * A DragDrop implementation that inserts an empty, bordered div into
@@ -3223,7 +3586,99 @@
     toString: function() {
         return ("DDProxy " + this.id);
     }
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
 });
 /**
  * A DragDrop implementation that does not move, but can be a drop 
@@ -3252,4 +3707,4 @@
         return ("DDTarget " + this.id);
     }
 });
-YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.4.1", build: "742"});
+YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/dragdrop/dragdrop.js
===================================================================
--- branches/2.8.x/wb/include/yui/dragdrop/dragdrop.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/dragdrop/dragdrop.js	(revision 1263)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
 /**
  * The drag and drop utility provides a framework for building drag and drop
@@ -30,11 +30,121 @@
  */
 YAHOO.util.DragDropMgr = function() {
 
-    var Event = YAHOO.util.Event;
+    var Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom;
 
     return {
-
         /**
+        * This property is used to turn on global use of the shim element on all DragDrop instances, defaults to false for backcompat. (Use: YAHOO.util.DDM.useShim = true)
+        * @property useShim
+        * @type Boolean
+        * @static
+        */
+        useShim: false,
+        /**
+        * This property is used to determine if the shim is active over the screen, default false.
+        * @private
+        * @property _shimActive
+        * @type Boolean
+        * @static
+        */
+        _shimActive: false,
+        /**
+        * This property is used when useShim is set on a DragDrop object to store the current state of DDM.useShim so it can be reset when a drag operation is done.
+        * @private
+        * @property _shimState
+        * @type Boolean
+        * @static
+        */
+        _shimState: false,
+        /**
+        * This property is used when useShim is set to true, it will set the opacity on the shim to .5 for debugging. Use: (YAHOO.util.DDM._debugShim = true;)
+        * @private
+        * @property _debugShim
+        * @type Boolean
+        * @static
+        */
+        _debugShim: false,
+        /**
+        * This method will create a shim element (giving it the id of yui-ddm-shim), it also attaches the mousemove and mouseup listeners to it and attaches a scroll listener on the window
+        * @private
+        * @method _sizeShim
+        * @static
+        */
+        _createShim: function() {
+            var s = document.createElement('div');
+            s.id = 'yui-ddm-shim';
+            if (document.body.firstChild) {
+                document.body.insertBefore(s, document.body.firstChild);
+            } else {
+                document.body.appendChild(s);
+            }
+            s.style.display = 'none';
+            s.style.backgroundColor = 'red';
+            s.style.position = 'absolute';
+            s.style.zIndex = '99999';
+            Dom.setStyle(s, 'opacity', '0');
+            this._shim = s;
+            Event.on(s, "mouseup",   this.handleMouseUp, this, true);
+            Event.on(s, "mousemove", this.handleMouseMove, this, true);
+            Event.on(window, 'scroll', this._sizeShim, this, true);
+        },
+        /**
+        * This method will size the shim, called from activate and on window scroll event
+        * @private
+        * @method _sizeShim
+        * @static
+        */
+        _sizeShim: function() {
+            if (this._shimActive) {
+                var s = this._shim;
+                s.style.height = Dom.getDocumentHeight() + 'px';
+                s.style.width = Dom.getDocumentWidth() + 'px';
+                s.style.top = '0';
+                s.style.left = '0';
+            }
+        },
+        /**
+        * This method will create the shim element if needed, then show the shim element, size the element and set the _shimActive property to true
+        * @private
+        * @method _activateShim
+        * @static
+        */
+        _activateShim: function() {
+            if (this.useShim) {
+                if (!this._shim) {
+                    this._createShim();
+                }
+                this._shimActive = true;
+                var s = this._shim,
+                    o = '0';
+                if (this._debugShim) {
+                    o = '.5';
+                }
+                Dom.setStyle(s, 'opacity', o);
+                this._sizeShim();
+                s.style.display = 'block';
+            }
+        },
+        /**
+        * This method will hide the shim element and set the _shimActive property to false
+        * @private
+        * @method _deactivateShim
+        * @static
+        */
+        _deactivateShim: function() {
+            this._shim.style.display = 'none';
+            this._shimActive = false;
+        },
+        /**
+        * The HTML element created to use as a shim over the document to track mouse movements
+        * @private
+        * @property _shim
+        * @type HTMLElement
+        * @static
+        */
+        _shim: null,
+        /**
          * Two dimensional Array of registered DragDrop objects.  The first 
          * dimension is the DragDrop item group, the second the DragDrop 
          * object.
@@ -228,7 +338,6 @@
 
             this.init();
 
-
             Event.on(document, "mouseup",   this.handleMouseUp, this, true);
             Event.on(document, "mousemove", this.handleMouseMove, this, true);
             Event.on(window,   "unload",    this._onUnload, this, true);
@@ -398,9 +507,13 @@
          */
         _remove: function(oDD) {
             for (var g in oDD.groups) {
-                if (g && this.ids[g][oDD.id]) {
-                    delete this.ids[g][oDD.id];
+                if (g) {
+                    var item = this.ids[g];
+                    if (item && item[oDD.id]) {
+                        delete item[oDD.id];
+                    }
                 }
+                
             }
             delete this.handleIds[oDD.id];
         },
@@ -536,6 +649,7 @@
          * @static
          */
         handleMouseDown: function(e, oDD) {
+            //this._activateShim();
 
             this.currentTarget = YAHOO.util.Event.getTarget(e);
 
@@ -562,7 +676,7 @@
         },
 
         /**
-         * Fired when either the drag pixel threshol or the mousedown hold 
+         * Fired when either the drag pixel threshold or the mousedown hold 
          * time threshold has been met.
          * @method startDrag
          * @param x {int} the X position of the original mousedown
@@ -570,13 +684,20 @@
          * @static
          */
         startDrag: function(x, y) {
+            if (this.dragCurrent && this.dragCurrent.useShim) {
+                this._shimState = this.useShim;
+                this.useShim = true;
+            }
+            this._activateShim();
             clearTimeout(this.clickTimeout);
             var dc = this.dragCurrent;
-            if (dc) {
+            if (dc && dc.events.b4StartDrag) {
                 dc.b4StartDrag(x, y);
+                dc.fireEvent('b4StartDragEvent', { x: x, y: y });
             }
-            if (dc) {
+            if (dc && dc.events.startDrag) {
                 dc.startDrag(x, y);
+                dc.fireEvent('startDragEvent', { x: x, y: y });
             }
             this.dragThreshMet = true;
         },
@@ -595,6 +716,7 @@
 
                 if (this.dragThreshMet) {
                     if (this.fromTimeout) {
+                        this.fromTimeout = false;
                         this.handleMouseMove(e);
                     }
                     this.fromTimeout = false;
@@ -643,15 +765,31 @@
          * @static
          */
         stopDrag: function(e, silent) {
-
+            var dc = this.dragCurrent;
             // Fire the drag end event for the item that was dragged
-            if (this.dragCurrent && !silent) {
+            if (dc && !silent) {
                 if (this.dragThreshMet) {
-                    this.dragCurrent.b4EndDrag(e);
-                    this.dragCurrent.endDrag(e);
+                    if (dc.events.b4EndDrag) {
+                        dc.b4EndDrag(e);
+                        dc.fireEvent('b4EndDragEvent', { e: e });
+                    }
+                    if (dc.events.endDrag) {
+                        dc.endDrag(e);
+                        dc.fireEvent('endDragEvent', { e: e });
+                    }
                 }
+                if (dc.events.mouseUp) {
+                    dc.onMouseUp(e);
+                    dc.fireEvent('mouseUpEvent', { e: e });
+                }
+            }
 
-                this.dragCurrent.onMouseUp(e);
+            if (this._shimActive) {
+                this._deactivateShim();
+                if (this.dragCurrent && this.dragCurrent.useShim) {
+                    this.useShim = this._shimState;
+                    this._shimState = false;
+                }
             }
 
             this.dragCurrent = null;
@@ -673,7 +811,7 @@
          * @static
          */
         handleMouseMove: function(e) {
-            
+
             var dc = this.dragCurrent;
             if (dc) {
 
@@ -683,6 +821,13 @@
                 if (YAHOO.util.Event.isIE && !e.button) {
                     this.stopEvent(e);
                     return this.handleMouseUp(e);
+                } else {
+                    if (e.clientX < 0 || e.clientY < 0) {
+                        //This will stop the element from leaving the viewport in FF, Opera & Safari
+                        //Not turned on yet
+                        //this.stopEvent(e);
+                        //return false;
+                    }
                 }
 
                 if (!this.dragThreshMet) {
@@ -695,9 +840,13 @@
                 }
 
                 if (this.dragThreshMet) {
-                    dc.b4Drag(e);
-                    if (dc) {
+                    if (dc && dc.events.b4Drag) {
+                        dc.b4Drag(e);
+                        dc.fireEvent('b4DragEvent', { e: e});
+                    }
+                    if (dc && dc.events.drag) {
                         dc.onDrag(e);
+                        dc.fireEvent('dragEvent', { e: e});
                     }
                     if (dc) {
                         this.fireEvents(e, false);
@@ -732,6 +881,7 @@
                 pt = new YAHOO.util.Point(x,y),
                 pos = dc.getTargetCoord(pt.x, pt.y),
                 el = dc.getDragEl(),
+                events = ['out', 'over', 'drop', 'enter'],
                 curRegion = new YAHOO.util.Region( pos.y, 
                                                pos.x + el.offsetWidth,
                                                pos.y + el.offsetHeight, 
@@ -738,12 +888,14 @@
                                                pos.x ),
             
                 oldOvers = [], // cache the previous dragOver array
-                outEvts   = [],
-                overEvts  = [],
-                dropEvts  = [],
-                enterEvts = [],
                 inGroupsObj  = {},
-                inGroups  = [];
+                inGroups  = [],
+                data = {
+                    outEvts: [],
+                    overEvts: [],
+                    dropEvts: [],
+                    enterEvts: []
+                };
 
 
             // Check to see if the object(s) we were hovering over is no longer 
@@ -756,7 +908,7 @@
                     continue;
                 }
                 if (! this.isOverTarget(pt, ddo, this.mode, curRegion)) {
-                    outEvts.push( ddo );
+                    data.outEvts.push( ddo );
                 }
 
                 oldOvers[i] = true;
@@ -780,16 +932,16 @@
                             inGroupsObj[sGroup] = true;
                             // look for drop interactions
                             if (isDrop) {
-                                dropEvts.push( oDD );
+                                data.dropEvts.push( oDD );
                             // look for drag enter and drag over interactions
                             } else {
 
                                 // initial drag over: dragEnter fires
                                 if (!oldOvers[oDD.id]) {
-                                    enterEvts.push( oDD );
+                                    data.enterEvts.push( oDD );
                                 // subsequent drag overs: dragOver fires
                                 } else {
-                                    overEvts.push( oDD );
+                                    data.overEvts.push( oDD );
                                 }
 
                                 this.dragOvers[oDD.id] = oDD;
@@ -800,10 +952,10 @@
             }
 
             this.interactionInfo = {
-                out:       outEvts,
-                enter:     enterEvts,
-                over:      overEvts,
-                drop:      dropEvts,
+                out:       data.outEvts,
+                enter:     data.enterEvts,
+                over:      data.overEvts,
+                drop:      data.dropEvts,
                 point:     pt,
                 draggedRegion:    curRegion,
                 sourceRegion: this.locationCache[dc.id],
@@ -816,86 +968,47 @@
             }
 
             // notify about a drop that did not find a target
-            if (isDrop && !dropEvts.length) {
+            if (isDrop && !data.dropEvts.length) {
                 this.interactionInfo.validDrop = false;
-                dc.onInvalidDrop(e);
+                if (dc.events.invalidDrop) {
+                    dc.onInvalidDrop(e);
+                    dc.fireEvent('invalidDropEvent', { e: e });
+                }
             }
-
-
-            if (this.mode) {
-                if (outEvts.length) {
-                    dc.b4DragOut(e, outEvts);
-                    if (dc) {
-                        dc.onDragOut(e, outEvts);
-                    }
+            for (i = 0; i < events.length; i++) {
+                var tmp = null;
+                if (data[events[i] + 'Evts']) {
+                    tmp = data[events[i] + 'Evts'];
                 }
-
-                if (enterEvts.length) {
-                    if (dc) {
-                        dc.onDragEnter(e, enterEvts, inGroups);
+                if (tmp && tmp.length) {
+                    var type = events[i].charAt(0).toUpperCase() + events[i].substr(1),
+                        ev = 'onDrag' + type,
+                        b4 = 'b4Drag' + type,
+                        cev = 'drag' + type + 'Event',
+                        check = 'drag' + type;
+                    if (this.mode) {
+                        if (dc.events[b4]) {
+                            dc[b4](e, tmp, inGroups);
+                            dc.fireEvent(b4 + 'Event', { event: e, info: tmp, group: inGroups });
+                            
+                        }
+                        if (dc.events[check]) {
+                            dc[ev](e, tmp, inGroups);
+                            dc.fireEvent(cev, { event: e, info: tmp, group: inGroups });
+                        }
+                    } else {
+                        for (var b = 0, len = tmp.length; b < len; ++b) {
+                            if (dc.events[b4]) {
+                                dc[b4](e, tmp[b].id, inGroups[0]);
+                                dc.fireEvent(b4 + 'Event', { event: e, info: tmp[b].id, group: inGroups[0] });
+                            }
+                            if (dc.events[check]) {
+                                dc[ev](e, tmp[b].id, inGroups[0]);
+                                dc.fireEvent(cev, { event: e, info: tmp[b].id, group: inGroups[0] });
+                            }
+                        }
                     }
                 }
-
-                if (overEvts.length) {
-                    if (dc) {
-                        dc.b4DragOver(e, overEvts, inGroups);
-                    }
-
-                    if (dc) {
-                        dc.onDragOver(e, overEvts, inGroups);
-                    }
-                }
-
-                if (dropEvts.length) {
-                    if (dc) {
-                        dc.b4DragDrop(e, dropEvts, inGroups);
-                    }
-                    if (dc) {
-                        dc.onDragDrop(e, dropEvts, inGroups);
-                    }
-                }
-
-            } else {
-                // fire dragout events
-                var len = 0;
-                for (i=0, len=outEvts.length; i<len; ++i) {
-                    if (dc) {
-                        dc.b4DragOut(e, outEvts[i].id, inGroups[0]);
-                    }
-                    if (dc) {
-                        dc.onDragOut(e, outEvts[i].id, inGroups[0]);
-                    }
-                }
-                 
-                // fire enter events
-                for (i=0,len=enterEvts.length; i<len; ++i) {
-                    // dc.b4DragEnter(e, oDD.id);
-
-                    if (dc) {
-                        dc.onDragEnter(e, enterEvts[i].id, inGroups[0]);
-                    }
-                }
-         
-                // fire over events
-                for (i=0,len=overEvts.length; i<len; ++i) {
-                    if (dc) {
-                        dc.b4DragOver(e, overEvts[i].id, inGroups[0]);
-                    }
-                    if (dc) {
-                        dc.onDragOver(e, overEvts[i].id, inGroups[0]);
-                    }
-                }
-
-                // fire drop events
-                for (i=0, len=dropEvts.length; i<len; ++i) {
-                    if (dc) {
-                        dc.b4DragDrop(e, dropEvts[i].id, inGroups[0]);
-                    }
-                    if (dc) {
-                        dc.onDragDrop(e, dropEvts[i].id, inGroups[0]);
-                    }
-                }
-
             }
         },
 
@@ -1088,6 +1201,7 @@
 
             oTarget.overlap = null;
 
+
             // Get the current location of the drag element, this is the
             // location of the mouse event less the delta that represents
             // where the original mousedown happened on the element.  We
@@ -1488,8 +1602,21 @@
 };
 
 YAHOO.util.DragDrop.prototype = {
-
     /**
+     * An Object Literal containing the events that we will be using: mouseDown, b4MouseDown, mouseUp, b4StartDrag, startDrag, b4EndDrag, endDrag, mouseUp, drag, b4Drag, invalidDrop, b4DragOut, dragOut, dragEnter, b4DragOver, dragOver, b4DragDrop, dragDrop
+     * By setting any of these to false, then event will not be fired.
+     * @property events
+     * @type object
+     */
+    events: null,
+    /**
+    * @method on
+    * @description Shortcut for EventProvider.subscribe, see <a href="YAHOO.util.EventProvider.html#subscribe">YAHOO.util.EventProvider.subscribe</a>
+    */
+    on: function() {
+        this.subscribe.apply(this, arguments);
+    },
+    /**
      * The id of the element associated with this object.  This is what we 
      * refer to as the "linked element" because the size and position of 
      * this element is used to determine when the drag and drop objects have 
@@ -1621,6 +1748,13 @@
     dragOnly: false,
 
     /**
+     * If this flag is true, a shim will be placed over the screen/viewable area to track mouse events. Should help with dragging elements over iframes and other controls.
+     * @property useShim
+     * @type Boolean
+     */
+    useShim: false,
+
+    /**
      * Cached reference to the linked element
      * @property _domRef
      * @private
@@ -1964,7 +2098,12 @@
         this.initTarget(id, sGroup, config);
         Event.on(this._domRef || this.id, "mousedown", 
                         this.handleMouseDown, this, true);
+
         // Event.on(this.id, "selectstart", Event.preventDefault);
+        for (var i in this.events) {
+            this.createEvent(i + 'Event');
+        }
+        
     },
 
     /**
@@ -1980,6 +2119,8 @@
         // configuration attributes 
         this.config = config || {};
 
+        this.events = {};
+
         // create a local reference to the drag and drop manager
         this.DDM = YAHOO.util.DDM;
 
@@ -2027,7 +2168,35 @@
      * @method applyConfig
      */
     applyConfig: function() {
+        this.events = {
+            mouseDown: true,
+            b4MouseDown: true,
+            mouseUp: true,
+            b4StartDrag: true,
+            startDrag: true,
+            b4EndDrag: true,
+            endDrag: true,
+            drag: true,
+            b4Drag: true,
+            invalidDrop: true,
+            b4DragOut: true,
+            dragOut: true,
+            dragEnter: true,
+            b4DragOver: true,
+            dragOver: true,
+            b4DragDrop: true,
+            dragDrop: true
+        };
+        
+        if (this.config.events) {
+            for (var i in this.config.events) {
+                if (this.config.events[i] === false) {
+                    this.events[i] = false;
+                }
+            }
+        }
 
+
         // configurable properties: 
         //    padding, isTarget, maintainOffset, primaryButtonOnly
         this.padding           = this.config.padding || [0, 0, 0, 0];
@@ -2035,6 +2204,7 @@
         this.maintainOffset    = (this.config.maintainOffset);
         this.primaryButtonOnly = (this.config.primaryButtonOnly !== false);
         this.dragOnly = ((this.config.dragOnly === true) ? true : false);
+        this.useShim = ((this.config.useShim === true) ? true : false);
     },
 
     /**
@@ -2082,6 +2252,9 @@
         var el = this.getEl();
 
         if (!this.DDM.verifyEl(el)) {
+            if (el && el.style && (el.style.display == 'none')) {
+            } else {
+            }
             return;
         }
 
@@ -2232,10 +2405,19 @@
 
 
         // firing the mousedown events prior to calculating positions
-        var b4Return = this.b4MouseDown(e);
-        var mDownReturn = this.onMouseDown(e);
+        var b4Return = this.b4MouseDown(e),
+        b4Return2 = true;
 
-        if ((b4Return === false) || (mDownReturn === false)) {
+        if (this.events.b4MouseDown) {
+            b4Return2 = this.fireEvent('b4MouseDownEvent', e);
+        }
+        var mDownReturn = this.onMouseDown(e),
+            mDownReturn2 = true;
+        if (this.events.mouseDown) {
+            mDownReturn2 = this.fireEvent('mouseDownEvent', e);
+        }
+
+        if ((b4Return === false) || (mDownReturn === false) || (b4Return2 === false) || (mDownReturn2 === false)) {
             return;
         }
 
@@ -2276,10 +2458,9 @@
      * @description Method validates that the clicked element
      * was indeed the handle or a valid child of the handle
      * @param {Event} e 
-     * @private
      */
     clickValidator: function(e) {
-        var target = Event.getTarget(e);
+        var target = YAHOO.util.Event.getTarget(e);
         return ( this.isValidHandleChild(target) &&
                     (this.id == this.handleElId || 
                         this.DDM.handleWasClicked(target, this.id)) );
@@ -2621,7 +2802,100 @@
     }
 
 };
+YAHOO.augment(YAHOO.util.DragDrop, YAHOO.util.EventProvider);
 
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 })();
 /**
  * A DragDrop implementation where the linked element follows the 
@@ -2645,7 +2919,7 @@
 
     /**
      * When set to true, the utility automatically tries to scroll the browser
-     * window wehn a drag and drop element is dragged near the viewport boundary.
+     * window when a drag and drop element is dragged near the viewport boundary.
      * Defaults to true.
      * @property scroll
      * @type boolean
@@ -2711,6 +2985,7 @@
         if (!this.deltaSetXY) {
             var aCoord = [oCoord.x, oCoord.y];
             YAHOO.util.Dom.setXY(el, aCoord);
+
             var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
             var newTop  = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
 
@@ -2718,12 +2993,9 @@
         } else {
             YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px");
             YAHOO.util.Dom.setStyle(el, "top",  (oCoord.y + this.deltaSetXY[1]) + "px");
-            //el.style.left = (oCoord.x + this.deltaSetXY[0]) + "px";
-            //el.style.top = (oCoord.y + this.deltaSetXY[1]) + "px";
         }
         
         this.cachePosition(oCoord.x, oCoord.y);
-        //DAV
         var self = this;
         setTimeout(function() {
             self.autoScroll.call(self, oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
@@ -2887,6 +3159,98 @@
 
     */
 
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 });
 /**
  * A DragDrop implementation that inserts an empty, bordered div into
@@ -3113,7 +3477,99 @@
     toString: function() {
         return ("DDProxy " + this.id);
     }
+/**
+* @event mouseDownEvent
+* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
 
+/**
+* @event b4MouseDownEvent
+* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event mouseUpEvent
+* @description Fired from inside DragDropMgr when the drag operation is finished.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4StartDragEvent
+* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event startDragEvent
+* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event b4EndDragEvent
+* @description Fires before the endDragEvent. Returning false will cancel.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event endDragEvent
+* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
+/**
+* @event dragEvent
+* @description Occurs every mousemove event while dragging.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragEvent
+* @description Fires before the dragEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event invalidDropEvent
+* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOutEvent
+* @description Fires before the dragOutEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOutEvent
+* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragEnterEvent
+* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragOverEvent
+* @description Fires before the dragOverEvent.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragOverEvent
+* @description Fires every mousemove event while over a drag and drop object.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event b4DragDropEvent 
+* @description Fires before the dragDropEvent
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+/**
+* @event dragDropEvent
+* @description Fires when the dragged objects is dropped on another.
+* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+*/
+
 });
 /**
  * A DragDrop implementation that does not move, but can be a drop 
@@ -3142,4 +3598,4 @@
         return ("DDTarget " + this.id);
     }
 });
-YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.4.1", build: "742"});
+YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.8.0r4", build: "2449"});
Index: branches/2.8.x/wb/include/yui/dragdrop/index.php
===================================================================
--- branches/2.8.x/wb/include/yui/dragdrop/index.php	(revision 1262)
+++ branches/2.8.x/wb/include/yui/dragdrop/index.php	(revision 1263)
@@ -1,28 +1,55 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-header("Location: ../../../index.php");
-
+<?php
+/*
+*
+*                       About WebsiteBaker
+*
+* Website Baker is a PHP-based Content Management System (CMS)
+* designed with one goal in mind: to enable its users to produce websites
+* with ease.
+*
+*                       LICENSE INFORMATION
+*
+* WebsiteBaker is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* WebsiteBaker is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*
+*                   WebsiteBaker Extra Information
+*
+*
+*/
+/**
+ *
+ * @category        backend
+ * @package         yui
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @filesource		$HeadURL$
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ *
+ * @author          WebsiteBaker Project
+ * @link			http://www.websitebaker2.org/
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @link			http://start.websitebaker2.org/impressum-datenschutz.php
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @version         $Id$
+ * @platform        WebsiteBaker 2.8.x
+ * @requirements    PHP 4.3.4 and higher
+ * @lastmodified    $Date$
+ *
+ */
+
+header("Location: ../../../index.php");
+
 ?>
\ No newline at end of file

Property changes on: branches/2.8.x/wb/include/yui/dragdrop/index.php
___________________________________________________________________
Modified: svn:keywords
## -1 +1,4 ##
-Id
\ No newline at end of property
+Id
+Revision
+HeadURL
+Date
\ No newline at end of property
Index: branches/2.8.x/wb/include/yui/dragdrop/dragdrop-min.js
===================================================================
--- branches/2.8.x/wb/include/yui/dragdrop/dragdrop-min.js	(revision 1262)
+++ branches/2.8.x/wb/include/yui/dragdrop/dragdrop-min.js	(revision 1263)
@@ -1,10 +1,10 @@
 /*
-Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.4.1
+version: 2.8.0r4
 */
-if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(D,C){for(var E in this.ids){for(var B in this.ids[E]){var F=this.ids[E][B];if(!this.isTypeOfDD(F)){continue;}F[D].apply(F,C);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(B){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(C,B){if(!this.initialized){this.init();}if(!this.ids[B]){this.ids[B]={};}this.ids[B][C.id]=C;},removeDDFromGroup:function(D,B){if(!this.ids[B]){this.ids[B]={};}var C=this.ids[B];if(C&&C[D.id]){delete C[D.id];}},_remove:function(C){for(var B in C.groups){if(B&&this.ids[B][C.id]){delete this.ids[B][C.id];}}delete this.handleIds[C.id];},regHandle:function(C,B){if(!this.handleIds[C]){this.handleIds[C]={};}this.handleIds[C][B]=B;},isDragDrop:function(B){return(this.getDDById(B))?true:false;},getRelated:function(G,C){var F=[];for(var E in G.groups){for(var D in this.ids[E]){var B=this.ids[E][D];if(!this.isTypeOfDD(B)){continue;}if(!C||B.isTarget){F[F.length]=B;}}}return F;},isLegalTarget:function(F,E){var C=this.getRelated(F,true);for(var D=0,B=C.length;D<B;++D){if(C[D].id==E.id){return true;}}return false;},isTypeOfDD:function(B){return(B&&B.__ygDragDrop);},isHandle:function(C,B){return(this.handleIds[C]&&this.handleIds[C][B]);},getDDById:function(C){for(var B in this.ids){if(this.ids[B][C]){return this.ids[B][C];}}return null;},handleMouseDown:function(D,C){this.currentTarget=YAHOO.util.Event.getTarget(D);this.dragCurrent=C;var B=C.getEl();this.startX=YAHOO.util.Event.getPageX(D);this.startY=YAHOO.util.Event.getPageY(D);this.deltaX=this.startX-B.offsetLeft;this.deltaY=this.startY-B.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=YAHOO.util.DDM;E.startDrag(E.startX,E.startY);E.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(B,D){clearTimeout(this.clickTimeout);var C=this.dragCurrent;if(C){C.b4StartDrag(B,D);}if(C){C.startDrag(B,D);}this.dragThreshMet=true;},handleMouseUp:function(B){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.handleMouseMove(B);}this.fromTimeout=false;this.fireEvents(B,true);}else{}this.stopDrag(B);this.stopEvent(B);}},stopEvent:function(B){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(B);}if(this.preventDefault){YAHOO.util.Event.preventDefault(B);}},stopDrag:function(C,B){if(this.dragCurrent&&!B){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(C);this.dragCurrent.endDrag(C);}this.dragCurrent.onMouseUp(C);}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(E){var B=this.dragCurrent;if(B){if(YAHOO.util.Event.isIE&&!E.button){this.stopEvent(E);return this.handleMouseUp(E);}if(!this.dragThreshMet){var D=Math.abs(this.startX-YAHOO.util.Event.getPageX(E));var C=Math.abs(this.startY-YAHOO.util.Event.getPageY(E));if(D>this.clickPixelThresh||C>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){B.b4Drag(E);if(B){B.onDrag(E);}if(B){this.fireEvents(E,false);}}this.stopEvent(E);}},fireEvents:function(T,J){var V=this.dragCurrent;if(!V||V.isLocked()||V.dragOnly){return ;}var L=YAHOO.util.Event.getPageX(T),K=YAHOO.util.Event.getPageY(T),M=new YAHOO.util.Point(L,K),H=V.getTargetCoord(M.x,M.y),E=V.getDragEl(),S=new YAHOO.util.Region(H.y,H.x+E.offsetWidth,H.y+E.offsetHeight,H.x),G=[],I=[],D=[],U=[],R=[],C={},N=[];for(var P in this.dragOvers){var W=this.dragOvers[P];if(!this.isTypeOfDD(W)){continue;}if(!this.isOverTarget(M,W,this.mode,S)){I.push(W);}G[P]=true;delete this.dragOvers[P];}for(var O in V.groups){if("string"!=typeof O){continue;}for(P in this.ids[O]){var F=this.ids[O][P];if(!this.isTypeOfDD(F)){continue;}if(F.isTarget&&!F.isLocked()&&F!=V){if(this.isOverTarget(M,F,this.mode,S)){C[O]=true;if(J){U.push(F);}else{if(!G[F.id]){R.push(F);}else{D.push(F);}this.dragOvers[F.id]=F;}}}}}this.interactionInfo={out:I,enter:R,over:D,drop:U,point:M,draggedRegion:S,sourceRegion:this.locationCache[V.id],validDrop:J};for(var B in C){N.push(B);}if(J&&!U.length){this.interactionInfo.validDrop=false;V.onInvalidDrop(T);}if(this.mode){if(I.length){V.b4DragOut(T,I);if(V){V.onDragOut(T,I);}}if(R.length){if(V){V.onDragEnter(T,R,N);}}if(D.length){if(V){V.b4DragOver(T,D,N);}if(V){V.onDragOver(T,D,N);}}if(U.length){if(V){V.b4DragDrop(T,U,N);}if(V){V.onDragDrop(T,U,N);}}}else{var Q=0;for(P=0,Q=I.length;P<Q;++P){if(V){V.b4DragOut(T,I[P].id,N[0]);}if(V){V.onDragOut(T,I[P].id,N[0]);}}for(P=0,Q=R.length;P<Q;++P){if(V){V.onDragEnter(T,R[P].id,N[0]);}}for(P=0,Q=D.length;P<Q;++P){if(V){V.b4DragOver(T,D[P].id,N[0]);}if(V){V.onDragOver(T,D[P].id,N[0]);}}for(P=0,Q=U.length;P<Q;++P){if(V){V.b4DragDrop(T,U[P].id,N[0]);}if(V){V.onDragDrop(T,U[P].id,N[0]);}}}},getBestMatch:function(D){var F=null;var C=D.length;if(C==1){F=D[0];}else{for(var E=0;E<C;++E){var B=D[E];if(this.mode==this.INTERSECT&&B.cursorIsOver){F=B;break;}else{if(!F||!F.overlap||(B.overlap&&F.overlap.getArea()<B.overlap.getArea())){F=B;}}}}return F;},refreshCache:function(C){var E=C||this.ids;for(var B in E){if("string"!=typeof B){continue;}for(var D in this.ids[B]){var F=this.ids[B][D];if(this.isTypeOfDD(F)){var G=this.getLocation(F);if(G){this.locationCache[F.id]=G;}else{delete this.locationCache[F.id];}}}}},verifyEl:function(C){try{if(C){var B=C.offsetParent;
-if(B){return true;}}}catch(D){}return false;},getLocation:function(G){if(!this.isTypeOfDD(G)){return null;}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=YAHOO.util.Dom.getXY(E);}catch(H){}if(!J){return null;}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new YAHOO.util.Region(M,B,I,F);},isOverTarget:function(J,B,D,E){var F=this.locationCache[B.id];if(!F||!this.useCache){F=this.getLocation(B);this.locationCache[B.id]=F;}if(!F){return false;}B.cursorIsOver=F.contains(J);var I=this.dragCurrent;if(!I||(!D&&!I.constrainX&&!I.constrainY)){return B.cursorIsOver;}B.overlap=null;if(!E){var G=I.getTargetCoord(J.x,J.y);var C=I.getDragEl();E=new YAHOO.util.Region(G.y,G.x+C.offsetWidth,G.y+C.offsetHeight,G.x);}var H=E.intersect(F);if(H){B.overlap=H;return(D)?true:B.cursorIsOver;}else{return false;}},_onUnload:function(C,B){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(C){var B=this.elementCache[C];if(!B||!B.el){B=this.elementCache[C]=new this.ElementWrapper(YAHOO.util.Dom.get(C));}return B;},getElement:function(B){return YAHOO.util.Dom.get(B);},getCss:function(C){var B=YAHOO.util.Dom.get(C);return(B)?B.style:null;},ElementWrapper:function(B){this.el=B||null;this.id=this.el&&B.id;this.css=this.el&&B.style;},getPosX:function(B){return YAHOO.util.Dom.getX(B);},getPosY:function(B){return YAHOO.util.Dom.getY(B);},swapNode:function(D,B){if(D.swapNode){D.swapNode(B);}else{var E=B.parentNode;var C=B.nextSibling;if(C==D){E.insertBefore(D,B);}else{if(B==D.nextSibling){E.insertBefore(B,D);}else{D.parentNode.replaceChild(B,D);E.insertBefore(D,C);}}}},getScroll:function(){var D,B,E=document.documentElement,C=document.body;if(E&&(E.scrollTop||E.scrollLeft)){D=E.scrollTop;B=E.scrollLeft;}else{if(C){D=C.scrollTop;B=C.scrollLeft;}else{}}return{top:D,left:B};},getStyle:function(C,B){return YAHOO.util.Dom.getStyle(C,B);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(B,D){var C=YAHOO.util.Dom.getXY(D);YAHOO.util.Dom.setXY(B,C);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(C,B){return(C-B);},_timeoutCount:0,_addListeners:function(){var B=YAHOO.util.DDM;if(YAHOO.util.Event&&document){B._onLoad();}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true;}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true;}else{C=C.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(E,C,D){this.initTarget(E,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(E,C,D){this.config=D||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){return ;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);
-this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(H,G){var D=H.which||H.button;if(this.primaryButtonOnly&&D>1){return ;}if(this.isLocked()){return ;}var C=this.b4MouseDown(H);var E=this.onMouseDown(H);if((C===false)||(E===false)){return ;}this.DDM.refreshCache(this.groups);var F=new YAHOO.util.Point(A.getPageX(H),A.getPageY(H));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(F,this)){}else{if(this.clickValidator(H)){this.setStartPosition();this.DDM.handleMouseDown(H,this);this.DDM.stopEvent(H);}else{}}},clickValidator:function(D){var C=A.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();
-}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return ;}var F=this.getDragEl(),E=YAHOO.util.Dom;if(!F){F=document.createElement("div");F.id=this.dragElId;var D=F.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");F.appendChild(C);A.insertBefore(F,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.4.1",build:"742"});
\ No newline at end of file
+if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event,B=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var C=document.createElement("div");C.id="yui-ddm-shim";if(document.body.firstChild){document.body.insertBefore(C,document.body.firstChild);}else{document.body.appendChild(C);}C.style.display="none";C.style.backgroundColor="red";C.style.position="absolute";C.style.zIndex="99999";B.setStyle(C,"opacity","0");this._shim=C;A.on(C,"mouseup",this.handleMouseUp,this,true);A.on(C,"mousemove",this.handleMouseMove,this,true);A.on(window,"scroll",this._sizeShim,this,true);},_sizeShim:function(){if(this._shimActive){var C=this._shim;C.style.height=B.getDocumentHeight()+"px";C.style.width=B.getDocumentWidth()+"px";C.style.top="0";C.style.left="0";}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim();}this._shimActive=true;var C=this._shim,D="0";if(this._debugShim){D=".5";}B.setStyle(C,"opacity",D);this._sizeShim();C.style.display="block";}},_deactivateShim:function(){this._shim.style.display="none";this._shimActive=false;},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(E,D){for(var F in this.ids){for(var C in this.ids[F]){var G=this.ids[F][C];if(!this.isTypeOfDD(G)){continue;}G[E].apply(G,D);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(C){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(D,C){if(!this.initialized){this.init();}if(!this.ids[C]){this.ids[C]={};}this.ids[C][D.id]=D;},removeDDFromGroup:function(E,C){if(!this.ids[C]){this.ids[C]={};}var D=this.ids[C];if(D&&D[E.id]){delete D[E.id];}},_remove:function(E){for(var D in E.groups){if(D){var C=this.ids[D];if(C&&C[E.id]){delete C[E.id];}}}delete this.handleIds[E.id];},regHandle:function(D,C){if(!this.handleIds[D]){this.handleIds[D]={};}this.handleIds[D][C]=C;},isDragDrop:function(C){return(this.getDDById(C))?true:false;},getRelated:function(H,D){var G=[];for(var F in H.groups){for(var E in this.ids[F]){var C=this.ids[F][E];if(!this.isTypeOfDD(C)){continue;}if(!D||C.isTarget){G[G.length]=C;}}}return G;},isLegalTarget:function(G,F){var D=this.getRelated(G,true);for(var E=0,C=D.length;E<C;++E){if(D[E].id==F.id){return true;}}return false;},isTypeOfDD:function(C){return(C&&C.__ygDragDrop);},isHandle:function(D,C){return(this.handleIds[D]&&this.handleIds[D][C]);},getDDById:function(D){for(var C in this.ids){if(this.ids[C][D]){return this.ids[C][D];}}return null;},handleMouseDown:function(E,D){this.currentTarget=YAHOO.util.Event.getTarget(E);this.dragCurrent=D;var C=D.getEl();this.startX=YAHOO.util.Event.getPageX(E);this.startY=YAHOO.util.Event.getPageY(E);this.deltaX=this.startX-C.offsetLeft;this.deltaY=this.startY-C.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var F=YAHOO.util.DDM;F.startDrag(F.startX,F.startY);F.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(C,E){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true;}this._activateShim();clearTimeout(this.clickTimeout);var D=this.dragCurrent;if(D&&D.events.b4StartDrag){D.b4StartDrag(C,E);D.fireEvent("b4StartDragEvent",{x:C,y:E});}if(D&&D.events.startDrag){D.startDrag(C,E);D.fireEvent("startDragEvent",{x:C,y:E});}this.dragThreshMet=true;},handleMouseUp:function(C){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(C);}this.fromTimeout=false;this.fireEvents(C,true);}else{}this.stopDrag(C);this.stopEvent(C);}},stopEvent:function(C){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(C);}if(this.preventDefault){YAHOO.util.Event.preventDefault(C);}},stopDrag:function(E,D){var C=this.dragCurrent;if(C&&!D){if(this.dragThreshMet){if(C.events.b4EndDrag){C.b4EndDrag(E);C.fireEvent("b4EndDragEvent",{e:E});}if(C.events.endDrag){C.endDrag(E);C.fireEvent("endDragEvent",{e:E});}}if(C.events.mouseUp){C.onMouseUp(E);C.fireEvent("mouseUpEvent",{e:E});}}if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false;}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(F){var C=this.dragCurrent;if(C){if(YAHOO.util.Event.isIE&&!F.button){this.stopEvent(F);return this.handleMouseUp(F);}else{if(F.clientX<0||F.clientY<0){}}if(!this.dragThreshMet){var E=Math.abs(this.startX-YAHOO.util.Event.getPageX(F));var D=Math.abs(this.startY-YAHOO.util.Event.getPageY(F));if(E>this.clickPixelThresh||D>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(C&&C.events.b4Drag){C.b4Drag(F);C.fireEvent("b4DragEvent",{e:F});}if(C&&C.events.drag){C.onDrag(F);C.fireEvent("dragEvent",{e:F});}if(C){this.fireEvents(F,false);}}this.stopEvent(F);}},fireEvents:function(V,L){var a=this.dragCurrent;if(!a||a.isLocked()||a.dragOnly){return;}var N=YAHOO.util.Event.getPageX(V),M=YAHOO.util.Event.getPageY(V),P=new YAHOO.util.Point(N,M),K=a.getTargetCoord(P.x,P.y),F=a.getDragEl(),E=["out","over","drop","enter"],U=new YAHOO.util.Region(K.y,K.x+F.offsetWidth,K.y+F.offsetHeight,K.x),I=[],D={},Q=[],c={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var S in this.dragOvers){var d=this.dragOvers[S];if(!this.isTypeOfDD(d)){continue;
+}if(!this.isOverTarget(P,d,this.mode,U)){c.outEvts.push(d);}I[S]=true;delete this.dragOvers[S];}for(var R in a.groups){if("string"!=typeof R){continue;}for(S in this.ids[R]){var G=this.ids[R][S];if(!this.isTypeOfDD(G)){continue;}if(G.isTarget&&!G.isLocked()&&G!=a){if(this.isOverTarget(P,G,this.mode,U)){D[R]=true;if(L){c.dropEvts.push(G);}else{if(!I[G.id]){c.enterEvts.push(G);}else{c.overEvts.push(G);}this.dragOvers[G.id]=G;}}}}}this.interactionInfo={out:c.outEvts,enter:c.enterEvts,over:c.overEvts,drop:c.dropEvts,point:P,draggedRegion:U,sourceRegion:this.locationCache[a.id],validDrop:L};for(var C in D){Q.push(C);}if(L&&!c.dropEvts.length){this.interactionInfo.validDrop=false;if(a.events.invalidDrop){a.onInvalidDrop(V);a.fireEvent("invalidDropEvent",{e:V});}}for(S=0;S<E.length;S++){var Y=null;if(c[E[S]+"Evts"]){Y=c[E[S]+"Evts"];}if(Y&&Y.length){var H=E[S].charAt(0).toUpperCase()+E[S].substr(1),X="onDrag"+H,J="b4Drag"+H,O="drag"+H+"Event",W="drag"+H;if(this.mode){if(a.events[J]){a[J](V,Y,Q);a.fireEvent(J+"Event",{event:V,info:Y,group:Q});}if(a.events[W]){a[X](V,Y,Q);a.fireEvent(O,{event:V,info:Y,group:Q});}}else{for(var Z=0,T=Y.length;Z<T;++Z){if(a.events[J]){a[J](V,Y[Z].id,Q[0]);a.fireEvent(J+"Event",{event:V,info:Y[Z].id,group:Q[0]});}if(a.events[W]){a[X](V,Y[Z].id,Q[0]);a.fireEvent(O,{event:V,info:Y[Z].id,group:Q[0]});}}}}}},getBestMatch:function(E){var G=null;var D=E.length;if(D==1){G=E[0];}else{for(var F=0;F<D;++F){var C=E[F];if(this.mode==this.INTERSECT&&C.cursorIsOver){G=C;break;}else{if(!G||!G.overlap||(C.overlap&&G.overlap.getArea()<C.overlap.getArea())){G=C;}}}}return G;},refreshCache:function(D){var F=D||this.ids;for(var C in F){if("string"!=typeof C){continue;}for(var E in this.ids[C]){var G=this.ids[C][E];if(this.isTypeOfDD(G)){var H=this.getLocation(G);if(H){this.locationCache[G.id]=H;}else{delete this.locationCache[G.id];}}}}},verifyEl:function(D){try{if(D){var C=D.offsetParent;if(C){return true;}}}catch(E){}return false;},getLocation:function(H){if(!this.isTypeOfDD(H)){return null;}var F=H.getEl(),K,E,D,M,L,N,C,J,G;try{K=YAHOO.util.Dom.getXY(F);}catch(I){}if(!K){return null;}E=K[0];D=E+F.offsetWidth;M=K[1];L=M+F.offsetHeight;N=M-H.padding[0];C=D+H.padding[1];J=L+H.padding[2];G=E-H.padding[3];return new YAHOO.util.Region(N,C,J,G);},isOverTarget:function(K,C,E,F){var G=this.locationCache[C.id];if(!G||!this.useCache){G=this.getLocation(C);this.locationCache[C.id]=G;}if(!G){return false;}C.cursorIsOver=G.contains(K);var J=this.dragCurrent;if(!J||(!E&&!J.constrainX&&!J.constrainY)){return C.cursorIsOver;}C.overlap=null;if(!F){var H=J.getTargetCoord(K.x,K.y);var D=J.getDragEl();F=new YAHOO.util.Region(H.y,H.x+D.offsetWidth,H.y+D.offsetHeight,H.x);}var I=F.intersect(G);if(I){C.overlap=I;return(E)?true:C.cursorIsOver;}else{return false;}},_onUnload:function(D,C){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(D){var C=this.elementCache[D];if(!C||!C.el){C=this.elementCache[D]=new this.ElementWrapper(YAHOO.util.Dom.get(D));}return C;},getElement:function(C){return YAHOO.util.Dom.get(C);},getCss:function(D){var C=YAHOO.util.Dom.get(D);return(C)?C.style:null;},ElementWrapper:function(C){this.el=C||null;this.id=this.el&&C.id;this.css=this.el&&C.style;},getPosX:function(C){return YAHOO.util.Dom.getX(C);},getPosY:function(C){return YAHOO.util.Dom.getY(C);},swapNode:function(E,C){if(E.swapNode){E.swapNode(C);}else{var F=C.parentNode;var D=C.nextSibling;if(D==E){F.insertBefore(E,C);}else{if(C==E.nextSibling){F.insertBefore(C,E);}else{E.parentNode.replaceChild(C,E);F.insertBefore(E,D);}}}},getScroll:function(){var E,C,F=document.documentElement,D=document.body;if(F&&(F.scrollTop||F.scrollLeft)){E=F.scrollTop;C=F.scrollLeft;}else{if(D){E=D.scrollTop;C=D.scrollLeft;}else{}}return{top:E,left:C};},getStyle:function(D,C){return YAHOO.util.Dom.getStyle(D,C);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(C,E){var D=YAHOO.util.Dom.getXY(E);YAHOO.util.Dom.setXY(C,D);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(D,C){return(D-C);},_timeoutCount:0,_addListeners:function(){var C=YAHOO.util.DDM;if(YAHOO.util.Event&&document){C._onLoad();}else{if(C._timeoutCount>2000){}else{setTimeout(C._addListeners,10);if(document&&document.body){C._timeoutCount+=1;}}}},handleWasClicked:function(C,E){if(this.isHandle(E,C.id)){return true;}else{var D=C.parentNode;while(D){if(this.isHandle(E,D.id)){return true;}else{D=D.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);
+}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(J,I){var D=J.which||J.button;if(this.primaryButtonOnly&&D>1){return;}if(this.isLocked()){return;}var C=this.b4MouseDown(J),F=true;if(this.events.b4MouseDown){F=this.fireEvent("b4MouseDownEvent",J);}var E=this.onMouseDown(J),H=true;if(this.events.mouseDown){H=this.fireEvent("mouseDownEvent",J);}if((C===false)||(E===false)||(F===false)||(H===false)){return;}this.DDM.refreshCache(this.groups);var G=new YAHOO.util.Point(A.getPageX(J),A.getPageY(J));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(G,this)){}else{if(this.clickValidator(J)){this.setStartPosition();this.DDM.handleMouseDown(J,this);this.DDM.stopEvent(J);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);
+}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return;}var F=this.getDragEl(),E=YAHOO.util.Dom;if(!F){F=document.createElement("div");F.id=this.dragElId;var D=F.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");F.appendChild(C);A.insertBefore(F,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.8.0r4",build:"2449"});
\ No newline at end of file
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1262)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1263)
@@ -55,6 +55,6 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.1');
-if(!defined('REVISION')) define('REVISION', '1262');
+if(!defined('REVISION')) define('REVISION', '1263');
 
 ?>
\ No newline at end of file
