Upgraded the YUI libs to version 0.12.0, released 14 Nov 2006.

This commit is contained in:
vyshane 2006-11-23 03:10:20 +00:00
parent 6418486c69
commit d38ed4fba2
79 changed files with 45819 additions and 28246 deletions

View file

@ -5,4 +5,5 @@ from:
http://developer.yahoo.com/yui
Added to Moodle 13th July, 2006
Added to Moodle 13 July 2006
Updated to YUI 0.12.0, 23 November 2006

View file

@ -1,5 +1,18 @@
Animation Release Notes
*** version 0.12.0 ***
* added boolean finish argument to Anim.stop()
*** version 0.11.3 ***
* no changes
*** version 0.11.1 ***
* changed "prototype" shorthand to "proto" (workaround firefox < 1.5 scoping
bug)
*** version 0.11.0 ***
* ColorAnim subclass added
@ -18,3 +31,4 @@ Animation Release Notes
* Initial release

View file

@ -2,21 +2,27 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.11.0
version: 0.12.0
*/
/**
* The animation module provides allows effects to be added to HTMLElements.
* @module animation
*/
/**
*
* Base class for animated DOM objects.
* @class Base animation class that provides the interface for building animated effects.
* Base animation class that provides the interface for building animated effects.
* <p>Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);</p>
* @class Anim
* @namespace YAHOO.util
* @requires YAHOO.util.AnimMgr
* @requires YAHOO.util.Easing
* @requires YAHOO.util.Dom
* @requires YAHOO.util.Event
* @requires YAHOO.util.CustomEvent
* @constructor
* @param {String or HTMLElement} el Reference to the element that will be animated
* @param {String | HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
* Each attribute is an object with at minimum a "to" or "by" member defined.
* Additional optional members are "from" (defaults to current value), "units" (defaults to "px").
@ -33,8 +39,9 @@ YAHOO.util.Anim = function(el, attributes, duration, method) {
YAHOO.util.Anim.prototype = {
/**
* toString method
* @return {String} string represenation of anim obj
* Provides a readable name for the Anim instance.
* @method toString
* @return {String}
*/
toString: function() {
var el = this.getEl();
@ -51,6 +58,7 @@ YAHOO.util.Anim.prototype = {
/**
* Returns the value computed by the animation's "method".
* @method doMethod
* @param {String} attr The name of the attribute.
* @param {Number} start The value this attribute should start from for this animation.
* @param {Number} end The value this attribute should end at for this animation.
@ -61,7 +69,8 @@ YAHOO.util.Anim.prototype = {
},
/**
* Applies a value to an attribute
* Applies a value to an attribute.
* @method setAttribute
* @param {String} attr The name of the attribute.
* @param {Number} val The value to be applied to the attribute.
* @param {String} unit The unit ('px', '%', etc.) of the value.
@ -76,6 +85,7 @@ YAHOO.util.Anim.prototype = {
/**
* Returns current value of the attribute.
* @method getAttribute
* @param {String} attr The name of the attribute.
* @return {Number} val The current value of the attribute.
*/
@ -103,7 +113,7 @@ YAHOO.util.Anim.prototype = {
/**
* Returns the unit to use when none is supplied.
* Applies the "defaultUnit" test to decide whether to use pixels or not
* @method getDefaultUnit
* @param {attr} attr The name of the attribute.
* @return {String} The default unit to be used.
*/
@ -117,6 +127,7 @@ YAHOO.util.Anim.prototype = {
/**
* Sets the actual values to be used during the animation.
* @method setRuntimeAttribute
* Should only be needed for subclass use.
* @param {Object} attr The attribute object
* @private
@ -160,7 +171,9 @@ YAHOO.util.Anim.prototype = {
},
/**
* @param {String or HTMLElement} el Reference to the element that will be animated
* Constructor for Anim instance.
* @method init
* @param {String | HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
* Each attribute is an object with at minimum a "to" or "by" member defined.
* Additional optional members are "from" (defaults to current value), "units" (defaults to "px").
@ -171,6 +184,7 @@ YAHOO.util.Anim.prototype = {
init: function(el, attributes, duration, method) {
/**
* Whether or not the animation is running.
* @property isAnimated
* @private
* @type Boolean
*/
@ -178,6 +192,7 @@ YAHOO.util.Anim.prototype = {
/**
* A Date object that is created when the animation begins.
* @property startTime
* @private
* @type Date
*/
@ -185,6 +200,7 @@ YAHOO.util.Anim.prototype = {
/**
* The number of frames this animation was able to execute.
* @property actualFrames
* @private
* @type Int
*/
@ -192,6 +208,7 @@ YAHOO.util.Anim.prototype = {
/**
* The element to be animated.
* @property el
* @private
* @type HTMLElement
*/
@ -203,14 +220,15 @@ YAHOO.util.Anim.prototype = {
* If "to" is supplied, the animation will end with the attribute at that value.
* If "by" is supplied, the animation will end at that value plus its starting value.
* If both are supplied, "to" is used, and "by" is ignored.
* @member YAHOO#util#Anim
* Optional additional member include "from" (the value the attribute should start animating from, defaults to current value), and "unit" (the units to apply to the values).
* @property attributes
* @type Object
*/
this.attributes = attributes || {};
/**
* The length of the animation. Defaults to "1" (second).
* @property duration
* @type Number
*/
this.duration = duration || 1;
@ -218,6 +236,7 @@ YAHOO.util.Anim.prototype = {
/**
* The method that will provide values to the attribute(s) during the animation.
* Defaults to "YAHOO.util.Easing.easeNone".
* @property method
* @type Function
*/
this.method = method || YAHOO.util.Easing.easeNone;
@ -225,6 +244,7 @@ YAHOO.util.Anim.prototype = {
/**
* Whether or not the duration should be treated as seconds.
* Defaults to true.
* @property useSeconds
* @type Boolean
*/
this.useSeconds = true; // default to seconds
@ -232,6 +252,7 @@ YAHOO.util.Anim.prototype = {
/**
* The location of the current animation on the timeline.
* In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.
* @property currentFrame
* @type Int
*/
this.currentFrame = 0;
@ -239,6 +260,7 @@ YAHOO.util.Anim.prototype = {
/**
* The total number of frames to be executed.
* In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.
* @property totalFrames
* @type Int
*/
this.totalFrames = YAHOO.util.AnimMgr.fps;
@ -246,12 +268,14 @@ YAHOO.util.Anim.prototype = {
/**
* Returns a reference to the animated element.
* @method getEl
* @return {HTMLElement}
*/
this.getEl = function() { return el; };
/**
* Checks whether the element is currently animated.
* @method isAnimated
* @return {Boolean} current value of isAnimated.
*/
this.isAnimated = function() {
@ -260,6 +284,7 @@ YAHOO.util.Anim.prototype = {
/**
* Returns the animation start time.
* @method getStartTime
* @return {Date} current value of startTime.
*/
this.getStartTime = function() {
@ -275,6 +300,7 @@ YAHOO.util.Anim.prototype = {
/**
* Starts the animation by registering it with the animation manager.
* @method animate
*/
this.animate = function() {
if ( this.isAnimated() ) { return false; }
@ -288,13 +314,21 @@ YAHOO.util.Anim.prototype = {
/**
* Stops the animation. Normally called by AnimMgr when animation completes.
* @method stop
* @param {Boolean} finish (optional) If true, animation will jump to final frame.
*/
this.stop = function() {
this.stop = function(finish) {
if (finish) {
this.currentFrame = this.totalFrames;
this._onTween.fire();
}
YAHOO.util.AnimMgr.stop(this);
};
var onStart = function() {
this.onStart.fire();
this.runtimeAttributes = {};
for (var attr in this.attributes) {
this.setRuntimeAttribute(attr);
}
@ -364,12 +398,14 @@ YAHOO.util.Anim.prototype = {
/**
* Custom event that fires when animation begins
* Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction)
* @event onStart
*/
this.onStart = new YAHOO.util.CustomEvent('start', this);
/**
* Custom event that fires between each frame
* Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction)
* @event onTween
*/
this.onTween = new YAHOO.util.CustomEvent('tween', this);
@ -382,6 +418,7 @@ YAHOO.util.Anim.prototype = {
/**
* Custom event that fires when animation ends
* Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction)
* @event onComplete
*/
this.onComplete = new YAHOO.util.CustomEvent('complete', this);
/**
@ -396,20 +433,16 @@ YAHOO.util.Anim.prototype = {
}
};
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.10.0
*/
/**
* @class Handles animation queueing and threading.
* Handles animation queueing and threading.
* Used by Anim and subclasses.
* @class AnimMgr
* @namespace YAHOO.util
*/
YAHOO.util.AnimMgr = new function() {
/**
* Reference to the animation Interval
* Reference to the animation Interval.
* @property thread
* @private
* @type Int
*/
@ -417,6 +450,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* The current queue of registered animation objects.
* @property queue
* @private
* @type Array
*/
@ -424,6 +458,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* The number of active animations.
* @property tweenCount
* @private
* @type Int
*/
@ -432,6 +467,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Base frame rate (frames per second).
* Arbitrarily high for better x-browser calibration (slower browsers drop more frames).
* @property fps
* @type Int
*
*/
@ -439,6 +475,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Interval delay in milliseconds, defaults to fastest possible.
* @property delay
* @type Int
*
*/
@ -447,6 +484,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Adds an animation instance to the animation queue.
* All animation instances must be registered in order to animate.
* @method registerElement
* @param {object} tween The Anim instance to be be registered
*/
this.registerElement = function(tween) {
@ -456,6 +494,14 @@ YAHOO.util.AnimMgr = new function() {
this.start();
};
/**
* removes an animation instance from the animation queue.
* All animation instances must be registered in order to animate.
* @method unRegister
* @param {object} tween The Anim instance to be be registered
* @param {Int} index The index of the Anim instance
* @private
*/
this.unRegister = function(tween, index) {
tween._onComplete.fire();
index = index || getIndex(tween);
@ -468,6 +514,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Starts the animation thread.
* Only one thread can run at a time.
* @method start
*/
this.start = function() {
if (thread === null) { thread = setInterval(this.run, this.delay); }
@ -475,6 +522,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Stops the animation thread or a specific animation instance.
* @method stop
* @param {object} tween A specific Anim instance to stop (optional)
* If no instance given, Manager stops thread and all animations.
*/
@ -497,6 +545,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Called per Interval to handle each animation frame.
* @method run
*/
this.run = function() {
for (var i = 0, len = queue.length; i < len; ++i) {
@ -527,6 +576,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* On the fly frame correction to keep animation on time.
* @method correctFrame
* @private
* @param {Object} tween The Anim instance being corrected.
*/
@ -551,16 +601,10 @@ YAHOO.util.AnimMgr = new function() {
}
};
};
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.10.0
*/
/**
*
* @class Used to calculate Bezier splines for any number of control points.
* Used to calculate Bezier splines for any number of control points.
* @class Bezier
* @namespace YAHOO.util
*
*/
YAHOO.util.Bezier = new function()
@ -571,6 +615,7 @@ YAHOO.util.Bezier = new function()
* At least 2 points are required (start and end).
* First point is start. Last point is end.
* Additional control points are optional.
* @method getPosition
* @param {Array} points An array containing Bezier points
* @param {Number} t A number between 0 and 1 which is the basis for determining current position
* @return {Array} An array containing int x and y member data
@ -596,9 +641,11 @@ YAHOO.util.Bezier = new function()
};
};
/**
* @class ColorAnim subclass for color fading
* <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code></p>
* <p>Color values can be specified with either 112233, #112233, [255,255,255], or rgb(255,255,255)
* Anim subclass for color transitions.
* <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code> Color values can be specified with either 112233, #112233,
* [255,255,255], or rgb(255,255,255)</p>
* @class ColorAnim
* @namespace YAHOO.util
* @requires YAHOO.util.Anim
* @requires YAHOO.util.AnimMgr
* @requires YAHOO.util.Easing
@ -606,13 +653,14 @@ YAHOO.util.Bezier = new function()
* @requires YAHOO.util.Dom
* @requires YAHOO.util.Event
* @constructor
* @extends YAHOO.util.Anim
* @param {HTMLElement | String} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
* Each attribute is an object with at minimum a "to" or "by" member defined.
* Additional optional members are "from" (defaults to current value), "units" (defaults to "px").
* All attribute names use camelCase.
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
* @param {Function} method (optional, defaults to Y.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a Y.Easing method)
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
*/
(function() {
YAHOO.util.ColorAnim = function(el, attributes, duration, method) {
@ -624,33 +672,27 @@ YAHOO.util.Bezier = new function()
// shorthand
var Y = YAHOO.util;
var superclass = Y.ColorAnim.superclass;
var prototype = Y.ColorAnim.prototype;
var proto = Y.ColorAnim.prototype;
/**
* toString method
* @return {String} string represenation of anim obj
*/
prototype.toString = function() {
proto.toString = function() {
var el = this.getEl();
var id = el.id || el.tagName;
return ("ColorAnim " + id);
};
/**
* Only certain attributes should be treated as colors.
* @type Object
*/
prototype.patterns.color = /color$/i;
prototype.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
prototype.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
prototype.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
proto.patterns.color = /color$/i;
proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/; // need rgba for safari
/**
* Attempts to parse the given string and return a 3-tuple.
* @method parseColor
* @param {String} s The string to parse.
* @return {Array} The 3-tuple of rgb values.
*/
prototype.parseColor = function(s) {
proto.parseColor = function(s) {
if (s.length == 3) { return s; }
var c = this.patterns.hex.exec(s);
@ -671,25 +713,20 @@ YAHOO.util.Bezier = new function()
return null;
};
/**
* Returns current value of the attribute.
* @param {String} attr The name of the attribute.
* @return {Number} val The current value of the attribute.
*/
prototype.getAttribute = function(attr) {
proto.getAttribute = function(attr) {
var el = this.getEl();
if ( this.patterns.color.test(attr) ) {
var val = YAHOO.util.Dom.getStyle(el, attr);
if (val == 'transparent') { // bgcolor default
if (this.patterns.transparent.test(val)) { // bgcolor default
var parent = el.parentNode; // try and get from an ancestor
val = Y.Dom.getStyle(parent, attr);
while (parent && val == 'transparent') {
while (parent && this.patterns.transparent.test(val)) {
parent = parent.parentNode;
val = Y.Dom.getStyle(parent, attr);
if (parent.tagName.toUpperCase() == 'HTML') {
val = 'ffffff';
val = '#fff';
}
}
}
@ -700,14 +737,7 @@ YAHOO.util.Bezier = new function()
return val;
};
/**
* Returns the value computed by the animation's "method".
* @param {String} attr The name of the attribute.
* @param {Number} start The value this attribute should start from for this animation.
* @param {Number} end The value this attribute should end at for this animation.
* @return {Number} The Value to be applied to the attribute.
*/
prototype.doMethod = function(attr, start, end) {
proto.doMethod = function(attr, start, end) {
var val;
if ( this.patterns.color.test(attr) ) {
@ -725,13 +755,7 @@ YAHOO.util.Bezier = new function()
return val;
};
/**
* Sets the actual values to be used during the animation.
* Should only be needed for subclass use.
* @param {Object} attr The attribute object
* @private
*/
prototype.setRuntimeAttribute = function(attr) {
proto.setRuntimeAttribute = function(attr) {
superclass.setRuntimeAttribute.call(this, attr);
if ( this.patterns.color.test(attr) ) {
@ -754,7 +778,7 @@ YAHOO.util.Bezier = new function()
})();/*
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright © 2001 Robert Penner All rights reserved.
Copyright 2001 Robert Penner All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@ -763,18 +787,24 @@ Redistribution and use in source and binary forms, with or without modification,
* Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Singleton that determines how an animation proceeds from start to end.
* @class Easing
* @namespace YAHOO.util
*/
YAHOO.util.Easing = {
/**
* Uniform speed between points.
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeNone
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeNone: function (t, b, c, d) {
return c*t/d + b;
@ -782,11 +812,12 @@ YAHOO.util.Easing = {
/**
* Begins slowly and accelerates towards end. (quadratic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeIn
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeIn: function (t, b, c, d) {
return c*(t/=d)*t + b;
@ -794,11 +825,12 @@ YAHOO.util.Easing = {
/**
* Begins quickly and decelerates towards end. (quadratic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeOut
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeOut: function (t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
@ -806,11 +838,12 @@ YAHOO.util.Easing = {
/**
* Begins slowly and decelerates towards end. (quadratic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeBoth
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeBoth: function (t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
@ -819,11 +852,12 @@ YAHOO.util.Easing = {
/**
* Begins slowly and accelerates towards end. (quartic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeInStrong
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeInStrong: function (t, b, c, d) {
return c*(t/=d)*t*t*t + b;
@ -831,11 +865,12 @@ YAHOO.util.Easing = {
/**
* Begins quickly and decelerates towards end. (quartic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeOutStrong
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeOutStrong: function (t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
@ -843,11 +878,12 @@ YAHOO.util.Easing = {
/**
* Begins slowly and decelerates towards end. (quartic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeBothStrong
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeBothStrong: function (t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
@ -855,13 +891,14 @@ YAHOO.util.Easing = {
},
/**
* snap in elastic effect
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* Snap in elastic effect.
* @method elasticIn
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} p Period (optional)
* @return {Number} The computed value for the current animation frame.
* @return {Number} The computed value for the current animation frame
*/
elasticIn: function (t, b, c, d, a, p) {
@ -872,13 +909,14 @@ YAHOO.util.Easing = {
},
/**
* snap out elastic effect
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* Snap out elastic effect.
* @method elasticOut
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} p Period (optional)
* @return {Number} The computed value for the current animation frame.
* @return {Number} The computed value for the current animation frame
*/
elasticOut: function (t, b, c, d, a, p) {
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
@ -888,13 +926,14 @@ YAHOO.util.Easing = {
},
/**
* snap both elastic effect
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* Snap both elastic effect.
* @method elasticBoth
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} p Period (optional)
* @return {Number} The computed value for the current animation frame.
* @return {Number} The computed value for the current animation frame
*/
elasticBoth: function (t, b, c, d, a, p) {
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
@ -906,13 +945,14 @@ YAHOO.util.Easing = {
/**
* back easing in - backtracking slightly, then reversing direction and moving to target
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @param {Number) s Overshoot (optional)
* @return {Number} The computed value for the current animation frame.
* Backtracks slightly, then reverses direction and moves to end.
* @method backIn
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} s Overshoot (optional)
* @return {Number} The computed value for the current animation frame
*/
backIn: function (t, b, c, d, s) {
if (typeof s == 'undefined') s = 1.70158;
@ -920,14 +960,14 @@ YAHOO.util.Easing = {
},
/**
* back easing out - moving towards target, overshooting it slightly,
* then reversing and coming back to target
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @param {Number) s Overshoot (optional)
* @return {Number} The computed value for the current animation frame.
* Overshoots end, then reverses and comes back to end.
* @method backOut
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} s Overshoot (optional)
* @return {Number} The computed value for the current animation frame
*/
backOut: function (t, b, c, d, s) {
if (typeof s == 'undefined') s = 1.70158;
@ -935,14 +975,15 @@ YAHOO.util.Easing = {
},
/**
* back easing in/out - backtracking slightly, then reversing direction and moving to target,
* then overshooting target, reversing, and finally coming back to target
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @param {Number) s Overshoot (optional)
* @return {Number} The computed value for the current animation frame.
* Backtracks slightly, then reverses direction, overshoots end,
* then reverses and comes back to end.
* @method backBoth
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} s Overshoot (optional)
* @return {Number} The computed value for the current animation frame
*/
backBoth: function (t, b, c, d, s) {
if (typeof s == 'undefined') s = 1.70158;
@ -951,24 +992,26 @@ YAHOO.util.Easing = {
},
/**
* bounce in
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* Bounce off of start.
* @method bounceIn
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
bounceIn: function (t, b, c, d) {
return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b;
},
/**
* bounce out
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* Bounces off end.
* @method bounceOut
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
bounceOut: function (t, b, c, d) {
if ((t/=d) < (1/2.75)) {
@ -983,12 +1026,13 @@ YAHOO.util.Easing = {
},
/**
* bounce both
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* Bounces off start and end.
* @method bounceBoth
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
bounceBoth: function (t, b, c, d) {
if (t < d/2) return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b;
@ -996,16 +1040,12 @@ YAHOO.util.Easing = {
}
};
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.10.0
*/
/**
* @class Anim subclass for moving elements along a path defined by the "points" member of "attributes". All "points" are arrays with x, y coordinates.
* Anim subclass for moving elements along a path defined by the "points"
* member of "attributes". All "points" are arrays with x, y coordinates.
* <p>Usage: <code>var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>
* @class Motion
* @namespace YAHOO.util
* @requires YAHOO.util.Anim
* @requires YAHOO.util.AnimMgr
* @requires YAHOO.util.Easing
@ -1014,7 +1054,8 @@ Version: 0.10.0
* @requires YAHOO.util.Event
* @requires YAHOO.util.CustomEvent
* @constructor
* @param {String or HTMLElement} el Reference to the element that will be animated
* @extends YAHOO.util.Anim
* @param {String | HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
* Each attribute is an object with at minimum a "to" or "by" member defined.
* Additional optional members are "from" (defaults to current value), "units" (defaults to "px").
@ -1034,27 +1075,17 @@ Version: 0.10.0
// shorthand
var Y = YAHOO.util;
var superclass = Y.Motion.superclass;
var prototype = Y.Motion.prototype;
var proto = Y.Motion.prototype;
/**
* toString method
* @return {String} string represenation of anim obj
*/
prototype.toString = function() {
proto.toString = function() {
var el = this.getEl();
var id = el.id || el.tagName;
return ("Motion " + id);
};
prototype.patterns.points = /^points$/i;
proto.patterns.points = /^points$/i;
/**
* Applies a value to an attribute
* @param {String} attr The name of the attribute.
* @param {Number} val The value to be applied to the attribute.
* @param {String} unit The unit ('px', '%', etc.) of the value.
*/
prototype.setAttribute = function(attr, val, unit) {
proto.setAttribute = function(attr, val, unit) {
if ( this.patterns.points.test(attr) ) {
unit = unit || 'px';
superclass.setAttribute.call(this, 'left', val[0], unit);
@ -1064,12 +1095,7 @@ Version: 0.10.0
}
};
/**
* Sets the default value to be used when "from" is not supplied.
* @param {String} attr The attribute being set.
* @param {Number} val The default value to be applied to the attribute.
*/
prototype.getAttribute = function(attr) {
proto.getAttribute = function(attr) {
if ( this.patterns.points.test(attr) ) {
var val = [
superclass.getAttribute.call(this, 'left'),
@ -1082,14 +1108,7 @@ Version: 0.10.0
return val;
};
/**
* Returns the value computed by the animation's "method".
* @param {String} attr The name of the attribute.
* @param {Number} start The value this attribute should start from for this animation.
* @param {Number} end The value this attribute should end at for this animation.
* @return {Number} The Value to be applied to the attribute.
*/
prototype.doMethod = function(attr, start, end) {
proto.doMethod = function(attr, start, end) {
var val = null;
if ( this.patterns.points.test(attr) ) {
@ -1101,13 +1120,7 @@ Version: 0.10.0
return val;
};
/**
* Sets the actual values to be used during the animation.
* Should only be needed for subclass use.
* @param {Object} attr The attribute object
* @private
*/
prototype.setRuntimeAttribute = function(attr) {
proto.setRuntimeAttribute = function(attr) {
if ( this.patterns.points.test(attr) ) {
var el = this.getEl();
var attributes = this.attributes;
@ -1179,16 +1192,12 @@ Version: 0.10.0
return (typeof prop !== 'undefined');
};
})();
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.10.0
*/
/**
* @class Anim subclass for scrolling elements to a position defined by the "scroll" member of "attributes". All "scroll" members are arrays with x, y scroll positions.
* Anim subclass for scrolling elements to a position defined by the "scroll"
* member of "attributes". All "scroll" members are arrays with x, y scroll positions.
* <p>Usage: <code>var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>
* @class Scroll
* @namespace YAHOO.util
* @requires YAHOO.util.Anim
* @requires YAHOO.util.AnimMgr
* @requires YAHOO.util.Easing
@ -1196,6 +1205,7 @@ Version: 0.10.0
* @requires YAHOO.util.Dom
* @requires YAHOO.util.Event
* @requires YAHOO.util.CustomEvent
* @extends YAHOO.util.Anim
* @constructor
* @param {String or HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
@ -1217,26 +1227,15 @@ Version: 0.10.0
// shorthand
var Y = YAHOO.util;
var superclass = Y.Scroll.superclass;
var prototype = Y.Scroll.prototype;
var proto = Y.Scroll.prototype;
/**
* toString method
* @return {String} string represenation of anim obj
*/
prototype.toString = function() {
proto.toString = function() {
var el = this.getEl();
var id = el.id || el.tagName;
return ("Scroll " + id);
};
/**
* Returns the value computed by the animation's "method".
* @param {String} attr The name of the attribute.
* @param {Number} start The value this attribute should start from for this animation.
* @param {Number} end The value this attribute should end at for this animation.
* @return {Number} The Value to be applied to the attribute.
*/
prototype.doMethod = function(attr, start, end) {
proto.doMethod = function(attr, start, end) {
var val = null;
if (attr == 'scroll') {
@ -1251,12 +1250,7 @@ Version: 0.10.0
return val;
};
/**
* Returns current value of the attribute.
* @param {String} attr The name of the attribute.
* @return {Number} val The current value of the attribute.
*/
prototype.getAttribute = function(attr) {
proto.getAttribute = function(attr) {
var val = null;
var el = this.getEl();
@ -1269,13 +1263,7 @@ Version: 0.10.0
return val;
};
/**
* Applies a value to an attribute
* @param {String} attr The name of the attribute.
* @param {Number} val The value to be applied to the attribute.
* @param {String} unit The unit ('px', '%', etc.) of the value.
*/
prototype.setAttribute = function(attr, val, unit) {
proto.setAttribute = function(attr, val, unit) {
var el = this.getEl();
if (attr == 'scroll') {

File diff suppressed because one or more lines are too long

View file

@ -2,21 +2,27 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.11.0
version: 0.12.0
*/
/**
* The animation module provides allows effects to be added to HTMLElements.
* @module animation
*/
/**
*
* Base class for animated DOM objects.
* @class Base animation class that provides the interface for building animated effects.
* Base animation class that provides the interface for building animated effects.
* <p>Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);</p>
* @class Anim
* @namespace YAHOO.util
* @requires YAHOO.util.AnimMgr
* @requires YAHOO.util.Easing
* @requires YAHOO.util.Dom
* @requires YAHOO.util.Event
* @requires YAHOO.util.CustomEvent
* @constructor
* @param {String or HTMLElement} el Reference to the element that will be animated
* @param {String | HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
* Each attribute is an object with at minimum a "to" or "by" member defined.
* Additional optional members are "from" (defaults to current value), "units" (defaults to "px").
@ -33,8 +39,9 @@ YAHOO.util.Anim = function(el, attributes, duration, method) {
YAHOO.util.Anim.prototype = {
/**
* toString method
* @return {String} string represenation of anim obj
* Provides a readable name for the Anim instance.
* @method toString
* @return {String}
*/
toString: function() {
var el = this.getEl();
@ -51,6 +58,7 @@ YAHOO.util.Anim.prototype = {
/**
* Returns the value computed by the animation's "method".
* @method doMethod
* @param {String} attr The name of the attribute.
* @param {Number} start The value this attribute should start from for this animation.
* @param {Number} end The value this attribute should end at for this animation.
@ -61,7 +69,8 @@ YAHOO.util.Anim.prototype = {
},
/**
* Applies a value to an attribute
* Applies a value to an attribute.
* @method setAttribute
* @param {String} attr The name of the attribute.
* @param {Number} val The value to be applied to the attribute.
* @param {String} unit The unit ('px', '%', etc.) of the value.
@ -76,6 +85,7 @@ YAHOO.util.Anim.prototype = {
/**
* Returns current value of the attribute.
* @method getAttribute
* @param {String} attr The name of the attribute.
* @return {Number} val The current value of the attribute.
*/
@ -103,7 +113,7 @@ YAHOO.util.Anim.prototype = {
/**
* Returns the unit to use when none is supplied.
* Applies the "defaultUnit" test to decide whether to use pixels or not
* @method getDefaultUnit
* @param {attr} attr The name of the attribute.
* @return {String} The default unit to be used.
*/
@ -117,6 +127,7 @@ YAHOO.util.Anim.prototype = {
/**
* Sets the actual values to be used during the animation.
* @method setRuntimeAttribute
* Should only be needed for subclass use.
* @param {Object} attr The attribute object
* @private
@ -160,7 +171,9 @@ YAHOO.util.Anim.prototype = {
},
/**
* @param {String or HTMLElement} el Reference to the element that will be animated
* Constructor for Anim instance.
* @method init
* @param {String | HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
* Each attribute is an object with at minimum a "to" or "by" member defined.
* Additional optional members are "from" (defaults to current value), "units" (defaults to "px").
@ -171,6 +184,7 @@ YAHOO.util.Anim.prototype = {
init: function(el, attributes, duration, method) {
/**
* Whether or not the animation is running.
* @property isAnimated
* @private
* @type Boolean
*/
@ -178,6 +192,7 @@ YAHOO.util.Anim.prototype = {
/**
* A Date object that is created when the animation begins.
* @property startTime
* @private
* @type Date
*/
@ -185,6 +200,7 @@ YAHOO.util.Anim.prototype = {
/**
* The number of frames this animation was able to execute.
* @property actualFrames
* @private
* @type Int
*/
@ -192,6 +208,7 @@ YAHOO.util.Anim.prototype = {
/**
* The element to be animated.
* @property el
* @private
* @type HTMLElement
*/
@ -203,14 +220,15 @@ YAHOO.util.Anim.prototype = {
* If "to" is supplied, the animation will end with the attribute at that value.
* If "by" is supplied, the animation will end at that value plus its starting value.
* If both are supplied, "to" is used, and "by" is ignored.
* @member YAHOO#util#Anim
* Optional additional member include "from" (the value the attribute should start animating from, defaults to current value), and "unit" (the units to apply to the values).
* @property attributes
* @type Object
*/
this.attributes = attributes || {};
/**
* The length of the animation. Defaults to "1" (second).
* @property duration
* @type Number
*/
this.duration = duration || 1;
@ -218,6 +236,7 @@ YAHOO.util.Anim.prototype = {
/**
* The method that will provide values to the attribute(s) during the animation.
* Defaults to "YAHOO.util.Easing.easeNone".
* @property method
* @type Function
*/
this.method = method || YAHOO.util.Easing.easeNone;
@ -225,6 +244,7 @@ YAHOO.util.Anim.prototype = {
/**
* Whether or not the duration should be treated as seconds.
* Defaults to true.
* @property useSeconds
* @type Boolean
*/
this.useSeconds = true; // default to seconds
@ -232,6 +252,7 @@ YAHOO.util.Anim.prototype = {
/**
* The location of the current animation on the timeline.
* In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.
* @property currentFrame
* @type Int
*/
this.currentFrame = 0;
@ -239,6 +260,7 @@ YAHOO.util.Anim.prototype = {
/**
* The total number of frames to be executed.
* In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.
* @property totalFrames
* @type Int
*/
this.totalFrames = YAHOO.util.AnimMgr.fps;
@ -246,12 +268,14 @@ YAHOO.util.Anim.prototype = {
/**
* Returns a reference to the animated element.
* @method getEl
* @return {HTMLElement}
*/
this.getEl = function() { return el; };
/**
* Checks whether the element is currently animated.
* @method isAnimated
* @return {Boolean} current value of isAnimated.
*/
this.isAnimated = function() {
@ -260,6 +284,7 @@ YAHOO.util.Anim.prototype = {
/**
* Returns the animation start time.
* @method getStartTime
* @return {Date} current value of startTime.
*/
this.getStartTime = function() {
@ -272,6 +297,7 @@ YAHOO.util.Anim.prototype = {
/**
* Starts the animation by registering it with the animation manager.
* @method animate
*/
this.animate = function() {
if ( this.isAnimated() ) { return false; }
@ -285,13 +311,21 @@ YAHOO.util.Anim.prototype = {
/**
* Stops the animation. Normally called by AnimMgr when animation completes.
* @method stop
* @param {Boolean} finish (optional) If true, animation will jump to final frame.
*/
this.stop = function() {
this.stop = function(finish) {
if (finish) {
this.currentFrame = this.totalFrames;
this._onTween.fire();
}
YAHOO.util.AnimMgr.stop(this);
};
var onStart = function() {
this.onStart.fire();
this.runtimeAttributes = {};
for (var attr in this.attributes) {
this.setRuntimeAttribute(attr);
}
@ -361,12 +395,14 @@ YAHOO.util.Anim.prototype = {
/**
* Custom event that fires when animation begins
* Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction)
* @event onStart
*/
this.onStart = new YAHOO.util.CustomEvent('start', this);
/**
* Custom event that fires between each frame
* Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction)
* @event onTween
*/
this.onTween = new YAHOO.util.CustomEvent('tween', this);
@ -379,6 +415,7 @@ YAHOO.util.Anim.prototype = {
/**
* Custom event that fires when animation ends
* Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction)
* @event onComplete
*/
this.onComplete = new YAHOO.util.CustomEvent('complete', this);
/**
@ -393,20 +430,16 @@ YAHOO.util.Anim.prototype = {
}
};
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.10.0
*/
/**
* @class Handles animation queueing and threading.
* Handles animation queueing and threading.
* Used by Anim and subclasses.
* @class AnimMgr
* @namespace YAHOO.util
*/
YAHOO.util.AnimMgr = new function() {
/**
* Reference to the animation Interval
* Reference to the animation Interval.
* @property thread
* @private
* @type Int
*/
@ -414,6 +447,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* The current queue of registered animation objects.
* @property queue
* @private
* @type Array
*/
@ -421,6 +455,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* The number of active animations.
* @property tweenCount
* @private
* @type Int
*/
@ -429,6 +464,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Base frame rate (frames per second).
* Arbitrarily high for better x-browser calibration (slower browsers drop more frames).
* @property fps
* @type Int
*
*/
@ -436,6 +472,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Interval delay in milliseconds, defaults to fastest possible.
* @property delay
* @type Int
*
*/
@ -444,6 +481,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Adds an animation instance to the animation queue.
* All animation instances must be registered in order to animate.
* @method registerElement
* @param {object} tween The Anim instance to be be registered
*/
this.registerElement = function(tween) {
@ -453,6 +491,14 @@ YAHOO.util.AnimMgr = new function() {
this.start();
};
/**
* removes an animation instance from the animation queue.
* All animation instances must be registered in order to animate.
* @method unRegister
* @param {object} tween The Anim instance to be be registered
* @param {Int} index The index of the Anim instance
* @private
*/
this.unRegister = function(tween, index) {
tween._onComplete.fire();
index = index || getIndex(tween);
@ -465,6 +511,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Starts the animation thread.
* Only one thread can run at a time.
* @method start
*/
this.start = function() {
if (thread === null) { thread = setInterval(this.run, this.delay); }
@ -472,6 +519,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Stops the animation thread or a specific animation instance.
* @method stop
* @param {object} tween A specific Anim instance to stop (optional)
* If no instance given, Manager stops thread and all animations.
*/
@ -494,6 +542,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* Called per Interval to handle each animation frame.
* @method run
*/
this.run = function() {
for (var i = 0, len = queue.length; i < len; ++i) {
@ -524,6 +573,7 @@ YAHOO.util.AnimMgr = new function() {
/**
* On the fly frame correction to keep animation on time.
* @method correctFrame
* @private
* @param {Object} tween The Anim instance being corrected.
*/
@ -548,16 +598,10 @@ YAHOO.util.AnimMgr = new function() {
}
};
};
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.10.0
*/
/**
*
* @class Used to calculate Bezier splines for any number of control points.
* Used to calculate Bezier splines for any number of control points.
* @class Bezier
* @namespace YAHOO.util
*
*/
YAHOO.util.Bezier = new function()
@ -568,6 +612,7 @@ YAHOO.util.Bezier = new function()
* At least 2 points are required (start and end).
* First point is start. Last point is end.
* Additional control points are optional.
* @method getPosition
* @param {Array} points An array containing Bezier points
* @param {Number} t A number between 0 and 1 which is the basis for determining current position
* @return {Array} An array containing int x and y member data
@ -593,9 +638,11 @@ YAHOO.util.Bezier = new function()
};
};
/**
* @class ColorAnim subclass for color fading
* <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code></p>
* <p>Color values can be specified with either 112233, #112233, [255,255,255], or rgb(255,255,255)
* Anim subclass for color transitions.
* <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code> Color values can be specified with either 112233, #112233,
* [255,255,255], or rgb(255,255,255)</p>
* @class ColorAnim
* @namespace YAHOO.util
* @requires YAHOO.util.Anim
* @requires YAHOO.util.AnimMgr
* @requires YAHOO.util.Easing
@ -603,13 +650,14 @@ YAHOO.util.Bezier = new function()
* @requires YAHOO.util.Dom
* @requires YAHOO.util.Event
* @constructor
* @extends YAHOO.util.Anim
* @param {HTMLElement | String} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
* Each attribute is an object with at minimum a "to" or "by" member defined.
* Additional optional members are "from" (defaults to current value), "units" (defaults to "px").
* All attribute names use camelCase.
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
* @param {Function} method (optional, defaults to Y.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a Y.Easing method)
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
*/
(function() {
YAHOO.util.ColorAnim = function(el, attributes, duration, method) {
@ -621,33 +669,27 @@ YAHOO.util.Bezier = new function()
// shorthand
var Y = YAHOO.util;
var superclass = Y.ColorAnim.superclass;
var prototype = Y.ColorAnim.prototype;
var proto = Y.ColorAnim.prototype;
/**
* toString method
* @return {String} string represenation of anim obj
*/
prototype.toString = function() {
proto.toString = function() {
var el = this.getEl();
var id = el.id || el.tagName;
return ("ColorAnim " + id);
};
/**
* Only certain attributes should be treated as colors.
* @type Object
*/
prototype.patterns.color = /color$/i;
prototype.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
prototype.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
prototype.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
proto.patterns.color = /color$/i;
proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/; // need rgba for safari
/**
* Attempts to parse the given string and return a 3-tuple.
* @method parseColor
* @param {String} s The string to parse.
* @return {Array} The 3-tuple of rgb values.
*/
prototype.parseColor = function(s) {
proto.parseColor = function(s) {
if (s.length == 3) { return s; }
var c = this.patterns.hex.exec(s);
@ -668,25 +710,20 @@ YAHOO.util.Bezier = new function()
return null;
};
/**
* Returns current value of the attribute.
* @param {String} attr The name of the attribute.
* @return {Number} val The current value of the attribute.
*/
prototype.getAttribute = function(attr) {
proto.getAttribute = function(attr) {
var el = this.getEl();
if ( this.patterns.color.test(attr) ) {
var val = YAHOO.util.Dom.getStyle(el, attr);
if (val == 'transparent') { // bgcolor default
if (this.patterns.transparent.test(val)) { // bgcolor default
var parent = el.parentNode; // try and get from an ancestor
val = Y.Dom.getStyle(parent, attr);
while (parent && val == 'transparent') {
while (parent && this.patterns.transparent.test(val)) {
parent = parent.parentNode;
val = Y.Dom.getStyle(parent, attr);
if (parent.tagName.toUpperCase() == 'HTML') {
val = 'ffffff';
val = '#fff';
}
}
}
@ -697,14 +734,7 @@ YAHOO.util.Bezier = new function()
return val;
};
/**
* Returns the value computed by the animation's "method".
* @param {String} attr The name of the attribute.
* @param {Number} start The value this attribute should start from for this animation.
* @param {Number} end The value this attribute should end at for this animation.
* @return {Number} The Value to be applied to the attribute.
*/
prototype.doMethod = function(attr, start, end) {
proto.doMethod = function(attr, start, end) {
var val;
if ( this.patterns.color.test(attr) ) {
@ -722,13 +752,7 @@ YAHOO.util.Bezier = new function()
return val;
};
/**
* Sets the actual values to be used during the animation.
* Should only be needed for subclass use.
* @param {Object} attr The attribute object
* @private
*/
prototype.setRuntimeAttribute = function(attr) {
proto.setRuntimeAttribute = function(attr) {
superclass.setRuntimeAttribute.call(this, attr);
if ( this.patterns.color.test(attr) ) {
@ -751,7 +775,7 @@ YAHOO.util.Bezier = new function()
})();/*
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright © 2001 Robert Penner All rights reserved.
Copyright 2001 Robert Penner All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@ -760,18 +784,24 @@ Redistribution and use in source and binary forms, with or without modification,
* Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Singleton that determines how an animation proceeds from start to end.
* @class Easing
* @namespace YAHOO.util
*/
YAHOO.util.Easing = {
/**
* Uniform speed between points.
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeNone
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeNone: function (t, b, c, d) {
return c*t/d + b;
@ -779,11 +809,12 @@ YAHOO.util.Easing = {
/**
* Begins slowly and accelerates towards end. (quadratic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeIn
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeIn: function (t, b, c, d) {
return c*(t/=d)*t + b;
@ -791,11 +822,12 @@ YAHOO.util.Easing = {
/**
* Begins quickly and decelerates towards end. (quadratic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeOut
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeOut: function (t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
@ -803,11 +835,12 @@ YAHOO.util.Easing = {
/**
* Begins slowly and decelerates towards end. (quadratic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeBoth
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeBoth: function (t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
@ -816,11 +849,12 @@ YAHOO.util.Easing = {
/**
* Begins slowly and accelerates towards end. (quartic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeInStrong
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeInStrong: function (t, b, c, d) {
return c*(t/=d)*t*t*t + b;
@ -828,11 +862,12 @@ YAHOO.util.Easing = {
/**
* Begins quickly and decelerates towards end. (quartic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeOutStrong
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeOutStrong: function (t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
@ -840,11 +875,12 @@ YAHOO.util.Easing = {
/**
* Begins slowly and decelerates towards end. (quartic)
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* @method easeBothStrong
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
easeBothStrong: function (t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
@ -852,13 +888,14 @@ YAHOO.util.Easing = {
},
/**
* snap in elastic effect
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* Snap in elastic effect.
* @method elasticIn
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} p Period (optional)
* @return {Number} The computed value for the current animation frame.
* @return {Number} The computed value for the current animation frame
*/
elasticIn: function (t, b, c, d, a, p) {
@ -869,13 +906,14 @@ YAHOO.util.Easing = {
},
/**
* snap out elastic effect
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* Snap out elastic effect.
* @method elasticOut
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} p Period (optional)
* @return {Number} The computed value for the current animation frame.
* @return {Number} The computed value for the current animation frame
*/
elasticOut: function (t, b, c, d, a, p) {
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
@ -885,13 +923,14 @@ YAHOO.util.Easing = {
},
/**
* snap both elastic effect
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* Snap both elastic effect.
* @method elasticBoth
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} p Period (optional)
* @return {Number} The computed value for the current animation frame.
* @return {Number} The computed value for the current animation frame
*/
elasticBoth: function (t, b, c, d, a, p) {
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
@ -902,13 +941,14 @@ YAHOO.util.Easing = {
},
/**
* back easing in - backtracking slightly, then reversing direction and moving to target
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @param {Number) s Overshoot (optional)
* @return {Number} The computed value for the current animation frame.
* Backtracks slightly, then reverses direction and moves to end.
* @method backIn
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} s Overshoot (optional)
* @return {Number} The computed value for the current animation frame
*/
backIn: function (t, b, c, d, s) {
if (typeof s == 'undefined') s = 1.70158;
@ -916,14 +956,14 @@ YAHOO.util.Easing = {
},
/**
* back easing out - moving towards target, overshooting it slightly,
* then reversing and coming back to target
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @param {Number) s Overshoot (optional)
* @return {Number} The computed value for the current animation frame.
* Overshoots end, then reverses and comes back to end.
* @method backOut
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} s Overshoot (optional)
* @return {Number} The computed value for the current animation frame
*/
backOut: function (t, b, c, d, s) {
if (typeof s == 'undefined') s = 1.70158;
@ -931,14 +971,15 @@ YAHOO.util.Easing = {
},
/**
* back easing in/out - backtracking slightly, then reversing direction and moving to target,
* then overshooting target, reversing, and finally coming back to target
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @param {Number) s Overshoot (optional)
* @return {Number} The computed value for the current animation frame.
* Backtracks slightly, then reverses direction, overshoots end,
* then reverses and comes back to end.
* @method backBoth
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @param {Number} s Overshoot (optional)
* @return {Number} The computed value for the current animation frame
*/
backBoth: function (t, b, c, d, s) {
if (typeof s == 'undefined') s = 1.70158;
@ -947,24 +988,26 @@ YAHOO.util.Easing = {
},
/**
* bounce in
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* Bounce off of start.
* @method bounceIn
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
bounceIn: function (t, b, c, d) {
return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b;
},
/**
* bounce out
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* Bounces off end.
* @method bounceOut
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
bounceOut: function (t, b, c, d) {
if ((t/=d) < (1/2.75)) {
@ -979,12 +1022,13 @@ YAHOO.util.Easing = {
},
/**
* bounce both
* @param {Number} t Time value used to compute current value.
* @param {Number} b Starting value.
* @param {Number} c Delta between start and end values.
* @param {Number} d Total length of animation.
* @return {Number} The computed value for the current animation frame.
* Bounces off start and end.
* @method bounceBoth
* @param {Number} t Time value used to compute current value
* @param {Number} b Starting value
* @param {Number} c Delta between start and end values
* @param {Number} d Total length of animation
* @return {Number} The computed value for the current animation frame
*/
bounceBoth: function (t, b, c, d) {
if (t < d/2) return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b;
@ -992,16 +1036,12 @@ YAHOO.util.Easing = {
}
};
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.10.0
*/
/**
* @class Anim subclass for moving elements along a path defined by the "points" member of "attributes". All "points" are arrays with x, y coordinates.
* Anim subclass for moving elements along a path defined by the "points"
* member of "attributes". All "points" are arrays with x, y coordinates.
* <p>Usage: <code>var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>
* @class Motion
* @namespace YAHOO.util
* @requires YAHOO.util.Anim
* @requires YAHOO.util.AnimMgr
* @requires YAHOO.util.Easing
@ -1010,7 +1050,8 @@ Version: 0.10.0
* @requires YAHOO.util.Event
* @requires YAHOO.util.CustomEvent
* @constructor
* @param {String or HTMLElement} el Reference to the element that will be animated
* @extends YAHOO.util.Anim
* @param {String | HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
* Each attribute is an object with at minimum a "to" or "by" member defined.
* Additional optional members are "from" (defaults to current value), "units" (defaults to "px").
@ -1030,27 +1071,17 @@ Version: 0.10.0
// shorthand
var Y = YAHOO.util;
var superclass = Y.Motion.superclass;
var prototype = Y.Motion.prototype;
var proto = Y.Motion.prototype;
/**
* toString method
* @return {String} string represenation of anim obj
*/
prototype.toString = function() {
proto.toString = function() {
var el = this.getEl();
var id = el.id || el.tagName;
return ("Motion " + id);
};
prototype.patterns.points = /^points$/i;
proto.patterns.points = /^points$/i;
/**
* Applies a value to an attribute
* @param {String} attr The name of the attribute.
* @param {Number} val The value to be applied to the attribute.
* @param {String} unit The unit ('px', '%', etc.) of the value.
*/
prototype.setAttribute = function(attr, val, unit) {
proto.setAttribute = function(attr, val, unit) {
if ( this.patterns.points.test(attr) ) {
unit = unit || 'px';
superclass.setAttribute.call(this, 'left', val[0], unit);
@ -1060,12 +1091,7 @@ Version: 0.10.0
}
};
/**
* Sets the default value to be used when "from" is not supplied.
* @param {String} attr The attribute being set.
* @param {Number} val The default value to be applied to the attribute.
*/
prototype.getAttribute = function(attr) {
proto.getAttribute = function(attr) {
if ( this.patterns.points.test(attr) ) {
var val = [
superclass.getAttribute.call(this, 'left'),
@ -1078,14 +1104,7 @@ Version: 0.10.0
return val;
};
/**
* Returns the value computed by the animation's "method".
* @param {String} attr The name of the attribute.
* @param {Number} start The value this attribute should start from for this animation.
* @param {Number} end The value this attribute should end at for this animation.
* @return {Number} The Value to be applied to the attribute.
*/
prototype.doMethod = function(attr, start, end) {
proto.doMethod = function(attr, start, end) {
var val = null;
if ( this.patterns.points.test(attr) ) {
@ -1097,13 +1116,7 @@ Version: 0.10.0
return val;
};
/**
* Sets the actual values to be used during the animation.
* Should only be needed for subclass use.
* @param {Object} attr The attribute object
* @private
*/
prototype.setRuntimeAttribute = function(attr) {
proto.setRuntimeAttribute = function(attr) {
if ( this.patterns.points.test(attr) ) {
var el = this.getEl();
var attributes = this.attributes;
@ -1175,16 +1188,12 @@ Version: 0.10.0
return (typeof prop !== 'undefined');
};
})();
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version: 0.10.0
*/
/**
* @class Anim subclass for scrolling elements to a position defined by the "scroll" member of "attributes". All "scroll" members are arrays with x, y scroll positions.
* Anim subclass for scrolling elements to a position defined by the "scroll"
* member of "attributes". All "scroll" members are arrays with x, y scroll positions.
* <p>Usage: <code>var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>
* @class Scroll
* @namespace YAHOO.util
* @requires YAHOO.util.Anim
* @requires YAHOO.util.AnimMgr
* @requires YAHOO.util.Easing
@ -1192,6 +1201,7 @@ Version: 0.10.0
* @requires YAHOO.util.Dom
* @requires YAHOO.util.Event
* @requires YAHOO.util.CustomEvent
* @extends YAHOO.util.Anim
* @constructor
* @param {String or HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
@ -1213,26 +1223,15 @@ Version: 0.10.0
// shorthand
var Y = YAHOO.util;
var superclass = Y.Scroll.superclass;
var prototype = Y.Scroll.prototype;
var proto = Y.Scroll.prototype;
/**
* toString method
* @return {String} string represenation of anim obj
*/
prototype.toString = function() {
proto.toString = function() {
var el = this.getEl();
var id = el.id || el.tagName;
return ("Scroll " + id);
};
/**
* Returns the value computed by the animation's "method".
* @param {String} attr The name of the attribute.
* @param {Number} start The value this attribute should start from for this animation.
* @param {Number} end The value this attribute should end at for this animation.
* @return {Number} The Value to be applied to the attribute.
*/
prototype.doMethod = function(attr, start, end) {
proto.doMethod = function(attr, start, end) {
var val = null;
if (attr == 'scroll') {
@ -1247,12 +1246,7 @@ Version: 0.10.0
return val;
};
/**
* Returns current value of the attribute.
* @param {String} attr The name of the attribute.
* @return {Number} val The current value of the attribute.
*/
prototype.getAttribute = function(attr) {
proto.getAttribute = function(attr) {
var val = null;
var el = this.getEl();
@ -1265,13 +1259,7 @@ Version: 0.10.0
return val;
};
/**
* Applies a value to an attribute
* @param {String} attr The name of the attribute.
* @param {Number} val The value to be applied to the attribute.
* @param {String} unit The unit ('px', '%', etc.) of the value.
*/
prototype.setAttribute = function(attr, val, unit) {
proto.setAttribute = function(attr, val, unit) {
var el = this.getEl();
if (attr == 'scroll') {

View file

@ -1,5 +1,34 @@
AutoComplete Release Notes
*** version 0.12.0 ***
* The following constants must be defined as static class properties and are no longer
available as instance properties:
YAHOO.widget.DataSource.ERROR_DATANULL
YAHOO.widget.DataSource.ERROR_DATAPARSE
YAHOO.widget.DS_XHR.TYPE_JSON
YAHOO.widget.DS_XHR.TYPE_XML
YAHOO.widget.DS_XHR.TYPE_FLAT
YAHOO.widget.DS_XHR.ERROR_DATAXHR
* The property minQueryLength now supports zero and negative number values for
DS_JSFunction and DS_XHR objects, to enable null or empty string queries and to disable
AutoComplete functionality altogether, respectively.
* Enabling the alwaysShowContainer feature will no longer send containerExpandEvent or
containerCollapseEvent.
**** version 0.11.3 ***
* The iFrameSrc property has been deprecated. Implementers no longer need to
specify an https URL to avoid IE security warnings when working with sites over
SSL.
*** version 0.11.0 ***
* The method getListIds() has been deprecated for getListItems(), which returns

File diff suppressed because it is too large Load diff

View file

@ -1,31 +1,23 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.txt
version: 0.11.0
*/
YAHOO.widget.AutoComplete=function(inputEl,containerEl,oDataSource,oConfigs){if(inputEl&&containerEl&&oDataSource){if(oDataSource&&(oDataSource instanceof YAHOO.widget.DataSource)){this.dataSource=oDataSource;}
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
YAHOO.widget.AutoComplete=function(elInput,elContainer,oDataSource,oConfigs){if(elInput&&elContainer&&oDataSource){if(oDataSource&&(oDataSource instanceof YAHOO.widget.DataSource)){this.dataSource=oDataSource;}
else{return;}
if(YAHOO.util.Dom.inDocument(inputEl)){if(typeof inputEl=="string"){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+inputEl;this._oTextbox=document.getElementById(inputEl);}
else{this._sName=(inputEl.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+inputEl.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=inputEl;}}
if(YAHOO.util.Dom.inDocument(elInput)){if(typeof elInput=="string"){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput;this._oTextbox=document.getElementById(elInput);}
else{this._sName=(elInput.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=elInput;}}
else{return;}
if(YAHOO.util.Dom.inDocument(containerEl)){if(typeof containerEl=="string"){this._oContainer=document.getElementById(containerEl);}
else{this._oContainer=containerEl;}
if(YAHOO.util.Dom.inDocument(elContainer)){if(typeof elContainer=="string"){this._oContainer=document.getElementById(elContainer);}
else{this._oContainer=elContainer;}
if(this._oContainer.style.display=="none"){}}
else{return;}
if(typeof oConfigs=="object"){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var oSelf=this;var oTextbox=this._oTextbox;var oContent=this._oContainer._oContent;YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);if(oTextbox.form){YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);}
this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);oTextbox.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}
else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.5;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.iFrameSrc="about:blank";YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.getName=function(){return this._sName;};YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(oListItem){if(oListItem._oResultData){return oListItem._oResultData;}
this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var oSelf=this;var oTextbox=this._oTextbox;var oContent=this._oContainer._oContent;YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);if(oTextbox.form){YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);}
YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);oTextbox.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}
else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.5;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(oListItem){if(oListItem._oResultData){return oListItem._oResultData;}
else{return false;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(sHeader){if(sHeader){if(this._oContainer._oContent._oHeader){this._oContainer._oContent._oHeader.innerHTML=sHeader;this._oContainer._oContent._oHeader.style.display="block";}}
else{this._oContainer._oContent._oHeader.innerHTML="";this._oContainer._oContent._oHeader.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setFooter=function(sFooter){if(sFooter){if(this._oContainer._oContent._oFooter){this._oContainer._oContent._oFooter.innerHTML=sFooter;this._oContainer._oContent._oFooter.style.display="block";}}
else{this._oContainer._oContent._oFooter.innerHTML="";this._oContainer._oContent._oFooter.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setBody=function(sBody){if(sBody){if(this._oContainer._oContent._oBody){this._oContainer._oContent._oBody.innerHTML=sBody;this._oContainer._oContent._oBody.style.display="block";this._oContainer._oContent.style.display="block";}}
else{this._oContainer._oContent._oBody.innerHTML="";this._oContainer._oContent.style.display="none";}
this._maxResultsDisplayed=0;};YAHOO.widget.AutoComplete.prototype.formatResult=function(oResultItem,sQuery){var sResult=oResultItem[0];if(sResult){return sResult;}
else{return"";}};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){if(sQuery){this._sendQuery(sQuery);}
else{return;}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._oTextbox=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._oContainer=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._initProps=function(){var minQueryLength=this.minQueryLength;if(isNaN(minQueryLength)||(minQueryLength<1)){minQueryLength=1;}
else{return"";}};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(oResultItem,sQuery){return true;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){this._sendQuery(sQuery);};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._oTextbox=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._oContainer=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var minQueryLength=this.minQueryLength;if(isNaN(minQueryLength)||(minQueryLength<1)){minQueryLength=1;}
var maxResultsDisplayed=this.maxResultsDisplayed;if(isNaN(this.maxResultsDisplayed)||(this.maxResultsDisplayed<1)){this.maxResultsDisplayed=10;}
var queryDelay=this.queryDelay;if(isNaN(this.queryDelay)||(this.queryDelay<0)){this.queryDelay=0.5;}
var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){if(typeof aDelimChar=="string"){this.delimChar=[aDelimChar];}
@ -33,51 +25,29 @@ else if(aDelimChar.constructor!=Array){this.delimChar=null;}}
var animSpeed=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(isNaN(animSpeed)||(animSpeed<0)){animSpeed=0.3;}
if(!this._oAnim){oAnim=new YAHOO.util.Anim(this._oContainer._oContent,{},this.animSpeed);this._oAnim=oAnim;}
else{this._oAnim.duration=animSpeed;}}
if(this.forceSelection&&this.delimChar){}
if(this.alwaysShowContainer&&(this.useShadow||this.useIFrame)){}
if(this.alwaysShowContainer){this._bContainerOpen=true;}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._oContainer._oShadow){var oShadow=document.createElement("div");oShadow.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(oShadow);}
if(this.useIFrame&&!this._oContainer._oIFrame){var oIFrame=document.createElement("iframe");oIFrame.src=this.iFrameSrc;oIFrame.frameBorder=0;oIFrame.scrolling="no";oIFrame.style.position="absolute";oIFrame.style.width="100%";oIFrame.style.height="100%";this._oContainer._oIFrame=this._oContainer.appendChild(oIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){if(!this._oContainer._oContent){var oContent=document.createElement("div");oContent.className="yui-ac-content";oContent.style.display="none";this._oContainer._oContent=this._oContainer.appendChild(oContent);var oHeader=document.createElement("div");oHeader.className="yui-ac-hd";oHeader.style.display="none";this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(oHeader);var oBody=document.createElement("div");oBody.className="yui-ac-bd";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(oBody);var oFooter=document.createElement("div");oFooter.className="yui-ac-ft";oFooter.style.display="none";this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(oFooter);}
if(this.forceSelection&&this.delimChar){}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._oContainer._oShadow){var oShadow=document.createElement("div");oShadow.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(oShadow);}
if(this.useIFrame&&!this._oContainer._oIFrame){var oIFrame=document.createElement("iframe");oIFrame.src=this._iFrameSrc;oIFrame.frameBorder=0;oIFrame.scrolling="no";oIFrame.style.position="absolute";oIFrame.style.width="100%";oIFrame.style.height="100%";oIFrame.tabIndex=-1;this._oContainer._oIFrame=this._oContainer.appendChild(oIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){if(!this._oContainer._oContent){var oContent=document.createElement("div");oContent.className="yui-ac-content";oContent.style.display="none";this._oContainer._oContent=this._oContainer.appendChild(oContent);var oHeader=document.createElement("div");oHeader.className="yui-ac-hd";oHeader.style.display="none";this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(oHeader);var oBody=document.createElement("div");oBody.className="yui-ac-bd";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(oBody);var oFooter=document.createElement("div");oFooter.className="yui-ac-ft";oFooter.style.display="none";this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(oFooter);}
else{}};YAHOO.widget.AutoComplete.prototype._initList=function(){this._aListItems=[];while(this._oContainer._oContent._oBody.hasChildNodes()){var oldListItems=this.getListItems();if(oldListItems){for(var oldi=oldListItems.length-1;oldi>=0;i--){oldListItems[oldi]=null;}}
this._oContainer._oContent._oBody.innerHTML="";}
var oList=document.createElement("ul");oList=this._oContainer._oContent._oBody.appendChild(oList);for(var i=0;i<this.maxResultsDisplayed;i++){var oItem=document.createElement("li");oItem=oList.appendChild(oItem);this._aListItems[i]=oItem;this._initListItem(oItem,i);}
this._maxResultsDisplayed=this.maxResultsDisplayed;};YAHOO.widget.AutoComplete.prototype._initListItem=function(oItem,nItemIndex){var oSelf=this;oItem.style.display="none";oItem._nItemIndex=nItemIndex;oItem.mouseover=oItem.mouseout=oItem.onclick=null;YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseover");}
else{oSelf._toggleHighlight(this,"to");}
oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}
else{oSelf._toggleHighlight(this,"from");}
oSelf.itemMouseOutEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(v,oSelf){oSelf._toggleHighlight(this,"to");oSelf._selectItem(this);};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(v,oSelf){oSelf._bOverContainer=true;};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(v,oSelf){oSelf._bOverContainer=false;if(oSelf._oCurItem){oSelf._toggleHighlight(oSelf._oCurItem,"to");}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(v,oSelf){oSelf._oTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(v,oSelf){oSelf._toggleContainerHelpers(oSelf._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
else{oSelf._clearList();}
break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
else{oSelf._clearList();}
break;case 27:oSelf._clearList();return;case 39:oSelf._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;case 40:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:case 13:if((oSelf._nKeyCode!=nKeyCode)){YAHOO.util.Event.stopEvent(v);}
break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){oSelf._initProps();var nKeyCode=v.keyCode;oSelf._nKeyCode=nKeyCode;var sChar=String.fromCharCode(nKeyCode);var sText=this.value;if(oSelf._isIgnoreKey(nKeyCode)||(sText.toLowerCase()==oSelf._sCurQuery)){return;}
else{oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}
if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}
oSelf._nDelayID=nDelayID;}
else{oSelf._sendQuery(sText);}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(nKeyCode){if((nKeyCode==9)||(nKeyCode==13)||(nKeyCode==16)||(nKeyCode==17)||(nKeyCode>=18&&nKeyCode<=20)||(nKeyCode==27)||(nKeyCode>=33&&nKeyCode<=35)||(nKeyCode>=36&&nKeyCode<=38)||(nKeyCode==40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}
return false;};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;oSelf.textboxFocusEvent.fire(oSelf);};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&!oSelf._textMatchesOption())){if(oSelf.forceSelection){oSelf._clearSelection();}
else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}}
if(oSelf._bContainerOpen){oSelf._clearList();}
oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,oSelf){if(oSelf.allowBrowserAutocomplete){oSelf._oTextbox.setAttribute("autocomplete","on");}
else{oSelf._oTextbox.setAttribute("autocomplete","off");}};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){var nDelimIndex=-1;for(var i=aDelimChar.length-1;i>=0;i--){var nNewIndex=sQuery.lastIndexOf(aDelimChar[i]);if(nNewIndex>nDelimIndex){nDelimIndex=nNewIndex;}}
this._maxResultsDisplayed=this.maxResultsDisplayed;};YAHOO.widget.AutoComplete.prototype._initListItem=function(oItem,nItemIndex){var oSelf=this;oItem.style.display="none";oItem._nItemIndex=nItemIndex;oItem.mouseover=oItem.mouseout=oItem.onclick=null;YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);};YAHOO.widget.AutoComplete.prototype._onIMEDetected=function(oSelf){oSelf._enableIntervalDetection();};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var currValue=this._oTextbox.value;var lastValue=this._sLastTextboxValue;if(currValue!=lastValue){this._sLastTextboxValue=currValue;this._sendQuery(currValue);}};YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection=function(oSelf){if(oSelf._queryInterval){clearInterval(oSelf._queryInterval);}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(nKeyCode){if((nKeyCode==9)||(nKeyCode==13)||(nKeyCode==16)||(nKeyCode==17)||(nKeyCode>=18&&nKeyCode<=20)||(nKeyCode==27)||(nKeyCode>=33&&nKeyCode<=35)||(nKeyCode>=36&&nKeyCode<=38)||(nKeyCode==40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}
return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){if(this.minQueryLength==-1){this._toggleContainer(false);return;}
var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){var nDelimIndex=-1;for(var i=aDelimChar.length-1;i>=0;i--){var nNewIndex=sQuery.lastIndexOf(aDelimChar[i]);if(nNewIndex>nDelimIndex){nDelimIndex=nNewIndex;}}
if(aDelimChar[i]==" "){for(var j=aDelimChar.length-1;j>=0;j--){if(sQuery[nDelimIndex-1]==aDelimChar[j]){nDelimIndex--;break;}}}
if(nDelimIndex>-1){var nQueryStart=nDelimIndex+1;while(sQuery.charAt(nQueryStart)==" "){nQueryStart+=1;}
this._sSavedQuery=sQuery.substring(0,nQueryStart);sQuery=sQuery.substr(nQueryStart);}
else if(sQuery.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null;}}
if(sQuery.length<this.minQueryLength){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}
this._clearList();return;}
sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;this.dataRequestEvent.fire(this,sQuery);this.dataSource.getResults(this._populateList,sQuery,this);};YAHOO.widget.AutoComplete.prototype._clearList=function(){this._oContainer._oContent.scrollTop=0;var aItems=this._aListItems;if(aItems&&(aItems.length>0)){for(var i=aItems.length-1;i>=0;i--){aItems[i].style.display="none";}}
if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}
this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,aResults,oSelf){if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,sQuery);}
if(sQuery&&(sQuery.length<this.minQueryLength)||(!sQuery&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}
this._toggleContainer(false);return;}
sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;this.dataRequestEvent.fire(this,sQuery);this.dataSource.getResults(this._populateList,sQuery,this);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,aResults,oSelf){if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,sQuery);}
if(!oSelf._bFocused||!aResults){return;}
var isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);var contentStyle=oSelf._oContainer._oContent.style;contentStyle.width=(!isOpera)?null:"";contentStyle.height=(!isOpera)?null:"";var sCurQuery=decodeURIComponent(sQuery);oSelf._sCurQuery=sCurQuery;oSelf._bItemSelected=false;if(oSelf._maxResultsDisplayed!=oSelf.maxResultsDisplayed){oSelf._initList();}
var nItems=Math.min(aResults.length,oSelf.maxResultsDisplayed);oSelf._nDisplayedItems=nItems;if(nItems>0){oSelf._initContainerHelpers();var aItems=oSelf._aListItems;for(var i=nItems-1;i>=0;i--){var oItemi=aItems[i];var oResultItemi=aResults[i];oItemi.innerHTML=oSelf.formatResult(oResultItemi,sCurQuery);oItemi.style.display="list-item";oItemi._sResultKey=oResultItemi[0];oItemi._oResultData=oResultItemi;}
for(var j=aItems.length-1;j>=nItems;j--){var oItemj=aItems[j];oItemj.innerHTML=null;oItemj.style.display="none";oItemj._sResultKey=null;oItemj._oResultData=null;}
if(oSelf.autoHighlight){var oFirstItem=aItems[0];oSelf._toggleHighlight(oFirstItem,"to");oSelf.itemArrowToEvent.fire(oSelf,oFirstItem);oSelf._typeAhead(oFirstItem,sQuery);}
else{oSelf._oCurItem=null;}
oSelf._toggleContainer(true);}
else{oSelf._clearList();}
var ok=oSelf.doBeforeExpandContainer(oSelf._oTextbox,oSelf._oContainer,sQuery,aResults);oSelf._toggleContainer(ok);}
else{oSelf._toggleContainer(false);}
oSelf.dataReturnEvent.fire(oSelf,sQuery,aResults);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var sValue=this._oTextbox.value;var sChar=(this.delimChar)?this.delimChar[0]:null;var nIndex=(sChar)?sValue.lastIndexOf(sChar,sValue.length-2):-1;if(nIndex>-1){this._oTextbox.value=sValue.substring(0,nIndex);}
else{this._oTextbox.value="";}
this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var foundMatch=false;for(var i=this._nDisplayedItems-1;i>=0;i--){var oItem=this._aListItems[i];var sMatch=oItem._sResultKey.toLowerCase();if(sMatch==this._sCurQuery.toLowerCase()){foundMatch=true;break;}}
@ -85,13 +55,14 @@ return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oIt
var oTextbox=this._oTextbox;var sValue=this._oTextbox.value;if(!oTextbox.setSelectionRange&&!oTextbox.createTextRange){return;}
var nStart=sValue.length;this._updateValue(oItem);var nEnd=oTextbox.value.length;this._selectText(oTextbox,nStart,nEnd);var sPrefill=oTextbox.value.substr(nStart,nEnd);this.typeAheadEvent.fire(this,sQuery,sPrefill);};YAHOO.widget.AutoComplete.prototype._selectText=function(oTextbox,nStart,nEnd){if(oTextbox.setSelectionRange){oTextbox.setSelectionRange(nStart,nEnd);}
else if(oTextbox.createTextRange){var oTextRange=oTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-oTextbox.value.length);oTextRange.select();}
else{oTextbox.select();}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(bShow){var bFireEvent=false;var width=this._oContainer._oContent.offsetWidth+"px";var height=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame){bFireEvent=true;if(this.alwaysShowContainer||bShow){this._oContainer._oIFrame.style.width=width;this._oContainer._oIFrame.style.height=height;}
else{oTextbox.select();}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(bShow){var bFireEvent=false;var width=this._oContainer._oContent.offsetWidth+"px";var height=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame){bFireEvent=true;if(bShow){this._oContainer._oIFrame.style.width=width;this._oContainer._oIFrame.style.height=height;}
else{this._oContainer._oIFrame.style.width=0;this._oContainer._oIFrame.style.height=0;}}
if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(this.alwaysShowContainer||bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}
else{this._oContainer._oShadow.style.width=0;this._oContainer._oShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){if(this.alwaysShowContainer){if(bShow){this.containerExpandEvent.fire(this);}
else{this.containerCollapseEvent.fire(this);}
this._bContainerOpen=bShow;return;}
var oContainer=this._oContainer;if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}
if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}
else{this._oContainer._oShadow.style.width=0;this._oContainer._oShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){var oContainer=this._oContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return;}
if(!bShow){this._oContainer._oContent.scrollTop=0;var aItems=this._aListItems;if(aItems&&(aItems.length>0)){for(var i=aItems.length-1;i>=0;i--){aItems[i].style.display="none";}}
if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}
this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;}
if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}
var oAnim=this._oAnim;if(oAnim&&oAnim.getEl()&&(this.animHoriz||this.animVert)){if(!bShow){this._toggleContainerHelpers(bShow);}
if(oAnim.isAnimated()){oAnim.stop();}
var oClone=oContainer._oContent.cloneNode(true);oContainer.appendChild(oClone);oClone.style.top="-9000px";oClone.style.display="block";var wExp=oClone.offsetWidth;var hExp=oClone.offsetHeight;var wColl=(this.animHoriz)?0:wExp;var hColl=(this.animVert)?0:hExp;oAnim.attributes=(bShow)?{width:{to:wExp},height:{to:hExp}}:{width:{to:wColl},height:{to:hColl}};if(bShow&&!this._bContainerOpen){oContainer._oContent.style.width=wColl+"px";oContainer._oContent.style.height=hColl+"px";}
@ -104,31 +75,52 @@ else{oContainer._oContent.style.display="none";this.containerCollapseEvent.fire(
this._toggleContainerHelpers(bShow);this._bContainerOpen=bShow;}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(oNewItem,sType){var sHighlight=this.highlightClassName;if(this._oCurItem){YAHOO.util.Dom.removeClass(this._oCurItem,sHighlight);}
if((sType=="to")&&sHighlight){YAHOO.util.Dom.addClass(oNewItem,sHighlight);this._oCurItem=oNewItem;}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(oNewItem,sType){if(oNewItem==this._oCurItem){return;}
var sPrehighlight=this.prehighlightClassName;if((sType=="mouseover")&&sPrehighlight){YAHOO.util.Dom.addClass(oNewItem,sPrehighlight);}
else{YAHOO.util.Dom.removeClass(oNewItem,sPrehighlight);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(oItem){var oTextbox=this._oTextbox;var sDelimChar=(this.delimChar)?this.delimChar[0]:null;var sSavedQuery=this._sSavedQuery;var sResultKey=oItem._sResultKey;oTextbox.focus();oTextbox.value="";if(sDelimChar){if(sSavedQuery){oTextbox.value=sSavedQuery;}
else{YAHOO.util.Dom.removeClass(oNewItem,sPrehighlight);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(oItem){var oTextbox=this._oTextbox;var sDelimChar=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var sSavedQuery=this._sSavedQuery;var sResultKey=oItem._sResultKey;oTextbox.focus();oTextbox.value="";if(sDelimChar){if(sSavedQuery){oTextbox.value=sSavedQuery;}
oTextbox.value+=sResultKey+sDelimChar;if(sDelimChar!=" "){oTextbox.value+=" ";}}
else{oTextbox.value=sResultKey;}
if(oTextbox.type=="textarea"){oTextbox.scrollTop=oTextbox.scrollHeight;}
var end=oTextbox.value.length;this._selectText(oTextbox,end,end);this._oCurItem=oItem;};YAHOO.widget.AutoComplete.prototype._selectItem=function(oItem){this._bItemSelected=true;this._updateValue(oItem);this.itemSelectEvent.fire(this,oItem,oItem._oResultData);this._clearList();};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(!this.typeAhead){return;}
else{this._clearList();}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(nKeyCode){if(this._bContainerOpen){var oCurItem=this._oCurItem;var nCurItemIndex=-1;if(oCurItem){nCurItemIndex=oCurItem._nItemIndex;}
var end=oTextbox.value.length;this._selectText(oTextbox,end,end);this._oCurItem=oItem;};YAHOO.widget.AutoComplete.prototype._selectItem=function(oItem){this._bItemSelected=true;this._updateValue(oItem);this._cancelIntervalDetection(this);this.itemSelectEvent.fire(this,oItem,oItem._oResultData);this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(!this.typeAhead){return;}
else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(nKeyCode){if(this._bContainerOpen){var oCurItem=this._oCurItem;var nCurItemIndex=-1;if(oCurItem){nCurItemIndex=oCurItem._nItemIndex;}
var nNewItemIndex=(nKeyCode==40)?(nCurItemIndex+1):(nCurItemIndex-1);if(nNewItemIndex<-2||nNewItemIndex>=this._nDisplayedItems){return;}
if(oCurItem){this._toggleHighlight(oCurItem,"from");this.itemArrowFromEvent.fire(this,oCurItem);}
if(nNewItemIndex==-1){if(this.delimChar&&this._sSavedQuery){if(!this._textMatchesOption()){this._oTextbox.value=this._sSavedQuery;}
else{this._oTextbox.value=this._sSavedQuery+this._sCurQuery;}}
else{this._oTextbox.value=this._sCurQuery;}
this._oCurItem=null;return;}
if(nNewItemIndex==-2){this._clearList();return;}
var oNewItem=this._aListItems[nNewItemIndex];if((YAHOO.util.Dom.getStyle(this._oContainer._oContent,"overflow")=="auto")&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((oNewItem.offsetTop+oNewItem.offsetHeight)>(this._oContainer._oContent.scrollTop+this._oContainer._oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-this._oContainer._oContent.offsetHeight;}
else if((oNewItem.offsetTop+oNewItem.offsetHeight)<this._oContainer._oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}}
else{if(oNewItem.offsetTop<this._oContainer._oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}
else if(oNewItem.offsetTop>(this._oContainer._oContent.scrollTop+this._oContainer._oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-this._oContainer._oContent.offsetHeight;}}}
this._toggleHighlight(oNewItem,"to");this.itemArrowToEvent.fire(this,oNewItem);if(this.typeAhead){this._updateValue(oNewItem);}}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.prototype.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.prototype.ERROR_DATAPARSE="Response data could not be parsed";YAHOO.widget.DataSource.prototype.maxCacheEntries=15;YAHOO.widget.DataSource.prototype.queryMatchContains=false;YAHOO.widget.DataSource.prototype.queryMatchSubset=false;YAHOO.widget.DataSource.prototype.queryMatchCase=false;YAHOO.widget.DataSource.prototype.getName=function(){return this._sName;};YAHOO.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName;};YAHOO.widget.DataSource.prototype.getResults=function(oCallbackFn,sQuery,oParent){var aResults=this._doQueryCache(oCallbackFn,sQuery,oParent);if(aResults.length===0){this.queryEvent.fire(this,oParent,sQuery);this.doQuery(oCallbackFn,sQuery,oParent);}};YAHOO.widget.DataSource.prototype.doQuery=function(oCallbackFn,sQuery,oParent){};YAHOO.widget.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];}
if(nNewItemIndex==-2){this._toggleContainer(false);return;}
var oNewItem=this._aListItems[nNewItemIndex];var oContent=this._oContainer._oContent;var scrollOn=((YAHOO.util.Dom.getStyle(oContent,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(oContent,"overflowY")=="auto"));if(scrollOn&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((oNewItem.offsetTop+oNewItem.offsetHeight)>(oContent.scrollTop+oContent.offsetHeight)){oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}
else if((oNewItem.offsetTop+oNewItem.offsetHeight)<oContent.scrollTop){oContent.scrollTop=oNewItem.offsetTop;}}
else{if(oNewItem.offsetTop<oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}
else if(oNewItem.offsetTop>(oContent.scrollTop+oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}}}
this._toggleHighlight(oNewItem,"to");this.itemArrowToEvent.fire(this,oNewItem);if(this.typeAhead){this._updateValue(oNewItem);}}};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseover");}
else{oSelf._toggleHighlight(this,"to");}
oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}
else{oSelf._toggleHighlight(this,"from");}
oSelf.itemMouseOutEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(v,oSelf){oSelf._toggleHighlight(this,"to");oSelf._selectItem(this);};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(v,oSelf){oSelf._bOverContainer=true;};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(v,oSelf){oSelf._bOverContainer=false;if(oSelf._oCurItem){oSelf._toggleHighlight(oSelf._oCurItem,"to");}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(v,oSelf){oSelf._oTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(v,oSelf){oSelf._toggleContainerHelpers(oSelf._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
else{oSelf._toggleContainer(false);}
break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
else{oSelf._toggleContainer(false);}
break;case 27:oSelf._toggleContainer(false);return;case 39:oSelf._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;case 40:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(v,oSelf){var nKeyCode=v.keyCode;var isMac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);if(isMac){switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}}
else if(nKeyCode==229){oSelf._queryInterval=setInterval(function(){oSelf._onIMEDetected(oSelf);},500);}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){oSelf._initProps();var nKeyCode=v.keyCode;oSelf._nKeyCode=nKeyCode;var sText=this.value;if(oSelf._isIgnoreKey(nKeyCode)||(sText.toLowerCase()==oSelf._sCurQuery)){return;}
else{oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}
if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}
oSelf._nDelayID=nDelayID;}
else{oSelf._sendQuery(sText);}};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;oSelf.textboxFocusEvent.fire(oSelf);};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&!oSelf._textMatchesOption())){if(oSelf.forceSelection){oSelf._clearSelection();}
else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}}
if(oSelf._bContainerOpen){oSelf._toggleContainer(false);}
oSelf._cancelIntervalDetection(oSelf);oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,oSelf){if(oSelf.allowBrowserAutocomplete){oSelf._oTextbox.setAttribute("autocomplete","on");}
else{oSelf._oTextbox.setAttribute("autocomplete","off");}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.ERROR_DATAPARSE="Response data could not be parsed";YAHOO.widget.DataSource.prototype.maxCacheEntries=15;YAHOO.widget.DataSource.prototype.queryMatchContains=false;YAHOO.widget.DataSource.prototype.queryMatchSubset=false;YAHOO.widget.DataSource.prototype.queryMatchCase=false;YAHOO.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName;};YAHOO.widget.DataSource.prototype.getResults=function(oCallbackFn,sQuery,oParent){var aResults=this._doQueryCache(oCallbackFn,sQuery,oParent);if(aResults.length===0){this.queryEvent.fire(this,oParent,sQuery);this.doQuery(oCallbackFn,sQuery,oParent);}};YAHOO.widget.DataSource.prototype.doQuery=function(oCallbackFn,sQuery,oParent){};YAHOO.widget.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];}
if(this._aCacheHelper){this._aCacheHelper=[];}
this.cacheFlushEvent.fire(this);};YAHOO.widget.DataSource.prototype.queryEvent=null;YAHOO.widget.DataSource.prototype.cacheQueryEvent=null;YAHOO.widget.DataSource.prototype.getResultsEvent=null;YAHOO.widget.DataSource.prototype.getCachedResultsEvent=null;YAHOO.widget.DataSource.prototype.dataErrorEvent=null;YAHOO.widget.DataSource.prototype.cacheFlushEvent=null;YAHOO.widget.DataSource._nIndex=0;YAHOO.widget.DataSource.prototype._sName=null;YAHOO.widget.DataSource.prototype._aCache=null;YAHOO.widget.DataSource.prototype._init=function(){var maxCacheEntries=this.maxCacheEntries;if(isNaN(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}
if(maxCacheEntries>0&&!this._aCache){this._aCache=[];}
this._sName="instance"+YAHOO.widget.DataSource._nIndex;YAHOO.widget.DataSource._nIndex++;this.queryEvent=new YAHOO.util.CustomEvent("query",this);this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this);};YAHOO.widget.DataSource.prototype._addCacheElem=function(resultObj){var aCache=this._aCache;if(!aCache||!resultObj||!resultObj.query||!resultObj.results){return;}
this._sName="instance"+YAHOO.widget.DataSource._nIndex;YAHOO.widget.DataSource._nIndex++;this.queryEvent=new YAHOO.util.CustomEvent("query",this);this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this);};YAHOO.widget.DataSource.prototype._addCacheElem=function(oResult){var aCache=this._aCache;if(!aCache||!oResult||!oResult.query||!oResult.results){return;}
if(aCache.length>=this.maxCacheEntries){aCache.shift();}
aCache.push(resultObj);};YAHOO.widget.DataSource.prototype._doQueryCache=function(oCallbackFn,sQuery,oParent){var aResults=[];var bMatchFound=false;var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var bMatchContains=this.queryMatchContains;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.cacheQueryEvent.fire(this,oParent,sQuery);if(!this.queryMatchCase){var sOrigQuery=sQuery;sQuery=sQuery.toLowerCase();}
for(var i=nCacheLength-1;i>=0;i--){var resultObj=aCache[i];var aAllResultItems=resultObj.results;var matchKey=(!this.queryMatchCase)?encodeURIComponent(resultObj.query.toLowerCase()):encodeURIComponent(resultObj.query);if(matchKey==sQuery){bMatchFound=true;aResults=aAllResultItems;if(i!=nCacheLength-1){aCache.splice(i,1);this._addCacheElem(resultObj);}
aCache.push(oResult);};YAHOO.widget.DataSource.prototype._doQueryCache=function(oCallbackFn,sQuery,oParent){var aResults=[];var bMatchFound=false;var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var bMatchContains=this.queryMatchContains;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.cacheQueryEvent.fire(this,oParent,sQuery);if(!this.queryMatchCase){var sOrigQuery=sQuery;sQuery=sQuery.toLowerCase();}
for(var i=nCacheLength-1;i>=0;i--){var resultObj=aCache[i];var aAllResultItems=resultObj.results;var matchKey=(!this.queryMatchCase)?encodeURIComponent(resultObj.query).toLowerCase():encodeURIComponent(resultObj.query);if(matchKey==sQuery){bMatchFound=true;aResults=aAllResultItems;if(i!=nCacheLength-1){aCache.splice(i,1);this._addCacheElem(resultObj);}
break;}
else if(this.queryMatchSubset){for(var j=sQuery.length-1;j>=0;j--){var subQuery=sQuery.substr(0,j);if(matchKey==subQuery){bMatchFound=true;for(var k=aAllResultItems.length-1;k>=0;k--){var aRecord=aAllResultItems[k];var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aRecord[0]).indexOf(sQuery):encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aRecord);}}
resultObj={};resultObj.query=sQuery;resultObj.results=aResults;this._addCacheElem(resultObj);break;}}
@ -137,18 +129,20 @@ if(bMatchFound){this.getCachedResultsEvent.fire(this,oParent,sOrigQuery,aResults
return aResults;};YAHOO.widget.DS_XHR=function(sScriptURI,aSchema,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
if(!aSchema||(aSchema.constructor!=Array)){return;}
else{this.schema=aSchema;}
this.scriptURI=sScriptURI;this._init();};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.prototype.TYPE_JSON=0;YAHOO.widget.DS_XHR.prototype.TYPE_XML=1;YAHOO.widget.DS_XHR.prototype.TYPE_FLAT=2;YAHOO.widget.DS_XHR.prototype.ERROR_DATAXHR="XHR response failed";YAHOO.widget.DS_XHR.prototype.connTimeout=0;YAHOO.widget.DS_XHR.prototype.scriptURI=null;YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query";YAHOO.widget.DS_XHR.prototype.scriptQueryAppend="";YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.prototype.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!--";YAHOO.widget.DS_XHR.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var isXML=(this.responseType==this.TYPE_XML);var sUri=this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;if(this.scriptQueryAppend.length>0){sUri+="&"+this.scriptQueryAppend;}
var oResponse=null;var oSelf=this;var responseSuccess=function(oResp){if(!oSelf._oConn||(oResp.tId!=oSelf._oConn.tId)){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATANULL);return;}
this.scriptURI=sScriptURI;this._init();};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.TYPE_JSON=0;YAHOO.widget.DS_XHR.TYPE_XML=1;YAHOO.widget.DS_XHR.TYPE_FLAT=2;YAHOO.widget.DS_XHR.ERROR_DATAXHR="XHR response failed";YAHOO.widget.DS_XHR.prototype.connMgr=YAHOO.util.Connect;YAHOO.widget.DS_XHR.prototype.connTimeout=0;YAHOO.widget.DS_XHR.prototype.scriptURI=null;YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query";YAHOO.widget.DS_XHR.prototype.scriptQueryAppend="";YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!-";YAHOO.widget.DS_XHR.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var isXML=(this.responseType==YAHOO.widget.DS_XHR.TYPE_XML);var sUri=this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;if(this.scriptQueryAppend.length>0){sUri+="&"+this.scriptQueryAppend;}
var oResponse=null;var oSelf=this;var responseSuccess=function(oResp){if(!oSelf._oConn||(oResp.tId!=oSelf._oConn.tId)){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
for(var foo in oResp){}
if(!isXML){oResp=oResp.responseText;}
else{oResp=oResp.responseXML;}
if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATANULL);return;}
var aResults=oSelf.parseResponse(sQuery,oResp,oParent);var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATAPARSE);return;}
else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);oCallbackFn(sQuery,aResults,oParent);}};var responseFailure=function(oResp){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATAXHR);return;};var oCallback={success:responseSuccess,failure:responseFailure};if(!isNaN(this.connTimeout)&&this.connTimeout>0){oCallback.timeout=this.connTimeout;}
if(this._oConn){YAHOO.util.Connect.abort(this._oConn);}
oSelf._oConn=YAHOO.util.Connect.asyncRequest("GET",sUri,oCallback,null);};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd);}
switch(this.responseType){case this.TYPE_JSON:var jsonList;if(window.JSON&&(navigator.userAgent.toLowerCase().indexOf('khtml')==-1)){var jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}
else{jsonList=eval("jsonObjParsed."+aSchema[0]);}}
if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
var aResults=oSelf.parseResponse(sQuery,oResp,oParent);var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATAPARSE);aResults=[];}
else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);}
oCallbackFn(sQuery,aResults,oParent);};var responseFailure=function(oResp){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DS_XHR.ERROR_DATAXHR);return;};var oCallback={success:responseSuccess,failure:responseFailure};if(!isNaN(this.connTimeout)&&this.connTimeout>0){oCallback.timeout=this.connTimeout;}
if(this._oConn){this.connMgr.abort(this._oConn);}
oSelf._oConn=this.connMgr.asyncRequest("GET",sUri,oCallback,null);};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd);}
switch(this.responseType){case YAHOO.widget.DS_XHR.TYPE_JSON:var jsonList;if(window.JSON&&(navigator.userAgent.toLowerCase().indexOf('khtml')==-1)){var jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}
else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}
catch(e){bError=true;break;}}}
else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length);}
if(oResponse.indexOf("{")<0){bError=true;break;}
if(oResponse.indexOf("{}")===0){break;}
@ -156,26 +150,28 @@ var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break;}
jsonList=eval("(jsonObjRaw."+aSchema[0]+")");}
catch(e){bError=true;break;}}
if(!jsonList){bError=true;break;}
if(jsonList.constructor!=Array){jsonList=[jsonList];}
for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue="";}
aResultItem.unshift(dataFieldValue);}
if(aResultItem.length==1){aResultItem.push(jsonResult);}
aResults.unshift(aResultItem);}
break;case this.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}
break;case YAHOO.widget.DS_XHR.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}
for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var aFieldSet=[];for(var m=aSchema.length-1;m>=1;m--){var sValue=null;var xmlAttr=result.attributes.getNamedItem(aSchema[m]);if(xmlAttr){sValue=xmlAttr.value;}
else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue;}
else{sValue="";}}
aFieldSet.unshift(sValue);}
aResults.unshift(aFieldSet);}
break;case this.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}
break;case YAHOO.widget.DS_XHR.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}
var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){aResults[n]=aRecords[n].split(aSchema[1]);}}
break;default:break;}
sQuery=null;oResponse=null;oParent=null;if(bError){return null;}
else{return aResults;}};YAHOO.widget.DS_XHR.prototype._oConn=null;YAHOO.widget.DS_JSFunction=function(oFunction,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
if(!oFunction||(oFunction.constructor!=Function)){return;}
else{this.dataFunction=oFunction;this._init();}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var oFunction=this.dataFunction;var aResults=[];aResults=oFunction(sQuery);if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,this.ERROR_DATANULL);return;}
else{this.dataFunction=oFunction;this._init();}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var oFunction=this.dataFunction;var aResults=[];aResults=oFunction(sQuery);if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;this._addCacheElem(resultObj);this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);return;};YAHOO.widget.DS_JSArray=function(aData,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
if(!aData||(aData.constructor!=Array)){return;}
else{this.data=aData;this._init();}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}
for(var i=aData.length-1;i>=0;i--){var aDataset=[];if(typeof aData[i]=="string"){aDataset[0]=aData[i];}
else{aDataset=aData[i];}
var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aDataset[0]).indexOf(sQuery):encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aDataset);}}
else{this.data=aData;this._init();}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(sQuery){if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}
for(var i=aData.length-1;i>=0;i--){var aDataset=[];if(aData[i]){if(aData[i].constructor==String){aDataset[0]=aData[i];}
else if(aData[i].constructor==Array){aDataset=aData[i];}}
if(aDataset[0]&&(aDataset[0].constructor==String)){var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aDataset[0]).indexOf(sQuery):encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aDataset);}}}}
this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);};

File diff suppressed because it is too large Load diff

View file

@ -1,21 +1,104 @@
Calendar Release Notes
*** version 0.12 ***
- New documentation format implemented
- Calendar2up and Calendar_Core are now deprecated. Now, Calendar alone
represents the single Calendar instance, and CalendarGroup represents an
n-up instance, defaulting to 2up
- Added semantic style classes to Calendar elements to allow for custom
styling solely using CSS.
- Remapped all configuration properties to use the Config object
(familiar to those who use the Container collection of controls).
Property names are the same as their previous counterparts, but wrapped
into Calendar.cfg, allowing for runtime reconfiguration of most
properties.
- Added "title" property for setting the Calendar title
- Added "close" property for enabling and disabling the close icon
- Added "iframe" property for enabling an iframe shim in Internet
Explorer 6 and below to fix the select bleed-through bug
- pageDate moved to property: "pagedate"
- selectedDates moved to property: "selected"
- minDate moved to property : "mindate", which accepts a JavaScript Date
object like its predecessor, but also supports string dates
- maxDate moved to property : "maxdate", which accepts a JavaScript Date
object like its predecessor, but also supports string dates
- Moved style declarations to initStyles function
- Optimized event handling in
doSelectCell/doCellMouseOver/doCellMouseOut by only attaching the
listener to the outer Calendar container, and only reacting to events on
cells with the "selectable" CSS class.
- Added domEventMap field for applying DOM event listeners to cells
containing specific class and tag combinations.
- Moved all cell DOM event attachment to applyListeners function
- Added getDateByCellId / getDateFieldsByCellId helper functions
- Corrected DateMath.getWeekNumber to comply with ISO week number
handling
- Separated renderCellDefault style portions into styleCellDefault
function for easy extension
- Deprecated onBeforeSelect. Created beforeSelectEvent which
automatically subscribes to its deprecated predecessor.
- Deprecated onSelect. Created selectEvent, which automatically
subscribes to its deprecated predecessor.
- Deprecated onBeforeDeselect. Created beforeSelectEvent which
automatically subscribes to its deprecated predecessor.
- Deprecated onDeselect. Created beforeDeselectEvent, which
automatically subscribes to its deprecated predecessor.
- Deprecated onChangePage. Created changePageEvent, which automatically
subscribes to its deprecated predecessor.
- Deprecated onRender. Created renderEvent, which automatically
subscribes to its deprecated predecessor.
- Deprecated onReset. Created resetEvent, which automatically subscribes
to its deprecated predecessor.
- Deprecated onClear. Created clearEvent, which automatically subscribes
to its deprecated predecessor.
- Corrected setMonth documentation to refer to 0-11 indexed months.
- Added show and hide methods to Calendar for setting the Calendar's
display property.
- Optimized internal render classes to use innerHTML and string buffers
- Removed wireCustomEvents function
- Removed wireDefaultEvents function
- Removed doNextMonth / doPreviousMonth
- Removed all buildShell (header, body, footer) functions, since the
Calendar shell is now built dynamically on each render
- Wired all CalendarGroup events and configuration properties to be
properly delegated to Calendar
- Augmented CalendarGroup with all built-in renderers, label functions,
hide, show, and initStyles, creating API transparency between Calendar
and CalendarGroup.
- Made all tagName, createElement, and entity references XHTML compliant
- Fixed Daylight Saving Time bug for Brazilian time zone
*** version 0.11.3 ***
- Calendar_Core: Added arguments for selected/deselected dates to
onSelect/onDeselect
- CalendarGroup: Fixed bug where selected dates passed to constructor
were not represented in selectedDates
- Calendar2up: Now displays correctly in Opera 9
*** version 0.11.0 ***
- DateMath: DateMath.add now properly adds weeks
- DateMath: between() function added
- DateMath: getWeekNumber() fixed to take starting day of week into account
- All references to Calendar's built in CSS class handlers are removed, replaced with calls to Dom utility (addClass, removeClass)
- DateMath: getWeekNumber() fixed to take starting day of week into
account
- All references to Calendar's built in CSS class handlers are removed,
replaced with calls to Dom utility (addClass, removeClass)
- Several CSS class constants now have clearer names
- All CSS classes are now properly namespaced to avoid CSS conflicts
- Fixed table:hover bug in CSS
- Calendar no longer requires the container ID and variable name to match in order for month navigation to function properly
- Calendar month navigation arrows are now represented as background images
- Calendar no longer requires the container ID and variable name to
match in order for month navigation to function properly
- Calendar month navigation arrows are now represented as background
images
*** version 0.10.0 ***
- Major performance improvements from attaching DOM events to associated table cells only once, when the Calendar shell is built
- DOM events for mouseover/mouseout are now fired for all browsers (not just Internet Explorer)
- Major performance improvements from attaching DOM events to associated
table cells only once, when the Calendar shell is built
- DOM events for mouseover/mouseout are now fired for all browsers (not
just Internet Explorer)
- Reset functionality bug fixed for 2-up Calendar view
*** version 0.9.0 ***

View file

@ -2,17 +2,40 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version 0.11.0
Version 0.12
*/
.yui-cal2upwrapper {*height:1%;} /* IE */
.yui-cal2upwrapper:after {content:'.';clear:both;display:block;visibility:hidden;height:0;} /* others */
.yui-calcontainer {
float:left;
position:relative;
padding:5px;
background-color:#F7F9FB;
border:1px solid #7B9EBD;
float:left;
overflow:hidden;
}
.yui-calcontainer iframe {
position:absolute;
border:none;
margin:0;padding:0;
left:-1px;
top:-1px;
z-index:0;
width:50em;
height:50em;
}
.yui-calcontainer.multi {
padding:0;
}
.yui-calcontainer.multi .groupcal {
padding:5px;
background-color:transparent;
z-index:1;
float:left;
position:relative;
border:none;
}
.yui-calcontainer .title {
@ -20,20 +43,32 @@ Version 0.11.0
color:#000;
font-weight:bold;
margin-bottom:5px;
height:auto;
width:304px;
height:25px;
position:absolute;
top:3px;left:5px;
z-index:1;
}
.yui-calcontainer .close-icon {
position:absolute;
right:3px;
top:3px;
border:none;
z-index:1;
}
/* Calendar element styles */
.yui-calendar {
font:100% sans-serif;
text-align:center;
border-spacing:0;
border-collapse:separate;
position:relative;
}
.yui-calcontainer .title .close-icon {
position:absolute;
right:0;
top:0;
border:none;
}
.yui-calcontainer .cal2up {
float:left;
.yui-calcontainer.withtitle {
padding-top:1.5em;
}
.yui-calendar .calnavleft {
@ -45,6 +80,7 @@ Version 0.11.0
width:9px;
height:12px;
left:2px;
z-index:1;
}
.yui-calendar .calnavright {
@ -56,22 +92,13 @@ Version 0.11.0
width:9px;
height:12px;
right:2px;
}
/* Calendar element styles */
.yui-calendar {
font:100% sans-serif;
text-align:center;
border-spacing:0;
border-collapse:separate;
z-index:1;
}
.yui-calendar td.calcell {
width:1.5em;
height:1em;
padding:.1em .2em;
border:1px solid #E0E0E0;
background-color:#FFF;
text-align:center;
}
.yui-calendar td.calcell a {
@ -103,12 +130,6 @@ Version 0.11.0
border:1px solid #FF9900;
}
/* Added to perform some correction for Opera 8.5
hover redraw bug */
table.yui-calendar:hover {
background-color:#FFF;
}
.yui-calendar td.calcell.calcellhover a {
color:#FFF;
}
@ -126,7 +147,6 @@ table.yui-calendar:hover {
.yui-calendar td.calcell.highlight3 { background-color:#FFCCCC; }
.yui-calendar td.calcell.highlight4 { background-color:#CCFF99; }
.yui-calendar .calhead {
border:1px solid #E0E0E0;
vertical-align:middle;
@ -146,6 +166,8 @@ table.yui-calendar:hover {
.yui-calendar .calweekdaycell {
color:#666;
font-weight:normal;
text-align:center;
width:1.5em;
}
.yui-calendar .calfoot {

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -1,10 +1,70 @@
Connection Manager Release Notes
*** version 0.12.0 ***
* When uploading files via setForm() and asyncRequest includes a POST data
argument, appendPostData() will create hidden input fields for each postData
label/value and append each field to the form object.
* setForm() returns the assembled label/value string of the parsed HTML form
fields.
* NOTE: Opera 9.02 does not allow for more than 12 concurrent Connection Manager
objects.
The following example creates 12 requests in a loop:
for(var n=0; n<=12; i++){
conn[n] = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
}
If n > 13, Opera 9.02 will crash. Connection manager objects count n must be <=
12 at all times. This condition was not present in Opera version 9.01.
This condition does not apply to other A-Grade browsers (
http://developer.yahoo.com/yui/articles/gbs/gbs_browser-chart.html)
*** version 0.11.3 ***
* YUI Event dependency for file uploading is now optional.
* uploadFile() now sets unique IDs for each file upload transaction to prevent
iframe collisions with parallel uploads.
* The callback object now has property responseXML to provide support for file
upload transactions that return an XML document.
* setForm() will verify if a select option value attribute is present and use
its value, including empty string, before using the text node value.
* Modified polling mechanism in handleReadyState() and
handleTransactionResponse() to prevent infinite polling if JavaScript errors
occur in the user-defined callback.
* createFrame() will now accept a boolean argument of true to set the frame
source to "javascript:false" to prevent IE from throwing security warnings in an
HTTPS environment.
* setHeader() now enumerates through the _http_header object using
hasOwnProperty() to prevent collisions with members added to Object via
prototype.
* If using setForm() and asyncRequest includes a POST data argument, the data
will be concatenated to the HTML form POST message.
*** version 0.11.2 ***
* No revisions.
*** version 0.11.1 ***
* uploadFile() now verifies the existence of callback.upload before invoking
callback, with or without object scope.
*** version 0.11.0 ***
* Each transactions can be defined with a timeout threshold, in milliseconds,
* Each transaction can be defined with a timeout threshold, in milliseconds,
through the callback object. If the threshold is reached, and the transaction
hasn't completed, the transaction will call abort().
hasn't yet completed, the transaction will call abort().
* abort() will now accept a callback object as the second argument. The
failure callback will receive a response object to indicate the transaction was
@ -78,3 +138,14 @@ and returns false if the connection object is no longer available.

View file

@ -2,21 +2,27 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
version: 0.12.0
*/
/**
* @description
* 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.
* @ class
*
* @namespace YAHOO.util
* @module Connection
* @Class Connect
*/
YAHOO.util.Connect =
{
/**
* Array of MSFT ActiveX ids for XMLHttpRequest.
* @description Array of MSFT ActiveX ids for XMLHttpRequest.
* @property _msxml_progid
* @private
* @static
* @type array
*/
_msxml_progid:[
@ -26,96 +32,133 @@ YAHOO.util.Connect =
],
/**
* Object literal of HTTP header(s)
* @description Object literal of HTTP header(s)
* @property _http_header
* @private
* @static
* @type object
*/
_http_header:{},
/**
* Determines if HTTP headers are set.
* @description Determines if HTTP headers are set.
* @property _has_http_headers
* @private
* @static
* @type boolean
*/
_has_http_headers:false,
/**
* Property that that determines if a default header of
* @description Determines if a default header of
* Content-Type of 'application/x-www-form-urlencoded'
* will be added to any client HTTP headers sent.
* will be added to any client HTTP headers sent for POST
* transactions.
* @property _use_default_post_header
* @private
* @static
* @type boolean
*/
_default_post_header:true,
_use_default_post_header:true,
/**
* Property modified by setForm() to determine if the data
* should be submitted as an HTML form.
* @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 _default_post_header
* @private
* @static
* @type boolean
*/
_default_post_header:'application/x-www-form-urlencoded',
/**
* @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,
/**
* Property modified by setForm() to determine if a file(s)
* @description Property modified by setForm() to determine if a file(s)
* upload is expected.
* @property _isFileUpload
* @private
* @static
* @type boolean
*/
_isFileUpload:false,
/**
* Property modified by setForm() to set a reference to the HTML
* @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,
/**
* Property modified by setForm() to set the HTML form data
* @description Property modified by setForm() to set the HTML form data
* for each transaction.
* @property _sFormData
* @private
* @static
* @type string
*/
_sFormData:null,
/**
* Collection of polling references to the polling mechanism in handleReadyState.
* @description Collection of polling references to the polling mechanism in handleReadyState.
* @property _poll
* @private
* @type string
* @static
* @type object
*/
_poll:[],
_poll:{},
/**
* Queue of timeout references for each transaction with a defined timeout value.
* @description Queue of timeout values for each transaction callback with a defined timeout value.
* @property _timeOut
* @private
* @type string
* @static
* @type object
*/
_timeOut:[],
_timeOut:{},
/**
* The polling frequency, in milliseconds, for HandleReadyState.
* @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,
/**
* A transaction counter that increments the transaction id for each transaction.
* @description A transaction counter that increments the transaction id for each transaction.
* @property _transaction_id
* @private
* @static
* @type int
*/
_transaction_id:0,
/**
* Member to add an ActiveX id to the existing xml_progid array.
* @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
* @param string id The ActiveX id to be added to initialize the XHR object.
* @static
* @param {string} id The ActiveX id to be added to initialize the XHR object.
* @return void
*/
setProgId:function(id)
@ -125,20 +168,24 @@ YAHOO.util.Connect =
},
/**
* Member to enable or disable the default POST header.
* @description Member to enable or disable the default POST header.
* @method setDefaultPostHeader
* @public
* @param boolean b Use default header - true or false .
* @static
* @param {boolean} b Set and use default header - true or false .
* @return void
*/
setDefaultPostHeader:function(b)
{
YAHOO.log('Default POST header set to ' + b, 'info', 'Connection');
this._default_post_header = b;
this._use_default_post_header = b;
YAHOO.log('Use default POST header set to ' + b, 'info', 'Connection');
},
/**
* Member to modify the default polling interval.
* @description Member to modify the default polling interval.
* @method setPollingInterval
* @public
* @static
* @param {int} i The polling interval in milliseconds.
* @return void
*/
@ -146,16 +193,18 @@ YAHOO.util.Connect =
{
if(typeof i == 'number' && isFinite(i)){
this._polling_interval = i;
YAHOO.log('Default polling interval set to ' + i, 'info', 'Connection');
YAHOO.log('Default polling interval set to ' + i +'ms', 'info', 'Connection');
}
},
/**
* Instantiates a XMLHttpRequest object and returns an object with two properties:
* @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 connection object
* @return object
*/
createXhrObject:function(transactionId)
{
@ -175,7 +224,7 @@ YAHOO.util.Connect =
{
// Instantiates XMLHttpRequest for IE and assign to http.
http = new ActiveXObject(this._msxml_progid[i]);
// Object literal with http and tId properties
// Object literal with conn and tId properties
obj = { conn:http, tId:transactionId };
YAHOO.log('ActiveX XHR object created for transaction ' + transactionId, 'info', 'Connection');
break;
@ -190,11 +239,13 @@ YAHOO.util.Connect =
},
/**
* This method is called by asyncRequest to create a
* @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
* @return object
* @static
* @return {object}
*/
getConnectionObject:function()
{
@ -216,11 +267,13 @@ YAHOO.util.Connect =
},
/**
* Method for initiating an asynchronous request via the XHR object.
* @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 User-defined callback function or object
* @param {callback} callback User-defined callback function or object
* @param {string} postData POST body
* @return {object} Returns the connection object
*/
@ -235,8 +288,9 @@ YAHOO.util.Connect =
else{
if(this._isFormSubmit){
if(this._isFileUpload){
this.uploadFile(o.tId, callback, uri);
this.uploadFile(o.tId, callback, uri, postData);
this.releaseObject(o);
return;
}
@ -244,94 +298,90 @@ YAHOO.util.Connect =
//encoded string that is concatenated to the uri to
//create a querystring.
if(method == '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{
uri += "?" + this._sFormData;
}
else if(method == 'POST'){
postData = this._sFormData;
}
this._sFormData = '';
else if(method == '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;
}
}
o.conn.open(method, uri, true);
if(this._isFormSubmit || (postData && this._default_post_header)){
this.initHeader('Content-Type','application/x-www-form-urlencoded');
if(this._isFormSubmit || (postData && this._use_default_post_header)){
this.initHeader('Content-Type', this._default_post_header);
YAHOO.log('Initialize default header Content-Type to application/x-www-form-urlencoded.', 'info', 'Connection');
if(this._isFormSubmit){
this._isFormSubmit = false;
}
else if(this._isFormSubmit){
this.resetFormState();
}
//Verify whether the transaction has any user-defined HTTP headers
//and set them.
if(this._has_http_headers){
this.setHeader(o);
}
this.handleReadyState(o, callback);
postData?o.conn.send(postData):o.conn.send(null);
o.conn.send(postData || null);
return o;
}
},
/**
* This method serves as a timer that polls the XHR object's readyState
* @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 User-defined callback object
* @return void
* @param {callback} callback The user-defined callback object
* @return {void}
*/
handleReadyState:function(o, callback)
{
var timeOut = callback.timeout;
var oConn = this;
try
{
if(timeOut !== undefined){
this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true) }, timeOut);
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){
window.clearInterval(oConn._poll[o.tId]);
oConn._poll.splice(o.tId);
if(timeOut){
oConn._timeOut.splice(o.tId);
delete oConn._poll[o.tId];
if(callback && callback.timeout){
delete oConn._timeOut[o.tId];
}
oConn.handleTransactionResponse(o, callback);
}
}
,this._polling_interval);
}
catch(e)
{
window.clearInterval(oConn._poll[o.tId]);
oConn._poll.splice(o.tId);
if(timeOut){
oConn._timeOut.splice(o.tId);
}
oConn.handleTransactionResponse(o, callback);
}
},
/**
* This method attempts to interpret the server response and
* @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 - User-defined callback object
* @param {boolean} determines if the transaction was aborted.
* @return void
* @param {object} callback The sser-defined callback object
* @param {boolean} isAbort Determines if the transaction was aborted.
* @return {void}
*/
handleTransactionResponse:function(o, callback, isAbort)
{
@ -377,18 +427,14 @@ YAHOO.util.Connect =
}
else{
switch(httpStatus){
// The following case labels are wininet.dll error codes that may be encountered.
// Server timeout
case 12002:
// 12029 to 12031 correspond to dropped connections.
case 12029:
// 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:
// Connection closed by server.
case 12152:
// See above comments for variable status.
case 13030:
responseObject = this.createExceptionObject(o.tId, callback.argument, isAbort);
case 12152: // Connection closed by server.
case 13030: // See above comments for variable status.
responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));
if(callback.failure){
if(!callback.scope){
callback.failure(responseObject);
@ -416,16 +462,19 @@ YAHOO.util.Connect =
}
this.releaseObject(o);
responseObject = null;
},
/**
* This method evaluates the server response, creates and returns the results via
* @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 User-defined argument or arguments to be passed to the callback
* @return object
* @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
* @return {object}
*/
createResponseObject:function(o, callbackArg)
{
@ -439,7 +488,7 @@ YAHOO.util.Connect =
for(var i=0; i<header.length; i++){
var delimitPos = header[i].indexOf(':');
if(delimitPos != -1){
headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+1);
headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+2);
}
}
}
@ -461,18 +510,20 @@ YAHOO.util.Connect =
},
/**
* If a transaction cannot be completed due to dropped or closed connections,
* @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
* @param {int} tId Transaction Id
* @param callbackArg The user-defined arguments
* @param isAbort Determines if the exception is an abort.
* @return object
* @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)
{
@ -501,11 +552,13 @@ YAHOO.util.Connect =
},
/**
* Public method that stores the custom HTTP headers for each transaction.
* @description Public method that stores the custom HTTP headers for each transaction.
* @method initHeader
* @public
* @static
* @param {string} label The HTTP header label
* @param {string} value The HTTP header value
* @return void
* @return {void}
*/
initHeader:function(label,value)
{
@ -513,6 +566,8 @@ YAHOO.util.Connect =
this._http_header[label] = value;
}
else{
// Concatenate multiple values, comma-delimited,
// for the same header label,
this._http_header[label] = value + "," + this._http_header[label];
}
@ -520,15 +575,17 @@ YAHOO.util.Connect =
},
/**
* Accessor that sets the HTTP headers for each transaction.
* @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
* @return {void}
*/
setHeader:function(o)
{
for(var prop in this._http_header){
if(this._http_header.propertyIsEnumerable){
if(this._http_header.hasOwnProperty(prop)){
o.conn.setRequestHeader(prop, this._http_header[prop]);
YAHOO.log('HTTP header ' + prop + ' set with value of ' + this._http_header[prop], 'info', 'Connection');
}
@ -540,20 +597,21 @@ YAHOO.util.Connect =
},
/**
* This method assembles the form label and value pairs and
* @description This method assembles the form label and value pairs and
* constructs an encoded string.
* asyncRequest() will automatically initialize the
* transaction with a HTTP header Content-Type of
* application/x-www-form-urlencoded.
* @method setForm
* @public
* @static
* @param {string || object} form id or name attribute, or form object.
* @param {string} optional boolean to indicate SSL environment.
* @param {string} optional qualified path of iframe resource for SSL in IE.
* @return void
* @param {string || boolean} optional qualified path of iframe resource for SSL in IE.
* @return {string} string of the HTML form field name and value pairs..
*/
setForm:function(formId, isUpload, secureUri)
{
this._sFormData = '';
if(typeof formId == 'string'){
// Determine if the argument is a form id or a form name.
// Note form name usage is deprecated by supported
@ -561,6 +619,7 @@ YAHOO.util.Connect =
var oForm = (document.getElementById(formId) || document.forms[formId]);
}
else if(typeof formId == 'object'){
// Treat argument as an HTML form object.
var oForm = formId;
}
else{
@ -575,7 +634,11 @@ YAHOO.util.Connect =
// where the secureURI string is a fully qualified HTTP path, used to set the source
// of the iframe, to a stub resource in the same domain.
if(isUpload){
(typeof secureUri == 'string')?this.createFrame(secureUri):this.createFrame();
// Create iframe in preparation for file upload.
this.createFrame(secureUri?secureUri:null);
// Set form reference and file upload properties to true.
this._isFormSubmit = true;
this._isFileUpload = true;
this._formNode = oForm;
@ -589,17 +652,14 @@ YAHOO.util.Connect =
// Iterate over the form elements collection to construct the
// label-value pairs.
for (var i=0; i<oForm.elements.length; i++){
oDisabled = oForm.elements[i].disabled;
// If the name attribute is not populated, the form field's
// value will not be submitted.
oElement = oForm.elements[i];
oDisabled = oForm.elements[i].disabled;
oName = oForm.elements[i].name;
oValue = oForm.elements[i].value;
// Do not submit fields that are disabled or
// do not have a name attribute value.
if(!oDisabled && oName !== undefined)
if(!oDisabled && oName)
{
switch (oElement.type)
{
@ -607,7 +667,13 @@ YAHOO.util.Connect =
case 'select-multiple':
for(var j=0; j<oElement.options.length; j++){
if(oElement.options[j].selected){
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].value || oElement.options[j].text) + '&';
if(window.ActiveXObject){
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text) + '&';
}
else{
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';
}
}
}
break;
@ -642,33 +708,61 @@ YAHOO.util.Connect =
this._isFormSubmit = true;
this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
YAHOO.log('Form initialized for transaction. POST message is: ' + this._sFormData, 'info', 'Connection');
YAHOO.log('Form initialized for transaction. HTML form POST message is: ' + this._sFormData, 'info', 'Connection');
return this._sFormData;
},
/**
* Creates an iframe to be used for form file uploads. It is remove from the
* document upon completion of the upload transaction.
*
* @description Resets HTML form properties when an HTML form or HTML form
* with file upload transaction is sent.
* @method resetFormState
* @private
* @static
* @param {boolean} isUpload Indicates if file upload properties should be reset.
* @return {void}
*/
resetFormState:function(isUpload){
this._isFormSubmit = false;
this._sFormData = null;
if(isUpload){
this._isFileUpload = false;
this._formNode = null;
}
},
/**
* @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
* @return {void}
*/
createFrame:function(secureUri){
// IE does not allow the setting of id and name attributes as DOM
// properties. A different iframe creation pattern is required for IE.
// 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;
if(window.ActiveXObject){
var io = document.createElement('<IFRAME name="ioFrame" id="ioFrame">');
if(secureUri){
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
// IE will throw a security exception in an SSL environment if the
// iframe source isn't set to a valid resource.
// iframe source is undefined.
if(typeof secureUri == 'boolean'){
io.src = 'javascript:false';
}
else if(typeof secureURI == 'string'){
// Deprecated
io.src = secureUri;
}
}
else{
var io = document.createElement('IFRAME');
io.id = 'ioFrame';
io.name = 'ioFrame';
var io = document.createElement('iframe');
io.id = frameId;
io.name = frameId;
}
io.style.position = 'absolute';
@ -676,31 +770,84 @@ YAHOO.util.Connect =
io.style.left = '-1000px';
document.body.appendChild(io);
YAHOO.log('File upload iframe created. Id is:' + frameId, 'info', 'Connection');
},
/**
* Uploads HTML form, including files/attachments, targeting the
* iframe created in createFrame.
*
* @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 = new Array();
var postMessage = postData.split('&');
for(var i=0; i < postMessage.length; i++){
var 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);
this._formNode.appendChild(formElements[i]);
}
}
return formElements;
},
/**
* @description Uploads HTML form, including files/attachments, to the
* iframe created in createFrame.
* @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.
* @return void
* @return {void}
*/
uploadFile:function(id, callback, uri){
uploadFile:function(id, callback, uri, postData){
// Each iframe has an id prefix of "yuiIO" followed
// by the unique transaction id.
var frameId = 'yuiIO' + id;
var io = document.getElementById(frameId);
// Initialize the HTML form properties in case they are
// not defined in the HTML form.
this._formNode.action = uri;
this._formNode.enctype = 'multipart/form-data';
this._formNode.method = 'POST';
this._formNode.target = 'ioFrame';
this._formNode.target = frameId;
if(this._formNode.encoding){
// IE does not respect property enctype for HTML forms.
// Instead use property encoding.
this._formNode.encoding = 'multipart/form-data';
}
else{
this._formNode.enctype = 'multipart/form-data';
}
if(postData){
var oElements = this.appendPostData(postData);
}
this._formNode.submit();
// Reset form status properties.
this._formNode = null;
this._isFileUpload = false;
this._isFormSubmit = false;
if(oElements && oElements.length > 0){
for(var i=0; i < oElements.length; i++){
this._formNode.removeChild(oElements[i]);
}
}
// Reset HTML form status properties.
this.resetFormState();
// Create the upload callback handler that fires when the iframe
// receives the load event. Subsequently, the event handler is detached
@ -708,48 +855,76 @@ YAHOO.util.Connect =
var uploadCallback = function()
{
var oResponse =
{
tId: id,
responseText: document.getElementById("ioFrame").contentWindow.document.body.innerHTML,
argument: callback.argument
}
var obj = {};
obj.tId = id;
obj.argument = callback.argument;
if(callback.upload && !callback.scope){
callback.upload(oResponse);
try
{
obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}
catch(e){}
if(callback.upload){
if(!callback.scope){
callback.upload(obj);
YAHOO.log('Upload callback.', 'info', 'Connection');
}
else{
callback.upload.apply(callback.scope, [oResponse]);
YAHOO.log('Upload callback with object scope.', 'info', 'Connection');
callback.upload.apply(callback.scope, [obj]);
YAHOO.log('Upload callback with scope.', 'info', 'Connection');
}
}
YAHOO.util.Event.removeListener("ioFrame", "load", uploadCallback);
window.ioFrame.location.replace('#');
setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);
if(YAHOO.util.Event){
YAHOO.util.Event.removeListener(io, "load", uploadCallback);
}
else if(window.detachEvent){
io.detachEvent('onload', uploadCallback);
}
else{
io.removeEventListener('load', uploadCallback, false);
}
setTimeout(
function(){
document.body.removeChild(io);
YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
}, 100);
};
// Bind the onload handler to the iframe to detect the file upload response.
YAHOO.util.Event.addListener("ioFrame", "load", uploadCallback);
if(YAHOO.util.Event){
YAHOO.util.Event.addListener(io, "load", uploadCallback);
}
else if(window.attachEvent){
io.attachEvent('onload', uploadCallback);
}
else{
io.addEventListener('load', uploadCallback, false);
}
},
/**
* Public method to terminate a transaction, if it has not reached readyState 4.
* @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 was a timeout.
* @return void
* @return {boolean}
*/
abort:function(o, callback, isTimeout)
{
if(this.isCallInProgress(o)){
window.clearInterval(this._poll[o.tId]);
this._poll.splice(o.tId);
if(isTimeout){
this._timeOut.splice(o.tId);
}
o.conn.abort();
window.clearInterval(this._poll[o.tId]);
delete this._poll[o.tId];
if(isTimeout){
delete this._timeOut[o.tId];
}
this.handleTransactionResponse(o, callback, true);
YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');
@ -757,17 +932,19 @@ YAHOO.util.Connect =
return true;
}
else{
YAHOO.log('Transaction ' + o.tId + ' abort failed.', 'warn', 'Connection');
YAHOO.log('Transaction ' + o.tId + ' abort call failed.', 'warn', 'Connection');
return false;
}
},
/**
* Public method to check if the transaction is still being processed.
*
* @method isCallInProgress
* @public
* @static
* @param {object} o The connection object returned by asyncRequest
* @return boolean
* @return {boolean}
*/
isCallInProgress:function(o)
{
@ -783,18 +960,18 @@ YAHOO.util.Connect =
},
/**
* Dereference the XHR instance and the connection object after the transaction is completed.
* @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
* @return {void}
*/
releaseObject:function(o)
{
//dereference the XHR instance.
o.conn = null;
YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
//dereference the connection object.
o = null;
}

View file

@ -1,12 +1,7 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
*/
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_default_post_header:true,_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:[],_timeOut:[],_polling_interval:50,_transaction_id:0,setProgId:function(id)
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded',_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,setProgId:function(id)
{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
{this._default_post_header=b;},setPollingInterval:function(i)
{this._use_default_post_header=b;},setPollingInterval:function(i)
{if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
{var obj,http;try
{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
@ -22,34 +17,34 @@ catch(e){}
finally
{return o;}},asyncRequest:function(method,uri,callback,postData)
{var o=this.getConnectionObject();if(!o){return null;}
else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri);this.releaseObject(o);return;}
if(method=='GET'){uri+="?"+this._sFormData;}
else if(method=='POST'){postData=this._sFormData;}
this._sFormData='';}
o.conn.open(method,uri,true);if(this._isFormSubmit||(postData&&this._default_post_header)){this.initHeader('Content-Type','application/x-www-form-urlencoded');if(this._isFormSubmit){this._isFormSubmit=false;}}
else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri,postData);this.releaseObject(o);return;}
if(method=='GET'){if(this._sFormData.length!=0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
else{uri+="?"+this._sFormData;}}
else if(method=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
o.conn.open(method,uri,true);if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}
if(this._has_http_headers){this.setHeader(o);}
this.handleReadyState(o,callback);postData?o.conn.send(postData):o.conn.send(null);return o;}},handleReadyState:function(o,callback)
{var timeOut=callback.timeout;var oConn=this;try
{if(timeOut!==undefined){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true)},timeOut);}
this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);}
catch(e)
{window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}
oConn.handleTransactionResponse(o,callback);}},handleTransactionResponse:function(o,callback,isAbort)
this.handleReadyState(o,callback);o.conn.send(postData||null);return o;}},handleReadyState:function(o,callback)
{var oConn=this;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){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){delete oConn._timeOut[o.tId];}
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
{if(!callback){this.releaseObject(o);return;}
var httpStatus,responseObject;try
{if(o.conn.status!==undefined&&o.conn.status!=0){httpStatus=o.conn.status;}
else{httpStatus=13030;}}
catch(e){httpStatus=13030;}
if(httpStatus>=200&&httpStatus<300){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
if(httpStatus>=200&&httpStatus<300){try
{responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
else{callback.success.apply(callback.scope,[responseObject]);}}}
else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,isAbort);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
catch(e){}}
else{try
{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,(isAbort?isAbort:false));if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}
break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}}}
this.releaseObject(o);},createResponseObject:function(o,callbackArg)
catch(e){}}
this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
{var obj={};var headerObj={};try
{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+1);}}}
{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
catch(e){}
obj.tId=o.tId;obj.status=o.conn.status;obj.statusText=o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}
return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
@ -60,27 +55,44 @@ return obj;},initHeader:function(label,value)
{if(this._http_header[label]===undefined){this._http_header[label]=value;}
else{this._http_header[label]=value+","+this._http_header[label];}
this._has_http_headers=true;},setHeader:function(o)
{for(var prop in this._http_header){if(this._http_header.propertyIsEnumerable){o.conn.setRequestHeader(prop,this._http_header[prop]);}}
{for(var prop in this._http_header){if(this._http_header.hasOwnProperty(prop)){o.conn.setRequestHeader(prop,this._http_header[prop]);}}
delete this._http_header;this._http_header={};this._has_http_headers=false;},setForm:function(formId,isUpload,secureUri)
{this._sFormData='';if(typeof formId=='string'){var oForm=(document.getElementById(formId)||document.forms[formId]);}
else if(typeof formId=='object'){var oForm=formId;}
{this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
else if(typeof formId=='object'){oForm=formId;}
else{return;}
if(isUpload){(typeof secureUri=='string')?this.createFrame(secureUri):this.createFrame();this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oDisabled=oForm.elements[i].disabled;oElement=oForm.elements[i];oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
if(isUpload){this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oElement=oForm.elements[i];oDisabled=oForm.elements[i].disabled;oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
{switch(oElement.type)
{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].value||oElement.options[j].text)+'&';}}
{case'select-one':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)+'&';}
else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}
break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit==false){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';hasSubmit=true;}
break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';break;}}}
this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);},createFrame:function(secureUri){if(window.ActiveXObject){var io=document.createElement('<IFRAME name="ioFrame" id="ioFrame">');if(secureUri){io.src=secureUri;}}
else{var io=document.createElement('IFRAME');io.id='ioFrame';io.name='ioFrame';}
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},uploadFile:function(id,callback,uri){this._formNode.action=uri;this._formNode.enctype='multipart/form-data';this._formNode.method='POST';this._formNode.target='ioFrame';this._formNode.submit();this._formNode=null;this._isFileUpload=false;this._isFormSubmit=false;var uploadCallback=function()
{var oResponse={tId:id,responseText:document.getElementById("ioFrame").contentWindow.document.body.innerHTML,argument:callback.argument}
if(callback.upload&&!callback.scope){callback.upload(oResponse);}
else{callback.upload.apply(callback.scope,[oResponse]);}
YAHOO.util.Event.removeListener("ioFrame","load",uploadCallback);window.ioFrame.location.replace('#');setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);};YAHOO.util.Event.addListener("ioFrame","load",uploadCallback);},abort:function(o,callback,isTimeout)
{if(this.isCallInProgress(o)){window.clearInterval(this._poll[o.tId]);this._poll.splice(o.tId);if(isTimeout){this._timeOut.splice(o.tId);}
o.conn.abort();this.handleTransactionResponse(o,callback,true);return true;}
this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;if(window.ActiveXObject){var io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}
else if(typeof secureURI=='string'){io.src=secureUri;}}
else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)
{var formElements=new Array();var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var 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);this._formNode.appendChild(formElements[i]);}}
return formElements;},uploadFile:function(id,callback,uri,postData){var frameId='yuiIO'+id;var io=document.getElementById(frameId);this._formNode.action=uri;this._formNode.method='POST';this._formNode.target=frameId;if(this._formNode.encoding){this._formNode.encoding='multipart/form-data';}
else{this._formNode.enctype='multipart/form-data';}
if(postData){var oElements=this.appendPostData(postData);}
this._formNode.submit();if(oElements&&oElements.length>0){try
{for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
catch(e){}}
this.resetFormState();var uploadCallback=function()
{var obj={};obj.tId=id;obj.argument=callback.argument;try
{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
catch(e){}
if(callback.upload){if(!callback.scope){callback.upload(obj);}
else{callback.upload.apply(callback.scope,[obj]);}}
if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}
else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}
else{io.removeEventListener('load',uploadCallback,false);}
setTimeout(function(){document.body.removeChild(io);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)
{if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){delete this._timeOut[o.tId];}
this.handleTransactionResponse(o,callback,true);return true;}
else{return false;}},isCallInProgress:function(o)
{if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}
else{return false;}},releaseObject:function(o)

View file

@ -2,21 +2,27 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
version: 0.12.0
*/
/**
* @description
* 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.
* @ class
*
* @namespace YAHOO.util
* @module Connection
* @Class Connect
*/
YAHOO.util.Connect =
{
/**
* Array of MSFT ActiveX ids for XMLHttpRequest.
* @description Array of MSFT ActiveX ids for XMLHttpRequest.
* @property _msxml_progid
* @private
* @static
* @type array
*/
_msxml_progid:[
@ -26,97 +32,133 @@ YAHOO.util.Connect =
],
/**
* Object literal of HTTP header(s)
* @description Object literal of HTTP header(s)
* @property _http_header
* @private
* @static
* @type object
*/
_http_header:{},
/**
* Determines if HTTP headers are set.
* @description Determines if HTTP headers are set.
* @property _has_http_headers
* @private
* @static
* @type boolean
*/
_has_http_headers:false,
/**
* Determines if a default header of
* @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
*/
_default_post_header:true,
_use_default_post_header:true,
/**
* Property modified by setForm() to determine if the data
* should be submitted as an HTML form.
* @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 _default_post_header
* @private
* @static
* @type boolean
*/
_default_post_header:'application/x-www-form-urlencoded',
/**
* @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,
/**
* Property modified by setForm() to determine if a file(s)
* @description Property modified by setForm() to determine if a file(s)
* upload is expected.
* @property _isFileUpload
* @private
* @static
* @type boolean
*/
_isFileUpload:false,
/**
* Property modified by setForm() to set a reference to the HTML
* @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,
/**
* Property modified by setForm() to set the HTML form data
* @description Property modified by setForm() to set the HTML form data
* for each transaction.
* @property _sFormData
* @private
* @static
* @type string
*/
_sFormData:null,
/**
* Collection of polling references to the polling mechanism in handleReadyState.
* @description Collection of polling references to the polling mechanism in handleReadyState.
* @property _poll
* @private
* @type string
* @static
* @type object
*/
_poll:[],
_poll:{},
/**
* Queue of timeout values for each transaction callback with a defined timeout value.
* @description Queue of timeout values for each transaction callback with a defined timeout value.
* @property _timeOut
* @private
* @type string
* @static
* @type object
*/
_timeOut:[],
_timeOut:{},
/**
* The polling frequency, in milliseconds, for HandleReadyState.
* @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,
/**
* A transaction counter that increments the transaction id for each transaction.
* @description A transaction counter that increments the transaction id for each transaction.
* @property _transaction_id
* @private
* @static
* @type int
*/
_transaction_id:0,
/**
* Member to add an ActiveX id to the existing xml_progid array.
* @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
* @param string id The ActiveX id to be added to initialize the XHR object.
* @static
* @param {string} id The ActiveX id to be added to initialize the XHR object.
* @return void
*/
setProgId:function(id)
@ -125,19 +167,23 @@ YAHOO.util.Connect =
},
/**
* Member to enable or disable the default POST header.
* @description Member to enable or disable the default POST header.
* @method setDefaultPostHeader
* @public
* @param boolean b Set and use default header - true or false .
* @static
* @param {boolean} b Set and use default header - true or false .
* @return void
*/
setDefaultPostHeader:function(b)
{
this._default_post_header = b;
this._use_default_post_header = b;
},
/**
* Member to modify the default polling interval.
* @description Member to modify the default polling interval.
* @method setPollingInterval
* @public
* @static
* @param {int} i The polling interval in milliseconds.
* @return void
*/
@ -149,11 +195,13 @@ YAHOO.util.Connect =
},
/**
* Instantiates a XMLHttpRequest object and returns an object with two properties:
* @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 connection object
* @return object
*/
createXhrObject:function(transactionId)
{
@ -172,7 +220,7 @@ YAHOO.util.Connect =
{
// Instantiates XMLHttpRequest for IE and assign to http.
http = new ActiveXObject(this._msxml_progid[i]);
// Object literal with http and tId properties
// Object literal with conn and tId properties
obj = { conn:http, tId:transactionId };
break;
}
@ -186,11 +234,13 @@ YAHOO.util.Connect =
},
/**
* This method is called by asyncRequest to create a
* @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
* @return object
* @static
* @return {object}
*/
getConnectionObject:function()
{
@ -212,11 +262,13 @@ YAHOO.util.Connect =
},
/**
* Method for initiating an asynchronous request via the XHR object.
* @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 User-defined callback function or object
* @param {callback} callback User-defined callback function or object
* @param {string} postData POST body
* @return {object} Returns the connection object
*/
@ -230,8 +282,9 @@ YAHOO.util.Connect =
else{
if(this._isFormSubmit){
if(this._isFileUpload){
this.uploadFile(o.tId, callback, uri);
this.uploadFile(o.tId, callback, uri, postData);
this.releaseObject(o);
return;
}
@ -239,93 +292,89 @@ YAHOO.util.Connect =
//encoded string that is concatenated to the uri to
//create a querystring.
if(method == '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{
uri += "?" + this._sFormData;
}
else if(method == 'POST'){
postData = this._sFormData;
}
this._sFormData = '';
else if(method == '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;
}
}
o.conn.open(method, uri, true);
if(this._isFormSubmit || (postData && this._default_post_header)){
this.initHeader('Content-Type','application/x-www-form-urlencoded');
if(this._isFormSubmit || (postData && this._use_default_post_header)){
this.initHeader('Content-Type', this._default_post_header);
if(this._isFormSubmit){
this._isFormSubmit = false;
this.resetFormState();
}
}
//Verify whether the transaction has any user-defined HTTP headers
//and set them.
if(this._has_http_headers){
this.setHeader(o);
}
this.handleReadyState(o, callback);
postData?o.conn.send(postData):o.conn.send(null);
o.conn.send(postData || null);
return o;
}
},
/**
* This method serves as a timer that polls the XHR object's readyState
* @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 User-defined callback object
* @return void
* @param {callback} callback The user-defined callback object
* @return {void}
*/
handleReadyState:function(o, callback)
{
var timeOut = callback.timeout;
var oConn = this;
try
{
if(timeOut !== undefined){
this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true) }, timeOut);
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){
window.clearInterval(oConn._poll[o.tId]);
oConn._poll.splice(o.tId);
if(timeOut){
oConn._timeOut.splice(o.tId);
delete oConn._poll[o.tId];
if(callback && callback.timeout){
delete oConn._timeOut[o.tId];
}
oConn.handleTransactionResponse(o, callback);
}
}
,this._polling_interval);
}
catch(e)
{
window.clearInterval(oConn._poll[o.tId]);
oConn._poll.splice(o.tId);
if(timeOut){
oConn._timeOut.splice(o.tId);
}
oConn.handleTransactionResponse(o, callback);
}
},
/**
* This method attempts to interpret the server response and
* @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 - User-defined callback object
* @param {boolean} determines if the transaction was aborted.
* @return void
* @param {object} callback The sser-defined callback object
* @param {boolean} isAbort Determines if the transaction was aborted.
* @return {void}
*/
handleTransactionResponse:function(o, callback, isAbort)
{
@ -354,6 +403,8 @@ YAHOO.util.Connect =
}
if(httpStatus >= 200 && httpStatus < 300){
try
{
responseObject = this.createResponseObject(o, callback.argument);
if(callback.success){
if(!callback.scope){
@ -366,20 +417,20 @@ YAHOO.util.Connect =
}
}
}
catch(e){}
}
else{
try
{
switch(httpStatus){
// The following case labels are wininet.dll error codes that may be encountered.
// Server timeout
case 12002:
// 12029 to 12031 correspond to dropped connections.
case 12029:
// 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:
// Connection closed by server.
case 12152:
// See above comments for variable status.
case 13030:
responseObject = this.createExceptionObject(o.tId, callback.argument, isAbort);
case 12152: // Connection closed by server.
case 13030: // See above comments for variable status.
responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));
if(callback.failure){
if(!callback.scope){
callback.failure(responseObject);
@ -401,18 +452,23 @@ YAHOO.util.Connect =
}
}
}
catch(e){}
}
this.releaseObject(o);
responseObject = null;
},
/**
* This method evaluates the server response, creates and returns the results via
* @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 User-defined argument or arguments to be passed to the callback
* @return object
* @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
* @return {object}
*/
createResponseObject:function(o, callbackArg)
{
@ -426,7 +482,7 @@ YAHOO.util.Connect =
for(var i=0; i<header.length; i++){
var delimitPos = header[i].indexOf(':');
if(delimitPos != -1){
headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+1);
headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+2);
}
}
}
@ -448,18 +504,20 @@ YAHOO.util.Connect =
},
/**
* If a transaction cannot be completed due to dropped or closed connections,
* @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
* @param {int} tId Transaction Id
* @param callbackArg The user-defined arguments
* @param isAbort Determines if the exception is an abort.
* @return object
* @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)
{
@ -488,11 +546,13 @@ YAHOO.util.Connect =
},
/**
* Public method that stores the custom HTTP headers for each transaction.
* @description Public method that stores the custom HTTP headers for each transaction.
* @method initHeader
* @public
* @static
* @param {string} label The HTTP header label
* @param {string} value The HTTP header value
* @return void
* @return {void}
*/
initHeader:function(label,value)
{
@ -500,6 +560,8 @@ YAHOO.util.Connect =
this._http_header[label] = value;
}
else{
// Concatenate multiple values, comma-delimited,
// for the same header label,
this._http_header[label] = value + "," + this._http_header[label];
}
@ -507,15 +569,17 @@ YAHOO.util.Connect =
},
/**
* Accessor that sets the HTTP headers for each transaction.
* @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
* @return {void}
*/
setHeader:function(o)
{
for(var prop in this._http_header){
if(this._http_header.propertyIsEnumerable){
if(this._http_header.hasOwnProperty(prop)){
o.conn.setRequestHeader(prop, this._http_header[prop]);
}
}
@ -526,28 +590,32 @@ YAHOO.util.Connect =
},
/**
* This method assembles the form label and value pairs and
* @description This method assembles the form label and value pairs and
* constructs an encoded string.
* asyncRequest() will automatically initialize the
* transaction with a HTTP header Content-Type of
* application/x-www-form-urlencoded.
* @method setForm
* @public
* @static
* @param {string || object} form id or name attribute, or form object.
* @param {string} optional boolean to indicate SSL environment.
* @param {string} optional qualified path of iframe resource for SSL in IE.
* @return void
* @param {string || boolean} optional qualified path of iframe resource for SSL in IE.
* @return {string} string of the HTML form field name and value pairs..
*/
setForm:function(formId, isUpload, secureUri)
{
this._sFormData = '';
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 by supported
// here for legacy reasons.
var oForm = (document.getElementById(formId) || document.forms[formId]);
oForm = (document.getElementById(formId) || document.forms[formId]);
}
else if(typeof formId == 'object'){
var oForm = formId;
// Treat argument as an HTML form object.
oForm = formId;
}
else{
return;
@ -560,7 +628,11 @@ YAHOO.util.Connect =
// where the secureURI string is a fully qualified HTTP path, used to set the source
// of the iframe, to a stub resource in the same domain.
if(isUpload){
(typeof secureUri == 'string')?this.createFrame(secureUri):this.createFrame();
// Create iframe in preparation for file upload.
this.createFrame(secureUri?secureUri:null);
// Set form reference and file upload properties to true.
this._isFormSubmit = true;
this._isFileUpload = true;
this._formNode = oForm;
@ -574,11 +646,8 @@ YAHOO.util.Connect =
// Iterate over the form elements collection to construct the
// label-value pairs.
for (var i=0; i<oForm.elements.length; i++){
oDisabled = oForm.elements[i].disabled;
// If the name attribute is not populated, the form field's
// value will not be submitted.
oElement = oForm.elements[i];
oDisabled = oForm.elements[i].disabled;
oName = oForm.elements[i].name;
oValue = oForm.elements[i].value;
@ -592,7 +661,13 @@ YAHOO.util.Connect =
case 'select-multiple':
for(var j=0; j<oElement.options.length; j++){
if(oElement.options[j].selected){
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].value || oElement.options[j].text) + '&';
if(window.ActiveXObject){
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text) + '&';
}
else{
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';
}
}
}
break;
@ -626,32 +701,57 @@ YAHOO.util.Connect =
this._isFormSubmit = true;
this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
return this._sFormData;
},
/**
* Creates an iframe to be used for form file uploads. It is remove from the
* document upon completion of the upload transaction.
*
* @description Resets HTML form properties when an HTML form or HTML form
* with file upload transaction is sent.
* @method resetFormState
* @private
* @param {string} optional qualified path of iframe resource for SSL in IE.
* @return void
* @static
* @return {void}
*/
resetFormState:function(){
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} secureUri Optional qualified path of iframe resource for SSL in IE.
* @return {void}
*/
createFrame:function(secureUri){
// IE does not allow the setting of id and name attributes as DOM
// properties. A different iframe creation pattern is required for IE.
// 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;
if(window.ActiveXObject){
var io = document.createElement('<IFRAME name="ioFrame" id="ioFrame">');
if(secureUri){
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
// IE will throw a security exception in an SSL environment if the
// iframe source isn't set to a valid resource.
// iframe source is undefined.
if(typeof secureUri == 'boolean'){
io.src = 'javascript:false';
}
else if(typeof secureURI == 'string'){
// Deprecated
io.src = secureUri;
}
}
else{
var io = document.createElement('IFRAME');
io.id = 'ioFrame';
io.name = 'ioFrame';
var io = document.createElement('iframe');
io.id = frameId;
io.name = frameId;
}
io.style.position = 'absolute';
@ -662,28 +762,83 @@ YAHOO.util.Connect =
},
/**
* Uploads HTML form, including files/attachments, targeting the
* iframe created in createFrame.
*
* @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 = new Array();
var postMessage = postData.split('&');
for(var i=0; i < postMessage.length; i++){
var 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);
this._formNode.appendChild(formElements[i]);
}
}
return formElements;
},
/**
* @description Uploads HTML form, including files/attachments, to the
* iframe created in createFrame.
* @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.
* @return void
* @return {void}
*/
uploadFile:function(id, callback, uri){
uploadFile:function(id, callback, uri, postData){
// Each iframe has an id prefix of "yuiIO" followed
// by the unique transaction id.
var frameId = 'yuiIO' + id;
var io = document.getElementById(frameId);
// Initialize the HTML form properties in case they are
// not defined in the HTML form.
this._formNode.action = uri;
this._formNode.enctype = 'multipart/form-data';
this._formNode.method = 'POST';
this._formNode.target = 'ioFrame';
this._formNode.target = frameId;
if(this._formNode.encoding){
// IE does not respect property enctype for HTML forms.
// Instead use property encoding.
this._formNode.encoding = 'multipart/form-data';
}
else{
this._formNode.enctype = 'multipart/form-data';
}
if(postData){
var oElements = this.appendPostData(postData);
}
this._formNode.submit();
// Reset form status properties.
this._formNode = null;
this._isFileUpload = false;
this._isFormSubmit = false;
if(oElements && oElements.length > 0){
try
{
for(var i=0; i < oElements.length; i++){
this._formNode.removeChild(oElements[i]);
}
}
catch(e){}
}
// Reset HTML form status properties.
this.resetFormState();
// Create the upload callback handler that fires when the iframe
// receives the load event. Subsequently, the event handler is detached
@ -691,46 +846,71 @@ YAHOO.util.Connect =
var uploadCallback = function()
{
var oResponse =
{
tId: id,
responseText: document.getElementById("ioFrame").contentWindow.document.body.innerHTML,
argument: callback.argument
}
var obj = {};
obj.tId = id;
obj.argument = callback.argument;
if(callback.upload && !callback.scope){
callback.upload(oResponse);
try
{
obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}
catch(e){}
if(callback.upload){
if(!callback.scope){
callback.upload(obj);
}
else{
callback.upload.apply(callback.scope, [oResponse]);
callback.upload.apply(callback.scope, [obj]);
}
}
YAHOO.util.Event.removeListener("ioFrame", "load", uploadCallback);
window.ioFrame.location.replace('#');
setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);
if(YAHOO.util.Event){
YAHOO.util.Event.removeListener(io, "load", uploadCallback);
}
else if(window.detachEvent){
io.detachEvent('onload', uploadCallback);
}
else{
io.removeEventListener('load', uploadCallback, false);
}
setTimeout(function(){ document.body.removeChild(io); }, 100);
};
// Bind the onload handler to the iframe to detect the file upload response.
YAHOO.util.Event.addListener("ioFrame", "load", uploadCallback);
if(YAHOO.util.Event){
YAHOO.util.Event.addListener(io, "load", uploadCallback);
}
else if(window.attachEvent){
io.attachEvent('onload', uploadCallback);
}
else{
io.addEventListener('load', uploadCallback, false);
}
},
/**
* Public method to terminate a transaction, if it has not reached readyState 4.
* @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 was a timeout.
* @return void
* @return {boolean}
*/
abort:function(o, callback, isTimeout)
{
if(this.isCallInProgress(o)){
window.clearInterval(this._poll[o.tId]);
this._poll.splice(o.tId);
if(isTimeout){
this._timeOut.splice(o.tId);
}
o.conn.abort();
window.clearInterval(this._poll[o.tId]);
delete this._poll[o.tId];
if(isTimeout){
delete this._timeOut[o.tId];
}
this.handleTransactionResponse(o, callback, true);
return true;
@ -742,9 +922,12 @@ YAHOO.util.Connect =
/**
* Public method to check if the transaction is still being processed.
*
* @method isCallInProgress
* @public
* @static
* @param {object} o The connection object returned by asyncRequest
* @return boolean
* @return {boolean}
*/
isCallInProgress:function(o)
{
@ -760,10 +943,12 @@ YAHOO.util.Connect =
},
/**
* Dereference the XHR instance and the connection object after the transaction is completed.
* @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
* @return {void}
*/
releaseObject:function(o)
{

View file

@ -1,30 +1,115 @@
Container Release Notes
*** version 0.12.0 ***
All Classes
- New documentation format implemented, and removed unnecessary
prototype null references previously used for generating
documentation
- Modified the
Config
- Added 'undefined' check when reading initial properties for
.reset()
- Fixed Firefox warning on .resetProperty()
- Fixed issue preventing resetProperty() from resetting values
correctly
Module
- Removed unused "childNodesInDom" property
Overlay
- Converted center() to use Dom utility
- Fixed configVisible() to properly detect actual visible/hidden
status in Internet Explorer, which reports "inherit" for all elements
by default.
- Updated onDomResize to properly reapply "context" property
- Unified scroll/resize handlers so that they fire properly (when the
event has completed) as opposed to constantly (as seen in Mozilla-
based browsers)
Panel
- Modified modality mask to show before Panel is shown (prior to any
animation)
- Modified buildWrapper to eliminate cloning of the initial markup
module, which fixes issues with select options not maintaining their
default selections in IE
- Modality mask is now z-indexed properly so that the mask z-index is
always one less than the Panel z-index
Dialog
- Fixed Connection to get "action" attribute using getAttribute, to
allow for form fields named "action"
- Added support for "GET" by retrieving the form "method" rather than
always defaulting to "POST"
KeyListener
- Fixed to work properly with Safari 2.0 by matching against keyCode
or charCode
*** version 0.11.4 ***
- Panel: Modality mask is now properly removed from DOM on Panel
destroy.
*** version 0.11.3 ***
- Module: Fixed SSL warning issue in IE
- Overlay: Fixed memory leak related to iframe shim in IE
- Panel: No focusable elements under the mask can now be tabbed to
- Panel: Set Panel container overflow to hidden to fix scrolling issue
in Opera 9
*** version 0.11.2 ***
- All: JsLint optimization
- Overlay: Fixed SSL issues with monitorresize property
- OverlayManager: Fixed z-index incrementing issues
- Dialog: Form elements called "name" will now function properly
- Dialog: Removed unnecessary scope:this reference
*** version 0.11.1 ***
- Tooltip: Removed incorrect logger statement
- Dialog: Corrected logic that was causing browser lockup in IE for
SimpleDialog
- Dialog: Fixed "firstButtom" typo
*** version 0.11.0 ***
- toString function added to all classes for easy logging
- YAHOO.extend is now being used for inheritance on all container classes
- YAHOO.extend is now being used for inheritance on all container
classes
- Module: monitorresize feature now works on all browsers
- Module: Fixed bug with image root and isSecure
- Overlay: Fixed bugs related to IFRAME shim positioning
- Overlay: center() now works in quirks mode
- Overlay: Overlay now has a custom destroy() method that also removes the IFRAME shim
- OverlayManager: Fixed bug in the prototype that was preventing multiple Managers on one page
- Overlay: Overlay now has a custom destroy() method that also removes
the IFRAME shim
- OverlayManager: Fixed bug in the prototype that was preventing
multiple Managers on one page
- OverlayManager: focusEvent now fires at all appropriate times
- Tooltip: context can now be specified as an array, so Tooltips can be reused across multiple context elements
- Tooltip: preventoverlap now functions properly for large context elements (i.e, images)
- Tooltip: context can now be specified as an array, so Tooltips can be
reused across multiple context elements
- Tooltip: preventoverlap now functions properly for large context
elements (i.e, images)
- Tooltip: fixed bugs regarding setTimeout
- Tooltip: added mousemove event to allow for more accurate Tooltip positioning
- Panel: added dragEvent for monitoring all event handlers for drag and drop
- Tooltip: added mousemove event to allow for more accurate Tooltip
positioning
- Panel: added dragEvent for monitoring all event handlers for drag and
drop
- Panel: modality mask is now resized on scroll
- Panel: KeyListeners are now properly destroyed when the Panel is destroyed
- Panel: KeyListeners are now properly destroyed when the Panel is
destroyed
- Panel: Header is now sized properly in quirks mode
- Dialog: Blinking cursor issue is fixed for Firefox
- Dialog: callback object for Connection is now public (this.callback)
- Dialog: onsuccess/onfailure properties removed (as a result of the public callback object)
- Dialog: onsuccess/onfailure properties removed (as a result of the
public callback object)
- Dialog: Dialog is now invisible by default
- Dialog: Buttons are now properly cleaned up on destroy
*** version 0.10.0 ***
* Initial release

View file

@ -97,6 +97,7 @@ Version 0.11.0
-moz-opacity: 0.7;
opacity:.70;
filter:alpha(opacity=70);
zoom:1;
}
.panel {
@ -108,7 +109,7 @@ Version 0.11.0
background-color:#FFF;
border:1px solid #000;
z-index:1;
overflow:auto;
overflow:hidden;
}
.panel .hd {

File diff suppressed because it is too large Load diff

View file

@ -1,49 +1,25 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
*/
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}}
YAHOO.util.Config.prototype={owner:null,configChangedEvent:null,queueInProgress:false,addProperty:function(key,propertyObject){},getConfig:function(){},getProperty:function(key){},resetProperty:function(key){},setProperty:function(key,value,silent){},queueProperty:function(key,value){},refireEvent:function(key){},applyConfig:function(userConfig,init){},refresh:function(){},fireQueue:function(){},subscribeToConfigEvent:function(key,handler,obj,override){},unsubscribeFromConfigEvent:function(key,handler,obj){},checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}}
YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}}
this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}}
this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop]
if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
return cfg;}
this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}}
this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){this.setProperty(key,initialConfig[key].value);}else{return undefined;}}
this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
return true;}}else{return false;}}}
this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}
return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}
if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}
return true;}else{return false;}}
this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}}
this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}}
this.refresh=function(){for(var prop in config){this.refireEvent(prop);}}
this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
this.queueInProgress=false;eventQueue=new Array();}
this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
return true;}else{return false;}}
this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}}
this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
return output;}
this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
return output;}}
YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;break;}}
return false;}
YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}}
YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL=null;YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,childNodesInDOM:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,beforeInitEvent:null,initEvent:null,appendEvent:null,beforeRenderEvent:null,renderEvent:null,changeHeaderEvent:null,changeBodyEvent:null,changeFooterEvent:null,changeContentEvent:null,destroyEvent:null,beforeShowEvent:null,showEvent:null,beforeHideEvent:null,hideEvent:null,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")==0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}
return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}
if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}
this.element=el;if(el.id){this.id=el.id;}
var childNodes=this.element.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}
this.initDefaultConfig();YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&this.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=this.RESIZE_MONITOR_SECURE_URL;}
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;}
resizeMonitor.id="_yuiResizeMonitor";resizeMonitor.style.visibility="hidden";document.body.appendChild(resizeMonitor);resizeMonitor.style.width="10em";resizeMonitor.style.height="10em";resizeMonitor.style.position="absolute";var nLeft=-1*resizeMonitor.offsetWidth,nTop=-1*resizeMonitor.offsetHeight;resizeMonitor.style.top=nTop+"px";resizeMonitor.style.left=nLeft+"px";resizeMonitor.style.borderStyle="none";resizeMonitor.style.borderWidth="0";YAHOO.util.Dom.setStyle(resizeMonitor,"opacity","0");resizeMonitor.style.visibility="visible";if(!bIE){var doc=resizeMonitor.contentWindow.document;doc.open();doc.close();}}
if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",this.onDomResize,this,true);}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}
if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}
@ -57,236 +33,115 @@ if(typeof footerContent=="string"){this.footer.innerHTML=footerContent;}else{thi
this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){if(!this.footer){this.footer=document.createElement("DIV");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}
this.footer.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
var me=this;var appendTo=function(element){if(typeof element=="string"){element=document.getElementById(element);}
if(element){element.appendChild(me.element);me.appendEvent.fire();}}
if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
if(element){element.appendChild(me.element);me.appendEvent.fire();}};if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
if(this.header&&!YAHOO.util.Dom.inDocument(this.header)){var firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
if(this.body&&!YAHOO.util.Dom.inDocument(this.body)){if(this.footer&&YAHOO.util.Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
this.renderEvent.fire();return true;},destroy:function(){if(this.element){var parent=this.element.parentNode;}
if(parent){parent.removeChild(this.element);}
this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}}
YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;}
YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);}
YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="promo/m/irs/blank.gif";YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.beforeMoveEvent=null;YAHOO.widget.Overlay.prototype.moveEvent=null;YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;"
YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
this.initEvent.fire(YAHOO.widget.Overlay);}
YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);}
YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});}
YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);}
YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");}
YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");}
YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");var effect=this.cfg.getProperty("effect");var effectInstances=new Array();if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
this.initEvent.fire(YAHOO.widget.Overlay);};YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);};YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});};YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);};YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");};YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");};YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");if(currentVis=="inherit"){var e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=YAHOO.util.Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}
e=e.parentNode;}
if(currentVis=="inherit"){currentVis="visible";}}
var effect=this.cfg.getProperty("effect");var effectInstances=[];if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
var isMacGecko=(this.platform=="mac"&&this.browser=="gecko");if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
if(effect){if(visible){if(currentVis!="visible"){this.beforeShowEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
e.animateIn();}}}}else{if(currentVis!="visible"){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
if(effect){if(currentVis!="hidden"){this.beforeHideEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
e.animateOut();}}}else{if(currentVis!="hidden"){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}}
YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}}
YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}
if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();for(var j=0;j<effectInstances.length;j++){var ei=effectInstances[j];if(j===0&&!YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();for(var k=0;k<effectInstances.length;k++){var h=effectInstances[k];if(k===0&&!YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
h.animateOut();}}else if(currentVis===""){YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}};YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}};YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}}
YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");}
YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");}
YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}};YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
if(this.iframe){if(zIndex<=0){zIndex=1;}
YAHOO.util.Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);}
YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];var el=this.element;var showIframe=function(){if(this.iframe){this.iframe.style.display="block";}}
var hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}}
if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,showIframe,this)){this.showEvent.subscribe(showIframe,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,hideIframe,this)){this.hideEvent.subscribe(hideIframe,this,true);}
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);};YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.showIframe=function(){if(this.iframe){this.iframe.style.display="block";}};YAHOO.widget.Overlay.prototype.hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}};YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showIframe,this)){this.showEvent.subscribe(this.showIframe,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}
var x=this.cfg.getProperty("x");var y=this.cfg.getProperty("y");if(!x||!y){this.syncPosition();x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");}
if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=this.imageRoot+YAHOO.widget.Overlay.IFRAME_SRC;}
var parent=el.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){showIframe.call(this);}else{hideIframe.call(this);}}
var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){this.showIframe();}else{this.hideIframe();}}
var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}
YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=el.clientWidth;var height=el.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}
this.showEvent.unsubscribe(showIframe,this);this.hideEvent.unsubscribe(hideIframe,this);}}
YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}}
YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}}
YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}
YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=this.element.clientWidth;var height=this.element.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}
this.showEvent.unsubscribe(this.showIframe,this);this.hideEvent.unsubscribe(this.hideIframe,this);}};YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}};YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}};YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}
if(!contextAlign){contextAlign=contextArgs[2];}
if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}}
switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}}
YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var width=parseInt(this.cfg.getProperty("width"));if(isNaN(width)){width=0;}
var offsetHeight=this.element.offsetHeight;var offsetWidth=(width>0?width:this.element.offsetWidth);var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}};switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}};YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var offsetHeight=this.element.offsetHeight;var offsetWidth=this.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);}
YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.element.style.left=parseInt(x)+"px";this.element.style.top=parseInt(y)+"px";this.syncPosition();this.cfg.refireEvent("iframe");}
YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);}
YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);this.cfg.refireEvent("iframe");}
YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;}
YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){YAHOO.widget.Overlay.windowScrollEvent.fire();}
YAHOO.widget.Overlay.windowResizeHandler=function(e){YAHOO.widget.Overlay.windowResizeEvent.fire();}
YAHOO.widget.Overlay._initialized==null;if(YAHOO.widget.Overlay._initialized==null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);}
YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},getActive:function(){},focus:function(overlay){},remove:function(overlay){},blurAll:function(){},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;}
this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex)+1));}
this.overlays.sort(this.compareZIndexDesc);}}
this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,this.overlays.length-1);o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null
o.blurEvent=null;o.focus=null;o.blur=null;}}
this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}}
var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=new Array();}
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();}
overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();}
var focusOnDomEvent=function(e,obj){overlay.focus();}
var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex));}else{overlay.cfg.setProperty("zIndex",0);}
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);};YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);};YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}
clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){YAHOO.widget.Overlay.windowScrollEvent.fire();},1);}else{YAHOO.widget.Overlay.windowScrollEvent.fire();}};YAHOO.widget.Overlay.windowResizeHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.resizeEnd){window.resizeEnd=-1;}
clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){YAHOO.widget.Overlay.windowResizeEvent.fire();},100);}else{YAHOO.widget.Overlay.windowResizeEvent.fire();}};YAHOO.widget.Overlay._initialized=null;if(YAHOO.widget.Overlay._initialized===null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex,10)+2));}
this.overlays.sort(this.compareZIndexDesc);}};this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,this.overlays.length-1);o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();};overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();};var focusOnDomEvent=function(e,obj){overlay.focus();};var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
this.overlays.push(overlay);return true;}else if(overlay instanceof Array){var regcount=0;for(var i=0;i<overlay.length;i++){if(this.register(overlay[i])){regcount++;}}
if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o].id==overlay){return this.overlays[o];}}}
return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}}
YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var p=0;p<this.overlays.length;p++){if(this.overlays[p].id==overlay){return this.overlays[p];}}}
return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
function handleKeyPress(e,obj){var keyPressed=e.charCode||e.keyCode;if(!keyData.shift)keyData.shift=false;if(!keyData.alt)keyData.alt=false;if(!keyData.ctrl)keyData.ctrl=false;if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){if(keyPressed==keyData.keys[i]){keyEvent.fire(keyPressed,e);break;}}}else{if(keyPressed==keyData.keys){keyEvent.fire(keyPressed,e);}}}}
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
if(!keyData.alt){keyData.alt=false;}
if(!keyData.ctrl){keyData.ctrl=false;}
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,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);}}}}
this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
this.enabled=true;}
this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;}
this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");}}
YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.prototype.enabled=null;YAHOO.util.KeyListener.prototype.enable=function(){};YAHOO.util.KeyListener.prototype.disable=function(){};YAHOO.util.KeyListener.prototype.enabledEvent=null;YAHOO.util.KeyListener.prototype.disabledEvent=null;YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);}
YAHOO.extend(YAHOO.widget.Tooltip,YAHOO.widget.Overlay);YAHOO.widget.Tooltip.CSS_TOOLTIP="tt";YAHOO.widget.Tooltip.prototype.init=function(el,userConfig){if(document.readyState&&document.readyState!="complete"){var deferredInit=function(){this.init(el,userConfig);}
YAHOO.util.Event.addListener(window,"load",deferredInit,this,true);}else{YAHOO.widget.Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Tooltip);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.render(this.cfg.getProperty("container"));this.initEvent.fire(YAHOO.widget.Tooltip);}}
YAHOO.widget.Tooltip.prototype.initDefaultConfig=function(){YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty("preventoverlap",{value:true,validator:this.cfg.checkBoolean,supercedes:["x","y","xy"]});this.cfg.addProperty("showdelay",{value:200,handler:this.configShowDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("autodismissdelay",{value:5000,handler:this.configAutoDismissDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("hidedelay",{value:250,handler:this.configHideDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("text",{handler:this.configText,suppressEvent:true});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});}
YAHOO.widget.Tooltip.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);}}
YAHOO.widget.Tooltip.prototype.configContainer=function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",document.getElementById(container),true);}}
YAHOO.widget.Tooltip.prototype.configContext=function(type,args,obj){var context=args[0];if(context){if(!(context instanceof Array)){if(typeof context=="string"){this.cfg.setProperty("context",[document.getElementById(context)],true);}else{this.cfg.setProperty("context",[context],true);}
this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Tooltip,YAHOO.widget.Overlay);YAHOO.widget.Tooltip.CSS_TOOLTIP="tt";YAHOO.widget.Tooltip.prototype.init=function(el,userConfig){if(document.readyState&&document.readyState!="complete"){var deferredInit=function(){this.init(el,userConfig);};YAHOO.util.Event.addListener(window,"load",deferredInit,this,true);}else{YAHOO.widget.Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Tooltip);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.render(this.cfg.getProperty("container"));this.initEvent.fire(YAHOO.widget.Tooltip);}};YAHOO.widget.Tooltip.prototype.initDefaultConfig=function(){YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty("preventoverlap",{value:true,validator:this.cfg.checkBoolean,supercedes:["x","y","xy"]});this.cfg.addProperty("showdelay",{value:200,handler:this.configShowDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("autodismissdelay",{value:5000,handler:this.configAutoDismissDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("hidedelay",{value:250,handler:this.configHideDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("text",{handler:this.configText,suppressEvent:true});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});};YAHOO.widget.Tooltip.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);}};YAHOO.widget.Tooltip.prototype.configContainer=function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",document.getElementById(container),true);}};YAHOO.widget.Tooltip.prototype.configContext=function(type,args,obj){var context=args[0];if(context){if(!(context instanceof Array)){if(typeof context=="string"){this.cfg.setProperty("context",[document.getElementById(context)],true);}else{this.cfg.setProperty("context",[context],true);}
context=this.cfg.getProperty("context");}
if(this._context){for(var c=0;c<this._context.length;++c){var el=this._context[c];YAHOO.util.Event.removeListener(el,"mouseover",this.onContextMouseOver);YAHOO.util.Event.removeListener(el,"mousemove",this.onContextMouseMove);YAHOO.util.Event.removeListener(el,"mouseout",this.onContextMouseOut);}}
this._context=context;for(var c=0;c<this._context.length;++c){var el=this._context[c];YAHOO.util.Event.addListener(el,"mouseover",this.onContextMouseOver,this);YAHOO.util.Event.addListener(el,"mousemove",this.onContextMouseMove,this);YAHOO.util.Event.addListener(el,"mouseout",this.onContextMouseOut,this);}}}
YAHOO.widget.Tooltip.prototype.onContextMouseMove=function(e,obj){obj.pageX=YAHOO.util.Event.getPageX(e);obj.pageY=YAHOO.util.Event.getPageY(e);}
YAHOO.widget.Tooltip.prototype.onContextMouseOver=function(e,obj){if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
this._context=context;for(var d=0;d<this._context.length;++d){var el2=this._context[d];YAHOO.util.Event.addListener(el2,"mouseover",this.onContextMouseOver,this);YAHOO.util.Event.addListener(el2,"mousemove",this.onContextMouseMove,this);YAHOO.util.Event.addListener(el2,"mouseout",this.onContextMouseOut,this);}}};YAHOO.widget.Tooltip.prototype.onContextMouseMove=function(e,obj){obj.pageX=YAHOO.util.Event.getPageX(e);obj.pageY=YAHOO.util.Event.getPageY(e);};YAHOO.widget.Tooltip.prototype.onContextMouseOver=function(e,obj){if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
var context=this;YAHOO.util.Event.addListener(context,"mousemove",obj.onContextMouseMove,obj);if(context.title){obj._tempTitle=context.title;context.title="";}
obj.showProcId=obj.doShow(e,context);}
YAHOO.widget.Tooltip.prototype.onContextMouseOut=function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}
obj.showProcId=obj.doShow(e,context);};YAHOO.widget.Tooltip.prototype.onContextMouseOut=function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}
if(obj.showProcId){clearTimeout(obj.showProcId);obj.showProcId=null;}
if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));}
YAHOO.widget.Tooltip.prototype.doShow=function(e,context){var yOffset=25;if(this.browser=="opera"&&context.tagName=="A"){yOffset+=12;}
obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));};YAHOO.widget.Tooltip.prototype.doShow=function(e,context){var yOffset=25;if(this.browser=="opera"&&context.tagName=="A"){yOffset+=12;}
var me=this;return setTimeout(function(){if(me._tempTitle){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}
me.moveTo(me.pageX,me.pageY+yOffset);if(me.cfg.getProperty("preventoverlap")){me.preventOverlap(me.pageX,me.pageY);}
YAHOO.util.Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));}
YAHOO.widget.Tooltip.prototype.doHide=function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));}
YAHOO.widget.Tooltip.prototype.preventOverlap=function(pageX,pageY){var height=this.element.offsetHeight;var elementRegion=YAHOO.util.Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;var mousePoint=new YAHOO.util.Point(pageX,pageY);if(elementRegion.contains(mousePoint)){this.logger.log("OVERLAP","warn");this.cfg.setProperty("y",(pageY-height-5))}}
YAHOO.widget.Tooltip.prototype.toString=function(){return"Tooltip "+this.id;}
YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);}
YAHOO.extend(YAHOO.widget.Panel,YAHOO.widget.Overlay);YAHOO.widget.Panel.CSS_PANEL="panel";YAHOO.widget.Panel.CSS_PANEL_CONTAINER="panel-container";YAHOO.widget.Panel.prototype.showMaskEvent=null;YAHOO.widget.Panel.prototype.hideMaskEvent=null;YAHOO.widget.Panel.prototype.init=function(el,userConfig){YAHOO.widget.Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Panel);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader("&nbsp;");}}},this,true);this.initEvent.fire(YAHOO.widget.Panel);}
YAHOO.widget.Panel.prototype.initEvents=function(){YAHOO.widget.Panel.superclass.initEvents.call(this);this.showMaskEvent=new YAHOO.util.CustomEvent("showMask");this.hideMaskEvent=new YAHOO.util.CustomEvent("hideMask");this.dragEvent=new YAHOO.util.CustomEvent("drag");}
YAHOO.widget.Panel.prototype.initDefaultConfig=function(){YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty("close",{value:true,handler:this.configClose,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("draggable",{value:true,handler:this.configDraggable,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("underlay",{value:"shadow",handler:this.configUnderlay,supercedes:["visible"]});this.cfg.addProperty("modal",{value:false,handler:this.configModal,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("keylisteners",{handler:this.configKeyListeners,suppressEvent:true,supercedes:["visible"]});}
YAHOO.widget.Panel.prototype.configClose=function(type,args,obj){var val=args[0];var doHide=function(e,obj){obj.hide();}
if(val){if(!this.close){this.close=document.createElement("DIV");YAHOO.util.Dom.addClass(this.close,"close");if(this.isSecure){YAHOO.util.Dom.addClass(this.close,"secure");}else{YAHOO.util.Dom.addClass(this.close,"nonsecure");}
this.close.innerHTML="&nbsp;";this.innerElement.appendChild(this.close);YAHOO.util.Event.addListener(this.close,"click",doHide,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}}
YAHOO.widget.Panel.prototype.configDraggable=function(type,args,obj){var val=args[0];if(val){if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}}else{if(this.dd){this.dd.unreg();}
if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","auto");}}}
YAHOO.widget.Panel.prototype.configUnderlay=function(type,args,obj){var val=args[0];switch(val.toLowerCase()){case"shadow":YAHOO.util.Dom.removeClass(this.element,"matte");YAHOO.util.Dom.addClass(this.element,"shadow");if(!this.underlay){this.underlay=document.createElement("DIV");this.underlay.className="underlay";this.underlay.innerHTML="&nbsp;";this.element.appendChild(this.underlay);}
this.sizeUnderlay();break;case"matte":YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.addClass(this.element,"matte");break;case"none":default:YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.removeClass(this.element,"matte");break;}}
YAHOO.widget.Panel.prototype.configModal=function(type,args,obj){var modal=args[0];if(modal){this.buildMask();if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMask,this)){this.showEvent.subscribe(this.showMask,this,true);}
YAHOO.util.Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));};YAHOO.widget.Tooltip.prototype.doHide=function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));};YAHOO.widget.Tooltip.prototype.preventOverlap=function(pageX,pageY){var height=this.element.offsetHeight;var elementRegion=YAHOO.util.Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;var mousePoint=new YAHOO.util.Point(pageX,pageY);if(elementRegion.contains(mousePoint)){this.cfg.setProperty("y",(pageY-height-5));}};YAHOO.widget.Tooltip.prototype.toString=function(){return"Tooltip "+this.id;};YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Panel,YAHOO.widget.Overlay);YAHOO.widget.Panel.CSS_PANEL="panel";YAHOO.widget.Panel.CSS_PANEL_CONTAINER="panel-container";YAHOO.widget.Panel.prototype.init=function(el,userConfig){YAHOO.widget.Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Panel);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader("&nbsp;");}}},this,true);var me=this;this.showMaskEvent.subscribe(function(){var checkFocusable=function(el){if(el.tagName=="A"||el.tagName=="BUTTON"||el.tagName=="SELECT"||el.tagName=="INPUT"||el.tagName=="TEXTAREA"||el.tagName=="FORM"){if(!YAHOO.util.Dom.isAncestor(me.element,el)){YAHOO.util.Event.addListener(el,"focus",el.blur);return true;}}else{return false;}};this.focusableElements=YAHOO.util.Dom.getElementsBy(checkFocusable);},this,true);this.hideMaskEvent.subscribe(function(){for(var i=0;i<this.focusableElements.length;i++){var el2=this.focusableElements[i];YAHOO.util.Event.removeListener(el2,"focus",el2.blur);}},this,true);this.beforeShowEvent.subscribe(function(){this.cfg.refireEvent("underlay");},this,true);this.initEvent.fire(YAHOO.widget.Panel);};YAHOO.widget.Panel.prototype.initEvents=function(){YAHOO.widget.Panel.superclass.initEvents.call(this);this.showMaskEvent=new YAHOO.util.CustomEvent("showMask");this.hideMaskEvent=new YAHOO.util.CustomEvent("hideMask");this.dragEvent=new YAHOO.util.CustomEvent("drag");};YAHOO.widget.Panel.prototype.initDefaultConfig=function(){YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty("close",{value:true,handler:this.configClose,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("draggable",{value:true,handler:this.configDraggable,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("underlay",{value:"shadow",handler:this.configUnderlay,supercedes:["visible"]});this.cfg.addProperty("modal",{value:false,handler:this.configModal,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("keylisteners",{handler:this.configKeyListeners,suppressEvent:true,supercedes:["visible"]});};YAHOO.widget.Panel.prototype.configClose=function(type,args,obj){var val=args[0];var doHide=function(e,obj){obj.hide();};if(val){if(!this.close){this.close=document.createElement("DIV");YAHOO.util.Dom.addClass(this.close,"close");if(this.isSecure){YAHOO.util.Dom.addClass(this.close,"secure");}else{YAHOO.util.Dom.addClass(this.close,"nonsecure");}
this.close.innerHTML="&nbsp;";this.innerElement.appendChild(this.close);YAHOO.util.Event.addListener(this.close,"click",doHide,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}};YAHOO.widget.Panel.prototype.configDraggable=function(type,args,obj){var val=args[0];if(val){if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}}else{if(this.dd){this.dd.unreg();}
if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","auto");}}};YAHOO.widget.Panel.prototype.configUnderlay=function(type,args,obj){var val=args[0];switch(val.toLowerCase()){case"shadow":YAHOO.util.Dom.removeClass(this.element,"matte");YAHOO.util.Dom.addClass(this.element,"shadow");if(!this.underlay){this.underlay=document.createElement("DIV");this.underlay.className="underlay";this.underlay.innerHTML="&nbsp;";this.element.appendChild(this.underlay);}
this.sizeUnderlay();break;case"matte":YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.addClass(this.element,"matte");break;default:YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.removeClass(this.element,"matte");break;}};YAHOO.widget.Panel.prototype.configModal=function(type,args,obj){var modal=args[0];if(modal){this.buildMask();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.showMask,this)){this.beforeShowEvent.subscribe(this.showMask,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMask,this)){this.hideEvent.subscribe(this.hideMask,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.sizeMask,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.sizeMask,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.sizeMask,this,true);}}else{this.beforeShowEvent.unsubscribe(this.showMask,this);this.hideEvent.unsubscribe(this.hideMask,this);YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.sizeMask);}}
YAHOO.widget.Panel.prototype.configKeyListeners=function(type,args,obj){var listeners=args[0];if(listeners){if(listeners instanceof Array){for(var i=0;i<listeners.length;i++){var listener=listeners[i];if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.destroyEvent,this.removeMask,this)){this.destroyEvent.subscribe(this.removeMask,this,true);}
this.cfg.refireEvent("zIndex");}else{this.beforeShowEvent.unsubscribe(this.showMask,this);this.hideEvent.unsubscribe(this.hideMask,this);YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this.destroyEvent.unsubscribe(this.removeMask,this);}};YAHOO.widget.Panel.prototype.removeMask=function(){if(this.mask){if(this.mask.parentNode){this.mask.parentNode.removeChild(this.mask);}
this.mask=null;}};YAHOO.widget.Panel.prototype.configKeyListeners=function(type,args,obj){var listeners=args[0];if(listeners){if(listeners instanceof Array){for(var i=0;i<listeners.length;i++){var listener=listeners[i];if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listener.disable,listener)){this.hideEvent.subscribe(listener.disable,listener,true);this.destroyEvent.subscribe(listener.disable,listener,true);}}}else{if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listeners.enable,listeners)){this.showEvent.subscribe(listeners.enable,listeners,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}}
YAHOO.widget.Panel.prototype.buildWrapper=function(){var elementParent=this.element.parentNode;var elementClone=this.element.cloneNode(true);this.innerElement=elementClone;this.innerElement.style.visibility="inherit";YAHOO.util.Dom.addClass(this.innerElement,YAHOO.widget.Panel.CSS_PANEL);var wrapper=document.createElement("DIV");wrapper.className=YAHOO.widget.Panel.CSS_PANEL_CONTAINER;wrapper.id=elementClone.id+"_c";wrapper.appendChild(elementClone);if(elementParent){elementParent.replaceChild(wrapper,this.element);}
this.element=wrapper;var childNodes=this.innerElement.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}
this.initDefaultConfig();}
YAHOO.widget.Panel.prototype.sizeUnderlay=function(){if(this.underlay&&this.browser!="gecko"&&this.browser!="safari"){this.underlay.style.width=this.innerElement.offsetWidth+"px";this.underlay.style.height=this.innerElement.offsetHeight+"px";}}
YAHOO.widget.Panel.prototype.onDomResize=function(e,obj){YAHOO.widget.Panel.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.sizeUnderlay();},0);};YAHOO.widget.Panel.prototype.registerDragDrop=function(){if(this.header){this.dd=new YAHOO.util.DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}};YAHOO.widget.Panel.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");};YAHOO.widget.Panel.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");};YAHOO.widget.Panel.prototype.configzIndex=function(type,args,obj){YAHOO.widget.Panel.superclass.configzIndex.call(this,type,args,obj);var maskZ=0;var currentZ=YAHOO.util.Dom.getStyle(this.element,"zIndex");if(this.mask){if(!currentZ||isNaN(currentZ)){currentZ=0;}
if(currentZ===0){this.cfg.setProperty("zIndex",1);}else{maskZ=currentZ-1;YAHOO.util.Dom.setStyle(this.mask,"zIndex",maskZ);}}};YAHOO.widget.Panel.prototype.buildWrapper=function(){var elementParent=this.element.parentNode;var originalElement=this.element;var wrapper=document.createElement("DIV");wrapper.className=YAHOO.widget.Panel.CSS_PANEL_CONTAINER;wrapper.id=originalElement.id+"_c";if(elementParent){elementParent.insertBefore(wrapper,originalElement);}
wrapper.appendChild(originalElement);this.element=wrapper;this.innerElement=originalElement;YAHOO.util.Dom.setStyle(this.innerElement,"visibility","inherit");};YAHOO.widget.Panel.prototype.sizeUnderlay=function(){if(this.underlay&&this.browser!="gecko"&&this.browser!="safari"){this.underlay.style.width=this.innerElement.offsetWidth+"px";this.underlay.style.height=this.innerElement.offsetHeight+"px";}};YAHOO.widget.Panel.prototype.onDomResize=function(e,obj){YAHOO.widget.Panel.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.sizeUnderlay();},0);};YAHOO.widget.Panel.prototype.registerDragDrop=function(){if(this.header){this.dd=new YAHOO.util.DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}
var me=this;this.dd.startDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.addClass(me.element,"drag");}
if(me.cfg.getProperty("constraintoviewport")){var offsetHeight=me.element.offsetHeight;var offsetWidth=me.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;this.minX=leftConstraint
this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}
me.dragEvent.fire("startDrag",arguments);}
this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&this.browser=="gecko"){this.showMacGeckoScrollbars();}
me.dragEvent.fire("onDrag",arguments);}
this.dd.endDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.removeClass(me.element,"drag");}
me.dragEvent.fire("endDrag",arguments);}
this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}}
YAHOO.widget.Panel.prototype.buildMask=function(){if(!this.mask){this.mask=document.createElement("DIV");this.mask.id=this.id+"_mask";this.mask.className="mask";this.mask.innerHTML="&nbsp;";var maskClick=function(e,obj){YAHOO.util.Event.stopEvent(e);}
YAHOO.util.Event.addListener(this.mask,maskClick,this);document.body.appendChild(this.mask);}}
YAHOO.widget.Panel.prototype.hideMask=function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();YAHOO.util.Dom.removeClass(document.body,"masked");}}
YAHOO.widget.Panel.prototype.showMask=function(){if(this.cfg.getProperty("modal")&&this.mask){YAHOO.util.Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}}
YAHOO.widget.Panel.prototype.sizeMask=function(){if(this.mask){this.mask.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.mask.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";}}
YAHOO.widget.Panel.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");}
YAHOO.widget.Panel.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");}
YAHOO.widget.Panel.prototype.render=function(appendToNode){return YAHOO.widget.Panel.superclass.render.call(this,appendToNode,this.innerElement);}
YAHOO.widget.Panel.prototype.toString=function(){return"Panel "+this.id;}
YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);}
YAHOO.extend(YAHOO.widget.Dialog,YAHOO.widget.Panel);YAHOO.widget.Dialog.CSS_DIALOG="dialog";YAHOO.widget.Dialog.prototype.beforeSubmitEvent=null;YAHOO.widget.Dialog.prototype.submitEvent=null;YAHOO.widget.Dialog.prototype.manualSubmitEvent=null;YAHOO.widget.Dialog.prototype.asyncSubmitEvent=null;YAHOO.widget.Dialog.prototype.formSubmitEvent=null;YAHOO.widget.Dialog.prototype.cancelEvent=null;YAHOO.widget.Dialog.prototype.initDefaultConfig=function(){YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null,scope:this}
this.doSubmit=function(){var method=this.cfg.getProperty("postmethod");switch(method){case"async":YAHOO.util.Connect.setForm(this.form.name);var cObj=YAHOO.util.Connect.asyncRequest('POST',this.form.action,this.callback);this.asyncSubmitEvent.fire();break;case"form":this.form.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}}
this.cfg.addProperty("postmethod",{value:"async",validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty("buttons",{value:"none",handler:this.configButtons});}
YAHOO.widget.Dialog.prototype.initEvents=function(){YAHOO.widget.Dialog.superclass.initEvents.call(this);this.beforeSubmitEvent=new YAHOO.util.CustomEvent("beforeSubmit");this.submitEvent=new YAHOO.util.CustomEvent("submit");this.manualSubmitEvent=new YAHOO.util.CustomEvent("manualSubmit");this.asyncSubmitEvent=new YAHOO.util.CustomEvent("asyncSubmit");this.formSubmitEvent=new YAHOO.util.CustomEvent("formSubmit");this.cancelEvent=new YAHOO.util.CustomEvent("cancel");}
YAHOO.widget.Dialog.prototype.init=function(el,userConfig){YAHOO.widget.Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Dialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.renderEvent.subscribe(this.registerForm,this,true);this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.beforeRenderEvent.subscribe(function(){var buttonCfg=this.cfg.getProperty("buttons");if(buttonCfg&&buttonCfg!="none"){if(!this.footer){this.setFooter("");}}},this,true);this.initEvent.fire(YAHOO.widget.Dialog);}
YAHOO.widget.Dialog.prototype.registerForm=function(){var form=this.element.getElementsByTagName("FORM")[0];if(!form){var formHTML="<form name=\"frm_"+this.id+"\" action=\"\"></form>";this.body.innerHTML+=formHTML;form=this.element.getElementsByTagName("FORM")[0];}
this.firstFormElement=function(){for(var f=0;f<form.elements.length;f++){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;break;}}}
return null;}();this.lastFormElement=function(){for(var f=form.elements.length-1;f>=0;f--){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;break;}}}
if(me.cfg.getProperty("constraintoviewport")){var offsetHeight=me.element.offsetHeight;var offsetWidth=me.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;this.minX=leftConstraint;this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}
me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&this.browser=="gecko"){this.showMacGeckoScrollbars();}
me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.removeClass(me.element,"drag");}
me.dragEvent.fire("endDrag",arguments);};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}};YAHOO.widget.Panel.prototype.buildMask=function(){if(!this.mask){this.mask=document.createElement("DIV");this.mask.id=this.id+"_mask";this.mask.className="mask";this.mask.innerHTML="&nbsp;";var maskClick=function(e,obj){YAHOO.util.Event.stopEvent(e);};var firstChild=document.body.firstChild;if(firstChild){document.body.insertBefore(this.mask,document.body.firstChild);}else{document.body.appendChild(this.mask);}}};YAHOO.widget.Panel.prototype.hideMask=function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();YAHOO.util.Dom.removeClass(document.body,"masked");}};YAHOO.widget.Panel.prototype.showMask=function(){if(this.cfg.getProperty("modal")&&this.mask){YAHOO.util.Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}};YAHOO.widget.Panel.prototype.sizeMask=function(){if(this.mask){this.mask.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.mask.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";}};YAHOO.widget.Panel.prototype.render=function(appendToNode){return YAHOO.widget.Panel.superclass.render.call(this,appendToNode,this.innerElement);};YAHOO.widget.Panel.prototype.toString=function(){return"Panel "+this.id;};YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Dialog,YAHOO.widget.Panel);YAHOO.widget.Dialog.CSS_DIALOG="dialog";YAHOO.widget.Dialog.prototype.initDefaultConfig=function(){YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty("postmethod",{value:"async",validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty("buttons",{value:"none",handler:this.configButtons});};YAHOO.widget.Dialog.prototype.initEvents=function(){YAHOO.widget.Dialog.superclass.initEvents.call(this);this.beforeSubmitEvent=new YAHOO.util.CustomEvent("beforeSubmit");this.submitEvent=new YAHOO.util.CustomEvent("submit");this.manualSubmitEvent=new YAHOO.util.CustomEvent("manualSubmit");this.asyncSubmitEvent=new YAHOO.util.CustomEvent("asyncSubmit");this.formSubmitEvent=new YAHOO.util.CustomEvent("formSubmit");this.cancelEvent=new YAHOO.util.CustomEvent("cancel");};YAHOO.widget.Dialog.prototype.init=function(el,userConfig){YAHOO.widget.Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Dialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.renderEvent.subscribe(this.registerForm,this,true);this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.beforeRenderEvent.subscribe(function(){var buttonCfg=this.cfg.getProperty("buttons");if(buttonCfg&&buttonCfg!="none"){if(!this.footer){this.setFooter("");}}},this,true);this.initEvent.fire(YAHOO.widget.Dialog);};YAHOO.widget.Dialog.prototype.doSubmit=function(){var pm=this.cfg.getProperty("postmethod");switch(pm){case"async":var method=this.form.getAttribute("method")||'POST';method=method.toUpperCase();YAHOO.util.Connect.setForm(this.form);var cObj=YAHOO.util.Connect.asyncRequest(method,this.form.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":this.form.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}};YAHOO.widget.Dialog.prototype.registerForm=function(){var form=this.element.getElementsByTagName("FORM")[0];if(!form){var formHTML="<form name=\"frm_"+this.id+"\" action=\"\"></form>";this.body.innerHTML+=formHTML;form=this.element.getElementsByTagName("FORM")[0];}
this.firstFormElement=function(){for(var f=0;f<form.elements.length;f++){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;}}}
return null;}();this.lastFormElement=function(){for(var f=form.elements.length-1;f>=0;f--){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;}}}
return null;}();this.form=form;if(this.cfg.getProperty("modal")&&this.form){var me=this;var firstElement=this.firstFormElement||this.firstButton;if(firstElement){this.preventBackTab=new YAHOO.util.KeyListener(firstElement,{shift:true,keys:9},{fn:me.focusLast,scope:me,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}
var lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new YAHOO.util.KeyListener(lastElement,{shift:false,keys:9},{fn:me.focusFirst,scope:me,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}
YAHOO.widget.Dialog.prototype.configButtons=function(type,args,obj){var buttons=args[0];if(buttons!="none"){this.buttonSpan=null;this.buttonSpan=document.createElement("SPAN");this.buttonSpan.className="button-group";for(var b=0;b<buttons.length;b++){var button=buttons[b];var htmlButton=document.createElement("BUTTON");if(button.isDefault){htmlButton.className="default";this.defaultHtmlButton=htmlButton;}
htmlButton.appendChild(document.createTextNode(button.text));YAHOO.util.Event.addListener(htmlButton,"click",button.handler,this,true);this.buttonSpan.appendChild(htmlButton);button.htmlButton=htmlButton;if(b==0){this.firstButton=button.htmlButton;}
var lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new YAHOO.util.KeyListener(lastElement,{shift:false,keys:9},{fn:me.focusFirst,scope:me,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}};YAHOO.widget.Dialog.prototype.configButtons=function(type,args,obj){var buttons=args[0];if(buttons!="none"){this.buttonSpan=null;this.buttonSpan=document.createElement("SPAN");this.buttonSpan.className="button-group";for(var b=0;b<buttons.length;b++){var button=buttons[b];var htmlButton=document.createElement("BUTTON");htmlButton.setAttribute("type","button");if(button.isDefault){htmlButton.className="default";this.defaultHtmlButton=htmlButton;}
htmlButton.appendChild(document.createTextNode(button.text));YAHOO.util.Event.addListener(htmlButton,"click",button.handler,this,true);this.buttonSpan.appendChild(htmlButton);button.htmlButton=htmlButton;if(b===0){this.firstButton=button.htmlButton;}
if(b==(buttons.length-1)){this.lastButton=button.htmlButton;}}
this.setFooter(this.buttonSpan);this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");}else{if(this.buttonSpan){if(this.buttonSpan.parentNode){this.buttonSpan.parentNode.removeChild(this.buttonSpan);}
this.buttonSpan=null;this.firstButtom=null;this.lastButton=null;this.defaultHtmlButton=null;}}}
YAHOO.widget.Dialog.prototype.configOnSuccess=function(type,args,obj){};YAHOO.widget.Dialog.prototype.configOnFailure=function(type,args,obj){};YAHOO.widget.Dialog.prototype.doSubmit=function(){};YAHOO.widget.Dialog.prototype.focusFirst=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
if(this.firstFormElement){this.firstFormElement.focus();}else{this.focusDefaultButton();}}
YAHOO.widget.Dialog.prototype.focusLast=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){this.focusLastButton();}else{if(this.lastFormElement){this.lastFormElement.focus();}}}
YAHOO.widget.Dialog.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton){this.defaultHtmlButton.focus();}}
YAHOO.widget.Dialog.prototype.blurButtons=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.blur();}}}
YAHOO.widget.Dialog.prototype.focusFirstButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.focus();}}}
YAHOO.widget.Dialog.prototype.focusLastButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[buttons.length-1].htmlButton;if(html){html.focus();}}}
YAHOO.widget.Dialog.prototype.validate=function(){return true;}
YAHOO.widget.Dialog.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}}
YAHOO.widget.Dialog.prototype.cancel=function(){this.cancelEvent.fire();this.hide();}
YAHOO.widget.Dialog.prototype.getData=function(){var form=this.form;var data={};if(form){for(var i in this.form){var formItem=form[i];if(formItem){if(formItem.tagName){switch(formItem.tagName){case"INPUT":switch(formItem.type){case"checkbox":data[i]=formItem.checked;break;case"textbox":case"text":case"hidden":data[i]=formItem.value;break;}
break;case"TEXTAREA":data[i]=formItem.value;break;case"SELECT":var val=new Array();for(var x=0;x<formItem.options.length;x++){var option=formItem.options[x];if(option.selected){var selval=option.value;if(!selval||selval==""){selval=option.text;}
this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}};YAHOO.widget.Dialog.prototype.focusFirst=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
if(this.firstFormElement){this.firstFormElement.focus();}else{this.focusDefaultButton();}};YAHOO.widget.Dialog.prototype.focusLast=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){this.focusLastButton();}else{if(this.lastFormElement){this.lastFormElement.focus();}}};YAHOO.widget.Dialog.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton){this.defaultHtmlButton.focus();}};YAHOO.widget.Dialog.prototype.blurButtons=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.blur();}}};YAHOO.widget.Dialog.prototype.focusFirstButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.focus();}}};YAHOO.widget.Dialog.prototype.focusLastButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[buttons.length-1].htmlButton;if(html){html.focus();}}};YAHOO.widget.Dialog.prototype.validate=function(){return true;};YAHOO.widget.Dialog.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}};YAHOO.widget.Dialog.prototype.cancel=function(){this.cancelEvent.fire();this.hide();};YAHOO.widget.Dialog.prototype.getData=function(){var form=this.form;var data={};if(form){for(var i in this.form){var formItem=form[i];if(formItem){if(formItem.tagName){switch(formItem.tagName){case"INPUT":switch(formItem.type){case"checkbox":data[i]=formItem.checked;break;case"textbox":case"text":case"hidden":data[i]=formItem.value;break;}
break;case"TEXTAREA":data[i]=formItem.value;break;case"SELECT":var val=[];for(var x=0;x<formItem.options.length;x++){var option=formItem.options[x];if(option.selected){var selval=option.value;if(!selval||selval===""){selval=option.text;}
val[val.length]=selval;}}
data[i]=val;break;}}else if(formItem[0]&&formItem[0].tagName){switch(formItem[0].tagName){case"INPUT":switch(formItem[0].type){case"radio":for(var r=0;r<formItem.length;r++){var radio=formItem[r];if(radio.checked){data[radio.name]=radio.value;break;}}
break;case"checkbox":var cbArray=new Array();for(var c=0;c<formItem.length;c++){var check=formItem[c];if(check.checked){cbArray[cbArray.length]=check.value;}}
data[i]=val;break;}}else if(formItem[0]&&formItem[0].tagName){if(formItem[0].tagName=="INPUT"){switch(formItem[0].type){case"radio":for(var r=0;r<formItem.length;r++){var radio=formItem[r];if(radio.checked){data[radio.name]=radio.value;break;}}
break;case"checkbox":var cbArray=[];for(var c=0;c<formItem.length;c++){var check=formItem[c];if(check.checked){cbArray[cbArray.length]=check.value;}}
data[formItem[0].name]=cbArray;break;}}}}}}
return data;}
YAHOO.widget.Dialog.prototype.toString=function(){return"Dialog "+this.id;}
YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);}
YAHOO.extend(YAHOO.widget.SimpleDialog,YAHOO.widget.Dialog);YAHOO.widget.SimpleDialog.ICON_BLOCK="nt/ic/ut/bsc/blck16_1.gif";YAHOO.widget.SimpleDialog.ICON_ALARM="nt/ic/ut/bsc/alrt16_1.gif";YAHOO.widget.SimpleDialog.ICON_HELP="nt/ic/ut/bsc/hlp16_1.gif";YAHOO.widget.SimpleDialog.ICON_INFO="nt/ic/ut/bsc/info16_1.gif";YAHOO.widget.SimpleDialog.ICON_WARN="nt/ic/ut/bsc/warn16_1.gif";YAHOO.widget.SimpleDialog.ICON_TIP="nt/ic/ut/bsc/tip16_1.gif";YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG="simple-dialog";YAHOO.widget.SimpleDialog.prototype.initDefaultConfig=function(){YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty("icon",{value:"none",handler:this.configIcon,suppressEvent:true});this.cfg.addProperty("text",{value:"",handler:this.configText,suppressEvent:true,supercedes:["icon"]});}
YAHOO.widget.SimpleDialog.prototype.init=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(YAHOO.widget.SimpleDialog);}
YAHOO.widget.SimpleDialog.prototype.registerForm=function(){YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+this.id+"\" value=\"\"/>";}
YAHOO.widget.SimpleDialog.prototype.configIcon=function(type,args,obj){var icon=args[0];if(icon&&icon!="none"){var iconHTML="<img src=\""+this.imageRoot+icon+"\" class=\"icon\" />";this.body.innerHTML=iconHTML+this.body.innerHTML;}}
YAHOO.widget.SimpleDialog.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}}
YAHOO.widget.SimpleDialog.prototype.toString=function(){return"SimpleDialog "+this.id;}
YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;}
YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);}
YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();}
YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();}
YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){}
YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){}
YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){}
YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){}
YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){}
YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){}
YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
return output;}
YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
return data;};YAHOO.widget.Dialog.prototype.toString=function(){return"Dialog "+this.id;};YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.SimpleDialog,YAHOO.widget.Dialog);YAHOO.widget.SimpleDialog.ICON_BLOCK="nt/ic/ut/bsc/blck16_1.gif";YAHOO.widget.SimpleDialog.ICON_ALARM="nt/ic/ut/bsc/alrt16_1.gif";YAHOO.widget.SimpleDialog.ICON_HELP="nt/ic/ut/bsc/hlp16_1.gif";YAHOO.widget.SimpleDialog.ICON_INFO="nt/ic/ut/bsc/info16_1.gif";YAHOO.widget.SimpleDialog.ICON_WARN="nt/ic/ut/bsc/warn16_1.gif";YAHOO.widget.SimpleDialog.ICON_TIP="nt/ic/ut/bsc/tip16_1.gif";YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG="simple-dialog";YAHOO.widget.SimpleDialog.prototype.initDefaultConfig=function(){YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty("icon",{value:"none",handler:this.configIcon,suppressEvent:true});this.cfg.addProperty("text",{value:"",handler:this.configText,suppressEvent:true,supercedes:["icon"]});};YAHOO.widget.SimpleDialog.prototype.init=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(YAHOO.widget.SimpleDialog);};YAHOO.widget.SimpleDialog.prototype.registerForm=function(){YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+this.id+"\" value=\"\"/>";};YAHOO.widget.SimpleDialog.prototype.configIcon=function(type,args,obj){var icon=args[0];if(icon&&icon!="none"){var iconHTML="<img src=\""+this.imageRoot+icon+"\" class=\"icon\" />";this.body.innerHTML=iconHTML+this.body.innerHTML;}};YAHOO.widget.SimpleDialog.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}};YAHOO.widget.SimpleDialog.prototype.toString=function(){return"SimpleDialog "+this.id;};YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);};YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();};YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
return output;};YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
if(obj.overlay.underlay){obj.initialUnderlayOpacity=YAHOO.util.Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);}
fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
if(obj.overlay.underlay){YAHOO.util.Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();}
fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}}
fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=(-25-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";}
slide.handleTweenAnimateIn=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}
obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");}
slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();}
slide.handleStartAnimateOut=function(type,args,obj){var clientWidth=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var x=pos[0];var y=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(clientWidth+25),y];}
slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var x=pos[0];var y=pos[1];obj.overlay.cfg.setProperty("xy",[x,y],true);obj.overlay.cfg.refireEvent("iframe");}
slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");var offsetWidth=obj.overlay.element.offsetWidth;obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;}
obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=(-25-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}
obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var yso=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var xto=pos[0];var yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,49 +1,25 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
*/
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}}
YAHOO.util.Config.prototype={owner:null,configChangedEvent:null,queueInProgress:false,addProperty:function(key,propertyObject){},getConfig:function(){},getProperty:function(key){},resetProperty:function(key){},setProperty:function(key,value,silent){},queueProperty:function(key,value){},refireEvent:function(key){},applyConfig:function(userConfig,init){},refresh:function(){},fireQueue:function(){},subscribeToConfigEvent:function(key,handler,obj,override){},unsubscribeFromConfigEvent:function(key,handler,obj){},checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}}
YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}}
this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}}
this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop]
if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
return cfg;}
this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}}
this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){this.setProperty(key,initialConfig[key].value);}else{return undefined;}}
this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
return true;}}else{return false;}}}
this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}
return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}
if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}
return true;}else{return false;}}
this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}}
this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}}
this.refresh=function(){for(var prop in config){this.refireEvent(prop);}}
this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
this.queueInProgress=false;eventQueue=new Array();}
this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
return true;}else{return false;}}
this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}}
this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
return output;}
this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
return output;}}
YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;break;}}
return false;}
YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}}
YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL=null;YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,childNodesInDOM:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,beforeInitEvent:null,initEvent:null,appendEvent:null,beforeRenderEvent:null,renderEvent:null,changeHeaderEvent:null,changeBodyEvent:null,changeFooterEvent:null,changeContentEvent:null,destroyEvent:null,beforeShowEvent:null,showEvent:null,beforeHideEvent:null,hideEvent:null,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")==0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}
return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}
if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}
this.element=el;if(el.id){this.id=el.id;}
var childNodes=this.element.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}
this.initDefaultConfig();YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&this.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=this.RESIZE_MONITOR_SECURE_URL;}
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;}
resizeMonitor.id="_yuiResizeMonitor";resizeMonitor.style.visibility="hidden";document.body.appendChild(resizeMonitor);resizeMonitor.style.width="10em";resizeMonitor.style.height="10em";resizeMonitor.style.position="absolute";var nLeft=-1*resizeMonitor.offsetWidth,nTop=-1*resizeMonitor.offsetHeight;resizeMonitor.style.top=nTop+"px";resizeMonitor.style.left=nLeft+"px";resizeMonitor.style.borderStyle="none";resizeMonitor.style.borderWidth="0";YAHOO.util.Dom.setStyle(resizeMonitor,"opacity","0");resizeMonitor.style.visibility="visible";if(!bIE){var doc=resizeMonitor.contentWindow.document;doc.open();doc.close();}}
if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",this.onDomResize,this,true);}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}
if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}
@ -57,97 +33,67 @@ if(typeof footerContent=="string"){this.footer.innerHTML=footerContent;}else{thi
this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){if(!this.footer){this.footer=document.createElement("DIV");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}
this.footer.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
var me=this;var appendTo=function(element){if(typeof element=="string"){element=document.getElementById(element);}
if(element){element.appendChild(me.element);me.appendEvent.fire();}}
if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
if(element){element.appendChild(me.element);me.appendEvent.fire();}};if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
if(this.header&&!YAHOO.util.Dom.inDocument(this.header)){var firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
if(this.body&&!YAHOO.util.Dom.inDocument(this.body)){if(this.footer&&YAHOO.util.Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
this.renderEvent.fire();return true;},destroy:function(){if(this.element){var parent=this.element.parentNode;}
if(parent){parent.removeChild(this.element);}
this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}}
YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;}
YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);}
YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="promo/m/irs/blank.gif";YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.beforeMoveEvent=null;YAHOO.widget.Overlay.prototype.moveEvent=null;YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;"
YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
this.initEvent.fire(YAHOO.widget.Overlay);}
YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);}
YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});}
YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);}
YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");}
YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");}
YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");var effect=this.cfg.getProperty("effect");var effectInstances=new Array();if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
this.initEvent.fire(YAHOO.widget.Overlay);};YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);};YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});};YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);};YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");};YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");};YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");if(currentVis=="inherit"){var e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=YAHOO.util.Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}
e=e.parentNode;}
if(currentVis=="inherit"){currentVis="visible";}}
var effect=this.cfg.getProperty("effect");var effectInstances=[];if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
var isMacGecko=(this.platform=="mac"&&this.browser=="gecko");if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
if(effect){if(visible){if(currentVis!="visible"){this.beforeShowEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
e.animateIn();}}}}else{if(currentVis!="visible"){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
if(effect){if(currentVis!="hidden"){this.beforeHideEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
e.animateOut();}}}else{if(currentVis!="hidden"){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}}
YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}}
YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}
if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();for(var j=0;j<effectInstances.length;j++){var ei=effectInstances[j];if(j===0&&!YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();for(var k=0;k<effectInstances.length;k++){var h=effectInstances[k];if(k===0&&!YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
h.animateOut();}}else if(currentVis===""){YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}};YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}};YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}}
YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");}
YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");}
YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}};YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
if(this.iframe){if(zIndex<=0){zIndex=1;}
YAHOO.util.Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);}
YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];var el=this.element;var showIframe=function(){if(this.iframe){this.iframe.style.display="block";}}
var hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}}
if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,showIframe,this)){this.showEvent.subscribe(showIframe,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,hideIframe,this)){this.hideEvent.subscribe(hideIframe,this,true);}
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);};YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.showIframe=function(){if(this.iframe){this.iframe.style.display="block";}};YAHOO.widget.Overlay.prototype.hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}};YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showIframe,this)){this.showEvent.subscribe(this.showIframe,this,true);}
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}
var x=this.cfg.getProperty("x");var y=this.cfg.getProperty("y");if(!x||!y){this.syncPosition();x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");}
if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=this.imageRoot+YAHOO.widget.Overlay.IFRAME_SRC;}
var parent=el.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){showIframe.call(this);}else{hideIframe.call(this);}}
var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){this.showIframe();}else{this.hideIframe();}}
var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}
YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=el.clientWidth;var height=el.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}
this.showEvent.unsubscribe(showIframe,this);this.hideEvent.unsubscribe(hideIframe,this);}}
YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}}
YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}}
YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}
YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=this.element.clientWidth;var height=this.element.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}
this.showEvent.unsubscribe(this.showIframe,this);this.hideEvent.unsubscribe(this.hideIframe,this);}};YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}};YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}};YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}
if(!contextAlign){contextAlign=contextArgs[2];}
if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}}
switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}}
YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var width=parseInt(this.cfg.getProperty("width"));if(isNaN(width)){width=0;}
var offsetHeight=this.element.offsetHeight;var offsetWidth=(width>0?width:this.element.offsetWidth);var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}};switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}};YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var offsetHeight=this.element.offsetHeight;var offsetWidth=this.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);}
YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.element.style.left=parseInt(x)+"px";this.element.style.top=parseInt(y)+"px";this.syncPosition();this.cfg.refireEvent("iframe");}
YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);}
YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);this.cfg.refireEvent("iframe");}
YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;}
YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){YAHOO.widget.Overlay.windowScrollEvent.fire();}
YAHOO.widget.Overlay.windowResizeHandler=function(e){YAHOO.widget.Overlay.windowResizeEvent.fire();}
YAHOO.widget.Overlay._initialized==null;if(YAHOO.widget.Overlay._initialized==null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);}
YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},getActive:function(){},focus:function(overlay){},remove:function(overlay){},blurAll:function(){},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;}
this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex)+1));}
this.overlays.sort(this.compareZIndexDesc);}}
this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,this.overlays.length-1);o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null
o.blurEvent=null;o.focus=null;o.blur=null;}}
this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}}
var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=new Array();}
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();}
overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();}
var focusOnDomEvent=function(e,obj){overlay.focus();}
var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex));}else{overlay.cfg.setProperty("zIndex",0);}
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);};YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);};YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}
clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){YAHOO.widget.Overlay.windowScrollEvent.fire();},1);}else{YAHOO.widget.Overlay.windowScrollEvent.fire();}};YAHOO.widget.Overlay.windowResizeHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.resizeEnd){window.resizeEnd=-1;}
clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){YAHOO.widget.Overlay.windowResizeEvent.fire();},100);}else{YAHOO.widget.Overlay.windowResizeEvent.fire();}};YAHOO.widget.Overlay._initialized=null;if(YAHOO.widget.Overlay._initialized===null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex,10)+2));}
this.overlays.sort(this.compareZIndexDesc);}};this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,this.overlays.length-1);o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();};overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();};var focusOnDomEvent=function(e,obj){overlay.focus();};var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
this.overlays.push(overlay);return true;}else if(overlay instanceof Array){var regcount=0;for(var i=0;i<overlay.length;i++){if(this.register(overlay[i])){regcount++;}}
if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o].id==overlay){return this.overlays[o];}}}
return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}}
YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var p=0;p<this.overlays.length;p++){if(this.overlays[p].id==overlay){return this.overlays[p];}}}
return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
function handleKeyPress(e,obj){var keyPressed=e.charCode||e.keyCode;if(!keyData.shift)keyData.shift=false;if(!keyData.alt)keyData.alt=false;if(!keyData.ctrl)keyData.ctrl=false;if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){if(keyPressed==keyData.keys[i]){keyEvent.fire(keyPressed,e);break;}}}else{if(keyPressed==keyData.keys){keyEvent.fire(keyPressed,e);}}}}
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
if(!keyData.alt){keyData.alt=false;}
if(!keyData.ctrl){keyData.ctrl=false;}
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,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);}}}}
this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
this.enabled=true;}
this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;}
this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");}}
YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.prototype.enabled=null;YAHOO.util.KeyListener.prototype.enable=function(){};YAHOO.util.KeyListener.prototype.disable=function(){};YAHOO.util.KeyListener.prototype.enabledEvent=null;YAHOO.util.KeyListener.prototype.disabledEvent=null;
this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);};YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();};YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
return output;};YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
if(obj.overlay.underlay){obj.initialUnderlayOpacity=YAHOO.util.Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
if(obj.overlay.underlay){YAHOO.util.Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=(-25-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}
obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var yso=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var xto=pos[0];var yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,34 @@
Dom Release Notes
*** version .12.0 ***
* fixed getXY for IE null parent
* branching set/getStyle at load time instead of run time
*** version 0.11.3 ***
* fixed getX and getY returning incorrect values for collections
* fixed getXY incorrectly calculated for Opera inline elements
* fixed isAncestor failure in safari when 2nd arg is document.documentElement
* fixed infinite loop in replaceClass when oldClassName == newClassName
* getDocumentWidth no longer includes scrollbars
*** version 0.11.2 ***
* limit depth of parent.document crawl to 1 for getXY
* test offsetParent instead of parentNode for getXY
* return null if no el fo r get
* just addClass if no class to replace for replaceClass
*** version 0.11.1 ***
* return null if el is null for get()
* test offsetParent rather than parentNode for getXY()
* limit depth of parent.document crawl for IE getXY() to 1
* if no oldClassName to replace, just addClass for replaceClass()
*** version 0.11.0 ***
* Work around Opera 9 broken currentStyle
* Removed timeout wrapper from setXY retry

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

581
lib/yui/dom/dom.js vendored
View file

@ -2,69 +2,129 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
version: 0.12.0
*/
/**
* @class Provides helper methods for DOM elements.
* The dom module provides helper methods for manipulating Dom elements.
* @module dom
*
*/
YAHOO.util.Dom = function() {
var ua = navigator.userAgent.toLowerCase();
var isOpera = (ua.indexOf('opera') > -1);
var isSafari = (ua.indexOf('safari') > -1);
var isIE = (window.ActiveXObject);
var id_counter = 0;
var util = YAHOO.util; // internal shorthand
var property_cache = {}; // to cache case conversion for set/getStyle
(function() {
var Y = YAHOO.util, // internal shorthand
getStyle, // for load time browser branching
setStyle, // ditto
id_counter = 0, // for use with generateId
propertyCache = {}; // for faster hyphen converts
var toCamel = function(property) {
var convert = function(prop) {
var test = /(-[a-z])/i.exec(prop);
return prop.replace(RegExp.$1, RegExp.$1.substr(1).toUpperCase());
// brower detection
var ua = navigator.userAgent.toLowerCase(),
isOpera = (ua.indexOf('opera') > -1),
isSafari = (ua.indexOf('safari') > -1),
isGecko = (!isOpera && !isSafari && ua.indexOf('gecko') > -1),
isIE = (!isOpera && ua.indexOf('msie') > -1);
// regex cache
var patterns = {
HYPHEN: /(-[a-z])/i
};
while(property.indexOf('-') > -1) {
property = convert(property);
var toCamel = function(property) {
if ( !patterns.HYPHEN.test(property) ) {
return property; // no hyphens
}
if (propertyCache[property]) { // already converted
return propertyCache[property];
}
while( patterns.HYPHEN.exec(property) ) {
property = property.replace(RegExp.$1,
RegExp.$1.substr(1).toUpperCase());
}
propertyCache[property] = property;
return property;
//return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug
};
var toHyphen = function(property) {
if (property.indexOf('-') > -1) { // assume hyphen
return property;
// branching at load instead of runtime
if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method
getStyle = function(el, property) {
var value = null;
var computed = document.defaultView.getComputedStyle(el, '');
if (computed) { // test computed before touching for safari
value = computed[toCamel(property)];
}
var converted = '';
for (var i = 0, len = property.length;i < len; ++i) {
if (property.charAt(i) == property.charAt(i).toUpperCase()) {
converted = converted + '-' + property.charAt(i).toLowerCase();
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;
break;
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 ( typeof el.style.filter == 'string' ) { // 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;
default:
el.style[property] = val;
}
};
} else {
converted = converted + property.charAt(i);
}
setStyle = function(el, property, val) {
el.style[property] = val;
};
}
return converted;
//return property.replace(/([a-z])([A-Z]+)/g, function(m0, m1, m2) {return (m1 + '-' + m2.toLowerCase())});
};
// improve performance by only looking up once
var cacheConvertedProperties = function(property) {
property_cache[property] = {
camel: toCamel(property),
hyphen: toHyphen(property)
};
};
return {
/**
* Returns an HTMLElement reference
* @param {String/HTMLElement/Array} el Accepts a string to use as an ID for getting a DOM reference, an actual DOM reference, or an Array of IDs and/or HTMLElements.
* @return {HTMLElement/Array} A DOM reference to an HTML element or an array of HTMLElements.
* Provides helper methods for DOM elements.
* @namespace YAHOO.util
* @class Dom
*/
YAHOO.util.Dom = {
/**
* Returns an HTMLElement reference.
* @method get
* @param {String | HTMLElement |Array} el Accepts a string to use as an ID for getting a DOM reference, an actual DOM reference, or an Array of IDs and/or HTMLElements.
* @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.
*/
get: function(el) {
if (!el) { return null; } // nothing to work with
if (typeof el != 'string' && !(el instanceof Array) ) { // assuming HTMLElement or HTMLCollection, so pass back as is
return el;
}
@ -75,7 +135,7 @@ YAHOO.util.Dom = function() {
else { // array of ID's and/or elements
var collection = [];
for (var i = 0, len = el.length; i < len; ++i) {
collection[collection.length] = util.Dom.get(el[i]);
collection[collection.length] = Y.Dom.get(el[i]);
}
return collection;
@ -86,100 +146,51 @@ YAHOO.util.Dom = function() {
/**
* Normalizes currentStyle and ComputedStyle.
* @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.
* @method getStyle
* @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} property The style property whose value is returned.
* @return {String/Array} The current value of the style property for the element(s).
* @return {String | Array} The current value of the style property for the element(s).
*/
getStyle: function(el, property) {
var f = function(el) {
var value = null;
var dv = document.defaultView;
property = toCamel(property);
if (!property_cache[property]) {
cacheConvertedProperties(property);
}
var camel = property_cache[property]['camel'];
var hyphen = property_cache[property]['hyphen'];
if (property == 'opacity' && el.filters) {// IE opacity
value = 1;
try {
value = el.filters.item('DXImageTransform.Microsoft.Alpha').opacity / 100;
} catch(e) {
try {
value = el.filters.item('alpha').opacity / 100;
} catch(e) {}
}
} else if (el.style[camel]) { // camelCase for valid styles
value = el.style[camel];
}
else if (isIE && el.currentStyle && el.currentStyle[camel]) { // camelCase for currentStyle; isIE to workaround broken Opera 9 currentStyle
value = el.currentStyle[camel];
}
else if ( dv && dv.getComputedStyle ) { // hyphen-case for computedStyle
var computed = dv.getComputedStyle(el, '');
if (computed && computed.getPropertyValue(hyphen)) {
value = computed.getPropertyValue(hyphen);
}
}
return value;
var f = function(element) {
return getStyle(element, property);
};
return util.Dom.batch(el, f, util.Dom, true);
return Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Wrapper for setting style properties of HTMLElements. Normalizes "opacity" across modern browsers.
* @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.
* @method setStyle
* @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} property The style property to be set.
* @param {String} val The value to apply to the given property.
*/
setStyle: function(el, property, val) {
if (!property_cache[property]) {
cacheConvertedProperties(property);
}
var camel = property_cache[property]['camel'];
var f = function(el) {
switch(property) {
case 'opacity' :
if (isIE && typeof el.style.filter == 'string') { // 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
}
} else {
el.style.opacity = val;
el.style['-moz-opacity'] = val;
el.style['-khtml-opacity'] = val;
}
break;
default :
el.style[camel] = val;
}
property = toCamel(property);
var f = function(element) {
setStyle(element, property, val);
};
util.Dom.batch(el, f, util.Dom, true);
Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* 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).
* @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)
* @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
* @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 || this.getStyle(el, 'display') == 'none') {
if (el.parentNode === null || el.offsetParent === null ||
this.getStyle(el, 'display') == 'none') {
return false;
}
@ -190,11 +201,13 @@ YAHOO.util.Dom = function() {
if (el.getBoundingClientRect) { // IE
box = el.getBoundingClientRect();
var doc = document;
if ( !this.inDocument(el) ) {// might be in a frame, need to get its scroll
var doc = parent.document;
while ( doc && !this.isAncestor(doc.documentElement, el) ) {
if ( !this.inDocument(el) && parent.document != document) {// might be in a frame, need to get its scroll
doc = parent.document;
if ( !this.isAncestor(doc.documentElement, el) ) {
return false;
}
}
var scrollTop = Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
@ -223,42 +236,56 @@ YAHOO.util.Dom = function() {
while (parentNode && parentNode.tagName.toUpperCase() != 'BODY' && parentNode.tagName.toUpperCase() != 'HTML')
{ // account for any scrolled ancestors
if (Y.Dom.getStyle(parentNode, 'display') != 'inline') { // work around opera inline scrollLeft/Top bug
pos[0] -= parentNode.scrollLeft;
pos[1] -= parentNode.scrollTop;
}
if (parentNode.parentNode) { parentNode = parentNode.parentNode; }
else { parentNode = null; }
if (parentNode.parentNode) {
parentNode = parentNode.parentNode;
} else { parentNode = null; }
}
return pos;
};
return util.Dom.batch(el, f, util.Dom, true);
return Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* 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).
* @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 {String/Array} The X position of the element(s)
* @method getX
* @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 {String | Array} The X position of the element(s)
*/
getX: function(el) {
return util.Dom.getXY(el)[0];
var f = function(el) {
return Y.Dom.getXY(el)[0];
};
return Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Gets the current Y 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).
* @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 {String/Array} The Y position of the element(s)
* @method getY
* @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 {String | Array} The Y position of the element(s)
*/
getY: function(el) {
return util.Dom.getXY(el)[1];
var f = function(el) {
return Y.Dom.getXY(el)[1];
};
return Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Set the position of an html element in page coordinates, regardless of how the element is positioned.
* The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
* @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
* @method setXY
* @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 {Array} pos Contains X & Y values for new position (coordinates are page-based)
* @param {Boolean} noRetry By default we try and set the position a second time if the first fails
*/
@ -299,80 +326,87 @@ YAHOO.util.Dom = function() {
};
util.Dom.batch(el, f, util.Dom, true);
Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Set the X position of an html element in page coordinates, regardless of how the element is positioned.
* The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
* @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 {Int} x to use as the X coordinate for the element(s).
* @method setX
* @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 {Int} x The value to use as the X coordinate for the element(s).
*/
setX: function(el, x) {
util.Dom.setXY(el, [x, null]);
Y.Dom.setXY(el, [x, null]);
},
/**
* Set the Y position of an html element in page coordinates, regardless of how the element is positioned.
* The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
* @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 {Int} x to use as the Y coordinate for the element(s).
* @method setY
* @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 {Int} x To use as the Y coordinate for the element(s).
*/
setY: function(el, y) {
util.Dom.setXY(el, [null, y]);
Y.Dom.setXY(el, [null, y]);
},
/**
* Returns the region position of the given element.
* The element must be part of the DOM tree to have a region (display:none or elements not appended return false).
* @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 {Region/Array} A Region or array of Region instances containing "top, left, bottom, right" member data.
* @method getRegion
* @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 {Region | Array} A Region or array of Region instances containing "top, left, bottom, right" member data.
*/
getRegion: function(el) {
var f = function(el) {
var region = new YAHOO.util.Region.getRegion(el);
var region = new Y.Region.getRegion(el);
return region;
};
return util.Dom.batch(el, f, util.Dom, true);
return Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Returns the width of the client (viewport).
* Now using getViewportWidth. This interface left intact for back compat.
* @method getClientWidth
* @deprecated Now using getViewportWidth. This interface left intact for back compat.
* @return {Int} The width of the viewable area of the page.
*/
getClientWidth: function() {
return util.Dom.getViewportWidth();
return Y.Dom.getViewportWidth();
},
/**
* Returns the height of the client (viewport).
* Now using getViewportHeight. This interface left intact for back compat.
* @method getClientHeight
* @deprecated Now using getViewportHeight. This interface left intact for back compat.
* @return {Int} The height of the viewable area of the page.
*/
getClientHeight: function() {
return util.Dom.getViewportHeight();
return Y.Dom.getViewportHeight();
},
/**
* Returns a array of HTMLElements with the given class
* For optimized performance, include a tag and/or root node if possible
* Returns a array of HTMLElements with the given class.
* For optimized performance, include a tag and/or root node when possible.
* @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
* @return {Array} An array of elements that have the given class name
*/
getElementsByClassName: function(className, tag, root) {
var method = function(el) { return util.Dom.hasClass(el, className) };
return util.Dom.getElementsBy(method, tag, root);
var method = function(el) { return Y.Dom.hasClass(el, className); };
return Y.Dom.getElementsBy(method, tag, root);
},
/**
* Determines whether an HTMLElement has the given className
* @param {String/HTMLElement/Array} el The element or collection to test
* Determines whether an HTMLElement has the given className.
* @method hasClass
* @param {String | HTMLElement | Array} el The element or collection to test
* @param {String} className the class name to search for
* @return {Boolean/Array} A boolean value or array of boolean values
* @return {Boolean | Array} A boolean value or array of boolean values
*/
hasClass: function(el, className) {
var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
@ -381,12 +415,13 @@ YAHOO.util.Dom = function() {
return re.test(el['className']);
};
return util.Dom.batch(el, f, util.Dom, true);
return Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Adds a class name to a given element or collection of elements
* @param {String/HTMLElement/Array} el The element or collection to add the class to
* Adds a class name to a given element or collection of elements.
* @method addClass
* @param {String | HTMLElement | Array} el The element or collection to add the class to
* @param {String} className the class name to add to the class attribute
*/
addClass: function(el, className) {
@ -397,12 +432,13 @@ YAHOO.util.Dom = function() {
el['className'] = [el['className'], className].join(' ');
};
util.Dom.batch(el, f, util.Dom, true);
Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Removes a class name from a given element or collection of elements
* @param {String/HTMLElement/Array} el The element or collection to remove the class from
* Removes a class name from a given element or collection of elements.
* @method removeClass
* @param {String | HTMLElement | Array} el The element or collection to remove the class from
* @param {String} className the class name to remove from the class attribute
*/
removeClass: function(el, className) {
@ -420,21 +456,31 @@ YAHOO.util.Dom = function() {
};
util.Dom.batch(el, f, util.Dom, true);
Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Replace a class with another class for a given element or collection of elements.
* If no oldClassName is present, the newClassName is simply added.
* @param {String/HTMLElement/Array} el The element or collection to remove the class from
* @method replaceClass
* @param {String | HTMLElement | Array} el The element or collection to remove the class from
* @param {String} oldClassName the class name to be replaced
* @param {String} newClassName the class name that will be replacing the old class name
*/
replaceClass: function(el, oldClassName, newClassName) {
if (oldClassName === newClassName) { // avoid infinite loop
return false;
}
var re = new RegExp('(?:^|\\s+)' + oldClassName + '(?:\\s+|$)', 'g');
var f = function(el) {
if ( !this.hasClass(el, oldClassName) ) {
this.addClass(el, newClassName); // just add it if nothing to replace
return; // note return
}
el['className'] = el['className'].replace(re, ' ' + newClassName + ' ');
if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent
@ -442,14 +488,15 @@ YAHOO.util.Dom = function() {
}
};
util.Dom.batch(el, f, util.Dom, true);
Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Generates a unique ID
* @param {String/HTMLElement/Array} el (optional) An optional element array of elements to add an ID to (no ID is added if one is already present)
* @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen")
* @return {String/Array} The generated ID, or array of generated IDs (or original ID if already present on an element)
* @method generateId
* @param {String | HTMLElement | Array} el (optional) An optional element array of elements to add an ID to (no ID is added if one is already present).
* @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen").
* @return {String | Array} The generated ID, or array of generated IDs (or original ID if already present on an element)
*/
generateId: function(el, prefix) {
prefix = prefix || 'yui-gen';
@ -457,7 +504,7 @@ YAHOO.util.Dom = function() {
var f = function(el) {
if (el) {
el = util.Dom.get(el);
el = Y.Dom.get(el);
} else {
el = {}; // just generating ID in this case
}
@ -470,17 +517,18 @@ YAHOO.util.Dom = function() {
return el.id;
};
return util.Dom.batch(el, f, util.Dom, true);
return Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy
* @param {String/HTMLElement} haystack The possible ancestor
* @param {String/HTMLElement} needle The possible descendent
* Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy.
* @method isAncestor
* @param {String | HTMLElement} haystack The possible ancestor
* @param {String | HTMLElement} needle The possible descendent
* @return {Boolean} Whether or not the haystack is an ancestor of needle
*/
isAncestor: function(haystack, needle) {
haystack = util.Dom.get(haystack);
haystack = Y.Dom.get(haystack);
if (!haystack || !needle) { return false; }
var f = function(needle) {
@ -497,7 +545,7 @@ YAHOO.util.Dom = function() {
if (parent == haystack) {
return true;
}
else if (parent.tagName.toUpperCase() == 'HTML') {
else if (!parent.tagName || parent.tagName.toUpperCase() == 'HTML') {
return false;
}
@ -507,12 +555,13 @@ YAHOO.util.Dom = function() {
}
};
return util.Dom.batch(needle, f, util.Dom, true);
return Y.Dom.batch(needle, f, Y.Dom, true);
},
/**
* Determines whether an HTMLElement is present in the current document
* @param {String/HTMLElement} el The element to search for
* Determines whether an HTMLElement is present in the current document.
* @method inDocument
* @param {String | HTMLElement} el The element to search for
* @return {Boolean} Whether or not the element is present in the current document
*/
inDocument: function(el) {
@ -520,19 +569,21 @@ YAHOO.util.Dom = function() {
return this.isAncestor(document.documentElement, el);
};
return util.Dom.batch(el, f, util.Dom, true);
return Y.Dom.batch(el, f, Y.Dom, true);
},
/**
* Returns a array of HTMLElements that pass the test applied by supplied boolean method
* For optimized performance, include a tag and/or root node if possible
* @param {Function} method A boolean method to test elements with
* Returns a array of HTMLElements that pass the test applied by supplied boolean method.
* For optimized performance, include a tag and/or root node when possible.
* @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 {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point
*/
getElementsBy: function(method, tag, root) {
tag = tag || '*';
root = util.Dom.get(root) || document;
root = Y.Dom.get(root) || document;
var nodes = [];
var elements = root.getElementsByTagName(tag);
@ -541,8 +592,7 @@ YAHOO.util.Dom = function() {
elements = root.all; // IE < 6
}
for (var i = 0, len = elements.length; i < len; ++i)
{
for (var i = 0, len = elements.length; i < len; ++i) {
if ( method(elements[i]) ) { nodes[nodes.length] = elements[i]; }
}
@ -552,16 +602,17 @@ YAHOO.util.Dom = function() {
/**
* Returns an array of elements that have had the supplied method applied.
* The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) )
* @param {String/HTMLElement/Array} el (optional) An element or array of elements to apply the method to
* The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).
* @method batch
* @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 {Generic} (optional) o An optional arg that is passed to the supplied method
* @param {Boolean} (optional) override Whether or not to override the scope of "method" with "o"
* @return {HTMLElement/Array} The element(s) with the method applied
* @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"
* @return {HTMLElement | Array} The element(s) with the method applied
*/
batch: function(el, method, o, override) {
var id = el;
el = util.Dom.get(el);
el = Y.Dom.get(el);
var scope = (override) ? o : window;
@ -576,7 +627,7 @@ YAHOO.util.Dom = function() {
for (var i = 0, len = el.length; i < len; ++i) {
if (!el[i]) {
id = id[i];
id = el[i];
}
collection[collection.length] = method.call(scope, el[i], o);
}
@ -586,90 +637,40 @@ YAHOO.util.Dom = function() {
/**
* Returns the height of the document.
* @method getDocumentHeight
* @return {Int} The height of the actual document (which includes the body and its margin).
*/
getDocumentHeight: function() {
var scrollHeight=-1,windowHeight=-1,bodyHeight=-1;
var marginTop = parseInt(util.Dom.getStyle(document.body, 'marginTop'), 10);
var marginBottom = parseInt(util.Dom.getStyle(document.body, 'marginBottom'), 10);
var scrollHeight = (document.compatMode != 'CSS1Compat') ? document.body.scrollHeight : document.documentElement.scrollHeight;
var mode = document.compatMode;
if ( (mode || isIE) && !isOpera ) { // (IE, Gecko)
switch (mode) {
case 'CSS1Compat': // Standards mode
scrollHeight = ((window.innerHeight && window.scrollMaxY) ? window.innerHeight+window.scrollMaxY : -1);
windowHeight = [document.documentElement.clientHeight,self.innerHeight||-1].sort(function(a, b){return(a-b);})[1];
bodyHeight = document.body.offsetHeight + marginTop + marginBottom;
break;
default: // Quirks
scrollHeight = document.body.scrollHeight;
bodyHeight = document.body.clientHeight;
}
} else { // Safari & Opera
scrollHeight = document.documentElement.scrollHeight;
windowHeight = self.innerHeight;
bodyHeight = document.documentElement.clientHeight;
}
var h = [scrollHeight,windowHeight,bodyHeight].sort(function(a, b){return(a-b);});
return h[2];
var h = Math.max(scrollHeight, Y.Dom.getViewportHeight());
return h;
},
/**
* Returns the width of the document.
* @method getDocumentWidth
* @return {Int} The width of the actual document (which includes the body and its margin).
*/
getDocumentWidth: function() {
var docWidth=-1,bodyWidth=-1,winWidth=-1;
var marginRight = parseInt(util.Dom.getStyle(document.body, 'marginRight'), 10);
var marginLeft = parseInt(util.Dom.getStyle(document.body, 'marginLeft'), 10);
var mode = document.compatMode;
if (mode || isIE) { // (IE, Gecko, Opera)
switch (mode) {
case 'CSS1Compat': // Standards mode
docWidth = document.documentElement.clientWidth;
bodyWidth = document.body.offsetWidth + marginLeft + marginRight;
winWidth = self.innerWidth || -1;
break;
default: // Quirks
bodyWidth = document.body.clientWidth;
winWidth = document.body.scrollWidth;
break;
}
} else { // Safari
docWidth = document.documentElement.clientWidth;
bodyWidth = document.body.offsetWidth + marginLeft + marginRight;
winWidth = self.innerWidth;
}
var w = [docWidth,bodyWidth,winWidth].sort(function(a, b){return(a-b);});
return w[2];
var scrollWidth = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth;
var w = Math.max(scrollWidth, Y.Dom.getViewportWidth());
return w;
},
/**
* Returns the current height of the viewport.
* @method getViewportHeight
* @return {Int} The height of the viewable area of the page (excludes scrollbars).
*/
getViewportHeight: function() {
var height = -1;
var height = self.innerHeight; // Safari, Opera
var mode = document.compatMode;
if ( (mode || isIE) && !isOpera ) {
switch (mode) { // (IE, Gecko)
case 'CSS1Compat': // Standards mode
height = document.documentElement.clientHeight;
break;
default: // Quirks
height = document.body.clientHeight;
}
} else { // Safari, Opera
height = self.innerHeight;
if ( (mode || isIE) && !isOpera ) { // IE, Gecko
height = (mode == 'CSS1Compat') ?
document.documentElement.clientHeight : // Standards
document.body.clientHeight; // Quirks
}
return height;
@ -677,91 +678,85 @@ YAHOO.util.Dom = function() {
/**
* Returns the current width of the viewport.
* @method getViewportWidth
* @return {Int} The width of the viewable area of the page (excludes scrollbars).
*/
getViewportWidth: function() {
var width = -1;
var width = self.innerWidth; // Safari
var mode = document.compatMode;
if (mode || isIE) { // (IE, Gecko, Opera)
switch (mode) {
case 'CSS1Compat': // Standards mode
width = document.documentElement.clientWidth;
break;
default: // Quirks
width = document.body.clientWidth;
}
} else { // Safari
width = self.innerWidth;
if (mode || isIE) { // IE, Gecko, Opera
width = (mode == 'CSS1Compat') ?
document.documentElement.clientWidth : // Standards
document.body.clientWidth; // Quirks
}
return width;
}
};
}();
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
*/
})();
/**
* @class A region is a representation of an object on a grid. It is defined
* A region is a representation of an object on a grid. It is defined
* by the top, right, bottom, left extents, so is rectangular by default. If
* other shapes are required, this class could be extended to support it.
*
* @param {int} t the top extent
* @param {int} r the right extent
* @param {int} b the bottom extent
* @param {int} l the left extent
* @namespace YAHOO.util
* @class Region
* @param {Int} t the top extent
* @param {Int} r the right extent
* @param {Int} b the bottom extent
* @param {Int} l the left extent
* @constructor
*/
YAHOO.util.Region = function(t, r, b, l) {
/**
* The region's top extent
* @type int
* @property top
* @type Int
*/
this.top = t;
/**
* The region's top extent as index, for symmetry with set/getXY
* @type int
* @property 1
* @type Int
*/
this[1] = t;
/**
* The region's right extent
* @property right
* @type int
*/
this.right = r;
/**
* The region's bottom extent
* @type int
* @property bottom
* @type Int
*/
this.bottom = b;
/**
* The region's left extent
* @type int
* @property left
* @type Int
*/
this.left = l;
/**
* The region's left extent as index, for symmetry with set/getXY
* @type int
* @property 0
* @type Int
*/
this[0] = l;
};
/**
* Returns true if this region contains the region passed in
*
* @method contains
* @param {Region} region The region to evaluate
* @return {boolean} True if the region is contained with this region,
* @return {Boolean} True if the region is contained with this region,
* else false
*/
YAHOO.util.Region.prototype.contains = function(region) {
@ -774,8 +769,8 @@ YAHOO.util.Region.prototype.contains = function(region) {
/**
* Returns the area of the region
*
* @return {int} the region's area
* @method getArea
* @return {Int} the region's area
*/
YAHOO.util.Region.prototype.getArea = function() {
return ( (this.bottom - this.top) * (this.right - this.left) );
@ -783,7 +778,7 @@ YAHOO.util.Region.prototype.getArea = function() {
/**
* Returns the region where the passed in region overlaps with this one
*
* @method intersect
* @param {Region} region The region that intersects
* @return {Region} The overlap region, or null if there is no overlap
*/
@ -803,7 +798,7 @@ YAHOO.util.Region.prototype.intersect = function(region) {
/**
* Returns the region representing the smallest region that can contain both
* the passed in region and this region.
*
* @method union
* @param {Region} region The region that to create the union with
* @return {Region} The union region
*/
@ -818,6 +813,7 @@ YAHOO.util.Region.prototype.union = function(region) {
/**
* toString
* @method toString
* @return string the region properties
*/
YAHOO.util.Region.prototype.toString = function() {
@ -831,7 +827,7 @@ YAHOO.util.Region.prototype.toString = function() {
/**
* Returns a region that is occupied by the DOM element
*
* @method getRegion
* @param {HTMLElement} el The element
* @return {Region} The region that the element occupies
* @static
@ -850,15 +846,14 @@ YAHOO.util.Region.getRegion = function(el) {
/////////////////////////////////////////////////////////////////////////////
/**
* @class
*
* A point is a region that is special in that it represents a single point on
* the grid.
*
* @param {int} x The X position of the point
* @param {int} y The Y position of the point
* @namespace YAHOO.util
* @class Point
* @param {Int} x The X position of the point
* @param {Int} y The Y position of the point
* @constructor
* @extends Region
* @extends YAHOO.util.Region
*/
YAHOO.util.Point = function(x, y) {
if (x instanceof Array) { // accept output from Dom.getXY
@ -868,14 +863,16 @@ YAHOO.util.Point = function(x, y) {
/**
* The X position of the point, which is also the right, left and index zero (for Dom.getXY symmetry)
* @type int
* @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)
* @type int
* @property y
* @type Int
*/
this.y = this.top = this.bottom = this[1] = y;
};

View file

@ -1,5 +1,53 @@
Drag and Drop Release Notes
0.12.0
* The logic to determine if a drag should be initiated has been isolated
to the clickValidator method. This method can be overridden to provide
custom valdiation logic. For example, it is possible to specify hotspots
of any dimension or shape. The provided example shows how to make only
a circular region in the middle of the element initiate a drag.
* Added a new drag and drop event: onInvalidDrop. This is executed when
the dragged element in dropped in a location without a target. Previously
this condition could only detected by implementing handlers for three
other events.
* Now accepts an element reference in lieu of an id. Ids will
be generated if the element does not have one.
* Fixed horizontal autoscroll when scrollTop is zero.
* Added hasOuterHandles property to bypass the isOverTarget check in the
mousedown validation routine. Fixes setOuterHandleElId.
0.11.4
* YAHOO.util.DragDropMgr.swapNode now handles adjacent nodes properly
* Fixed missing variable declarations
0.11.3
* Fixed a JavaScript error that would be generated when trying to implement
DDProxy using the default settings and a tiny element.
* Fixed an error that resulted when constraints were applied to DragDrop
instances.
0.11.2
* Drag and drop will no longer interfere with selecting text on elements
that are not involved in drag and drop.
* The shared drag and drop proxy element now resizes correctly when autoResize
is enabled.
0.11.1
* Fixes an issue where the setXY cache could get out of sync if the element's
offsetParent is changed during onDragDrop.
0.11.0
* The Dom.util.setXY calculation for the initial placement of the dragged
@ -32,7 +80,7 @@ Drag and Drop Release Notes
0.10.0
* Improved the performance in intersect mode
* Improved the performance when in intersect mode
* It was possible for the drag and drop initialization to be skipped
for very slow loading pages. This was fixed.

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,72 @@
YUI Library - Event - Release Notes
0.12.0
* If the function argument is not provided to Event.removeListener, all
all listeners for the specified event type on the element will be removed.
* CustomEvent now has an optional parameter that defines the signature of
the listeners for this event. Two signatures are supported:
YAHOO.util.CustomEvent.LIST:
param1: event name
param2: array of arguments provided to fire()
param3: <optional> the custom object supplied to subscribe()
YAHOO.util.CustomEvent.FLAT:
param1: the first argument provided to fire()
param2: <optional> the custom object supplied to subscribe()
The new flat signature makes it possible to provide a better API
when using custom events, and it makes it possible to transparently
wrap DOM events.
* The parameters for overriding scope in both Event.addListener, and
CustomEvent.subscribe have been augmented. In addition to the
previous behavior where a true value would make the previous parameter
the execution scope, an object can be supplied instead. If an object
is provided, that object becomes the scope obj. This makes it possible
to pass a both a custom object and adjust the scope to a different object.
* Added EventProvider, which is a wrapper for CustomEvent that makes it
possible to subscribe to events by name, whether or not the event has
been created. This class was designed to be used with YAHOO.augment.
EventProvider custom events are created with the new FLAT listener
signature.
* CustomEvent subscribers can return false to stop the propagation of
the event.
* CustomEvents now have an onSubscribe custom event that can used to the
case where a subscriber subscribes to an one-time event that has already
happened. Also provides a way for the implementer to defer initialization
logic until after the first subscription.
* Event.getCharCode now always returns keyCode if charCode is not available.
* Added Event.onContentReady, which is similar to onAvailable, but it also
checks simblings to try to determine when the element's children are
available.
0.11.4
* Fixed a memory leak in IE6 that occurred when the utility was hosted in
an iframe.
* Fixed an issue with Safari click listeners when listeners were removed.
0.11.3
* The listener cache is now pruned when events are removed. This fixes
a performance issue when adding many listeners, removing them, and
adding them again repeatedly.
* Safari click listeners will work correctly if a bound element is removed
from the DOM and a new element with the same ID is added.
* Removed the code that automatically unsubscribed custom event listeners.
0.11.0
* Added Event.purgeElement which will remove all listeners added via
@ -53,3 +119,4 @@ YUI Library - Event - Release Notes
* Fixed browser detection for Opera installations reporting as IE.
* It is now possible to remove and re-add legacy events (Safari click event).

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

998
lib/yui/event/event.js vendored

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,13 @@
CSS Fonts Release Notes
YUI Library - Fonts - Release Notes
*** version 0.11.0 ***
Version 0.12.0
* No changes.
*** version 0.10.0 ***
Version 0.11.0
* No changes.
Version 0.10.0
* Initial release.

View file

@ -1,7 +1 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
*/
body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}

View file

@ -2,13 +2,13 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
version: 0.12.0
*/
/**
* 84.5% for !IE, keywords for IE
* 84.5% for !IE, keywords for IE to preserve user font-size adjustment
* Percents could work for IE, but for backCompat purposes, we are using keywords.
* x-small is for IE < 6 and IE6 quirks mode.
* x-small is for IE6/7 quirks mode.
*
*/
body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}

View file

@ -1,10 +1,40 @@
CSS Grids Release Notes
YUI Library - Grids - Release Notes
*** version 0.11.0 ***
Version 0.12.0
* Removed redundant "text-align:left" from nodes below #doc.
* Removed small-font treatment on #ft.
* Removed margin-bottom from #hd,#bd.
* Added two new #doc definitions (#doc2 and #doc3) that provide
950px centered and 100% page width presets to supplement the
original 750px centered page width.
* Made ".first" selectors more precise by binding to divs, to
make it less likely that our .first definitions will impact
nested content elements wishing to use this nomenclature.
* Fixed "nested yui-gc" bug.
* Fixed build-process whitespace bug with .yui-t2 and .yui-t5.
* Migrated .yui-t's technique to "negative margins" technique
from "floated ems".
* The "negative margins" technique caused z-index issues, so
position:relative was added to the secondary yui-b to enable
correct z-index.
* Make optimization benefits from inheritence wins via code
reorganizations.
Version 0.11.0
* Removed line #43 because it set an already-set value.
Was: ".yui-t7 #main .yui-b{min-width:750px;}"
*** version 0.10.0 ***
Version 0.10.0
* Initial release.

View file

@ -1,7 +1,2 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
*/
body{text-align:center;}#doc{width:57.69em;*width:56.3em;min-width:750px;margin:auto;text-align:left;}#hd,#bd{margin-bottom:1em;text-align:left;}#ft{font-size:77%;font-family:verdana;clear:both;}.yui-t1 #yui-main .yui-b, .yui-t2 #yui-main .yui-b, .yui-t3 #yui-main .yui-b, .yui-t4 .yui-b, .yui-t5 .yui-b, .yui-t6 .yui-b{float:right;}.yui-t1 .yui-b, .yui-t2 .yui-b, .yui-t3 .yui-b, .yui-t4 #yui-main .yui-b, .yui-t5 #yui-main .yui-b, .yui-t6 #yui-main .yui-b{float:left;}.yui-t1 #yui-main .yui-b{width:76%;min-width:570px;}.yui-t1 .yui-b{width:21.33%;min-width:160px;}.yui-t2 #yui-main .yui-b, .yui-t4 #yui-main .yui-b{width:73.4%;min-width:550px;}.yui-t2 .yui-b, .yui-t4 .yui-b{width:24%;min-width:180px;}.yui-t3 #yui-main .yui-b, .yui-t6 #yui-main .yui-b{width:57.6%;min-width:430px;}.yui-t3 .yui-b, .yui-t6 .yui-b{width:40%;min-width:300px;}.yui-t5 #yui-main .yui-b{width:65.4%;min-width:490px;}.yui-t5 .yui-b{width:32%;min-width:240px;}.yui-g .yui-u, .yui-g .yui-g, .yui-ge .yui-u, .yui-gf .yui-u{float:right;display:inline;}.yui-g .first, .yui-gd .first, .yui-ge .first, .yui-gf .first{float:left;}.yui-g .yui-u, .yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u, .yui-gc .yui-u, .yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb .first, .yui-gc .first, .yui-gd .first{margin-left:0;}.yui-gc .first, .yui-gd .yui-u{width:66%;}.yui-gd .first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge .first, .yui-gf .yui-u{width:74.2%;}.yui-gf .first{width:24%;}.yui-ge .first{width:74.2%;}#bd:after, .yui-g:after, .yui-gb:after, .yui-gc:after, .yui-gd:after, .yui-ge:after, .yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd, .yui-g, .yui-gb, .yui-gc, .yui-gd, .yui-ge, .yui-gf{zoom:1;}
/* Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}

View file

@ -2,81 +2,129 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
version: 0.12.0
*/
body {
text-align:center;
/* for all templates and grids */
body{text-align:center;}
#ft{clear:both;}
/**/
/* 750 centered, and backward compatibility */
#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {
margin:auto;text-align:left;
width:57.69em;*width:56.3em;min-width:750px;}
/* 950 centered */
#doc2 {
width:73.074em;*width:71.313em;min-width:950px;}
/* 100% with 10px viewport side matting */
#doc3 {
margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */
width:auto;}
/* below required for all fluid grids; adjust widths and margins above accordingly */
/* to preserve source-order independence for Gecko */
.yui-b{position:relative;}
.yui-b{_position:static;} /* for IE < 7 */
#yui-main .yui-b{position:static;}
#yui-main {width:100%;}
.yui-t1 #yui-main,
.yui-t2 #yui-main,
.yui-t3 #yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}
.yui-t4 #yui-main,
.yui-t5 #yui-main,
.yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}
.yui-t1 .yui-b {
float:left;
width:12.3207em;*width:12.0106em;}
.yui-t1 #yui-main .yui-b{
margin-left:13.3207em;*margin-left:13.0106em;
}
#doc {
width:57.69em;
*width:56.3em; /* IE */
min-width:750px;
margin:auto;
text-align:left;
.yui-t2 .yui-b {
float:left;
width:13.8456em;*width:13.512em;}
.yui-t2 #yui-main .yui-b {
margin-left:14.8456em;*margin-left:14.512em;
}
#hd,#bd {margin-bottom:1em;text-align:left;}
#ft {font-size:77%;font-family:verdana;clear:both;}
.yui-t3 .yui-b {
float:left;
width:23.0759em;*width:22.52em;}
.yui-t3 #yui-main .yui-b {
margin-left:24.0759em;*margin-left:23.52em;
}
/* rules for main templates */
.yui-t1 #yui-main .yui-b, .yui-t2 #yui-main .yui-b, .yui-t3 #yui-main .yui-b, .yui-t4 .yui-b, .yui-t5 .yui-b, .yui-t6 .yui-b {float:right;}
.yui-t1 .yui-b, .yui-t2 .yui-b, .yui-t3 .yui-b, .yui-t4 #yui-main .yui-b, .yui-t5 #yui-main .yui-b, .yui-t6 #yui-main .yui-b {float:left;}
/* t1: L160 */
.yui-t1 #yui-main .yui-b {width:76%;min-width:570px;}
.yui-t1 .yui-b {width:21.33%;min-width:160px;}
/* t2 & t4: L180 & R180 */
.yui-t2 #yui-main .yui-b, .yui-t4 #yui-main .yui-b {width:73.4%;min-width:550px;}
.yui-t2 .yui-b, .yui-t4 .yui-b {width:24%;min-width:180px;}
/* t3 & t6: L300 & R300 */
.yui-t3 #yui-main .yui-b, .yui-t6 #yui-main .yui-b {width:57.6%;min-width:430px;}
.yui-t3 .yui-b, .yui-t6 .yui-b {width:40%;min-width:300px;}
/* t5: R240 */
.yui-t5 #yui-main .yui-b {width:65.4%;min-width:490px;}
.yui-t5 .yui-b {width:32%;min-width:240px;}
/* t7: 750 */
/* grid-generic rules for all templates */
/* all modules and grids nested in a grid get floated */
.yui-g .yui-u, .yui-g .yui-g, .yui-ge .yui-u, .yui-gf .yui-u {
.yui-t4 .yui-b {
float:right;
display:inline; /* IE */
width:13.8456em;*width:13.512em;}
.yui-t4 #yui-main .yui-b {
margin-right:14.8456em;*margin-right:14.512em;
}
/* float left and kill margin on first for added flex */
.yui-g .first, .yui-gd .first, .yui-ge .first, .yui-gf .first {float:left; }
/* 2 col */
.yui-g .yui-u, .yui-g .yui-g {width:49.1%;}
.yui-g .yui-g .yui-u {width:48.1%;} /* smaller for nested to preserve margins */
/* 3 col */
.yui-gb .yui-u, .yui-gc .yui-u, .yui-gd .yui-u {
float:left; /* need to reverse the order for 3 */
margin-left:2%; *margin-left:1.895%;
width:32%;
.yui-t5 .yui-b {
float:right;
width:18.4608em;*width:18.016em;}
.yui-t5 #yui-main .yui-b {
margin-right:19.4608em;*margin-right:19.016em;
}
.yui-gb .first, .yui-gc .first, .yui-gd .first {margin-left:0;}
.yui-t6 .yui-b {
float:right;
width:23.0759em;*width:22.52em;}
.yui-t6 #yui-main .yui-b {
margin-right:24.0759em;*margin-right:23.52em;
}
/* colspan 2 */
.yui-gc .first, .yui-gd .yui-u {width:66%;}
.yui-gd .first {width:32%;}
/* colspan 3 */
.yui-t7 #yui-main .yui-b {
display:block;margin:0 0 1em 0;
}
#yui-main .yui-b {float:none;width:auto;}
/* GRIDS (not TEMPLATES) */
.yui-g .yui-u,
.yui-g .yui-g,
.yui-gc .yui-u,
.yui-gc .yui-g .yui-u,
.yui-ge .yui-u,
.yui-gf .yui-u{float:right;display:inline;}
.yui-g div.first,
.yui-gc div.first,
.yui-gc div.first div.first,
.yui-gd div.first,
.yui-ge div.first,
.yui-gf div.first{float:left;}
.yui-g .yui-u,
.yui-g .yui-g{width:49.1%;}
.yui-g .yui-g .yui-u,
.yui-gc .yui-g .yui-u {width:48.1%;}
.yui-gb .yui-u,
.yui-gc .yui-u,
.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}
.yui-gb div.first,
.yui-gc div.first,
.yui-gd div.first{margin-left:0;}
.yui-gc div.first,
.yui-gd .yui-u{width:66%;}
.yui-gd div.first{width:32%;}
.yui-ge .yui-u{width:24%;}
.yui-ge .first, .yui-gf .yui-u {width:74.2%;}
.yui-gf .first {width:24%;}
.yui-ge .first {width:74.2%;}
/* self clear floated parent containers */
#bd:after, .yui-g:after, .yui-gb:after, .yui-gc:after, .yui-gd:after, .yui-ge:after, .yui-gf:after {content:".";display:block;height:0;clear:both;visibility:hidden;}
#bd, .yui-g, .yui-gb, .yui-gc, .yui-gd, .yui-ge, .yui-gf {zoom:1;} /* IE */
.yui-ge div.first,
.yui-gf .yui-u{width:74.2%;}
.yui-gf div.first{width:24%;}
.yui-ge div.first{width:74.2%;}
#bd:after,
.yui-g:after,
.yui-gb:after,
.yui-gc:after,
.yui-gd:after,
.yui-ge:after,
.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
#bd,
.yui-g,
.yui-gb,
.yui-gc,
.yui-gd,
.yui-ge,
.yui-gf{zoom:1;}

View file

@ -1,5 +1,33 @@
Logger Release Notes
*** version 0.12.0 ***
* Added method formatMsg(oLogMsg) to support custom formatting of log messages
for output to a LogReader.
*** version 0.11.3 ***
* The Logger static method enableFirebug() has been RENAMED to
enableBrowserConsole().
* The Logger static method disableFirebug() has been RENAMED to
disableBrowserConsole().
* By default, the Logger will not automatically output to Firebug or Safari's
JavaScript console. To enable this feature, implementers should now explicitly
call
YAHOO.widget.Logger.enableBrowserConsole().
* Implementers may now cap the size of the YAHOO.widget.Logger stack by setting
the property YAHOO.widget.Logger.maxStackEntries.
* Implementers may now control the number of items displayed in each console by
setting the LogReader properties thresholdMax and thresholdMin.
*** version 0.11.0 ***
* Initial release

View file

@ -1 +1,20 @@
/* logger default styles */ /* font size is controlled here: default 77% */ #yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;} /* width is controlled here: default 31em */ .yui-log {padding:1em;width:31em;background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;} .yui-log p {margin:1px;padding:.1em;} .yui-log button {font-family:monospace;} .yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;color:#FFF;} /* height is controlled here: default 20em*/ .yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;} .yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;} .yui-log .yui-log-ft .yui-log-categoryfilters {} .yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;} .yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;} .yui-log .yui-log-filtergrp {margin-right:.5em;} .yui-log .info {background-color:#A7CC25;} /* A7CC25 green */ .yui-log .warn {background-color:#F58516;} /* F58516 orange */ .yui-log .error {background-color:#E32F0B;color:black;} /* E32F0B red */ .yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */ .yui-log .window {background-color:#F2E886;} /* F2E886 tan */
/* logger default styles */
/* font size is controlled here: default 77% */
#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;}
/* width is controlled here: default 31em */
.yui-log {padding:1em;width:31em;background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;}
.yui-log p {margin:1px;padding:.1em;}
.yui-log button {font-family:monospace;}
.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;color:#FFF;}
/* height is controlled here: default 20em*/
.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}
.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;}
.yui-log .yui-log-ft .yui-log-categoryfilters {}
.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}
.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}
.yui-log .yui-log-filtergrp {margin-right:.5em;}
.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */
.yui-log .warn {background-color:#F58516;} /* F58516 orange */
.yui-log .error {background-color:#E32F0B;} /* E32F0B red */
.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */
.yui-log .window {background-color:#F2E886;} /* F2E886 tan */

File diff suppressed because it is too large Load diff

View file

@ -1,63 +1,56 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
*/
YAHOO.widget.Logger={loggerEnabled:true,_firebugEnabled:true,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],_startTime:new Date().getTime(),_lastTime:null};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger.log=function(sMsg,sCategory,sSource){if(this.loggerEnabled){if(!sCategory){sCategory="info";}
else if(this._isNewCategory(sCategory)){this._createNewCategory(sCategory);}
var sClass="global";var sDetail=null;if(sSource){var spaceIndex=sSource.indexOf(" ");if(spaceIndex>0){sClass=sSource.substring(0,spaceIndex);sDetail=sSource.substring(spaceIndex,sSource.length);}
else{sClass=sSource;}
if(this._isNewSource(sClass)){this._createNewSource(sClass);}}
var timestamp=new Date();var logEntry={time:timestamp,category:sCategory,source:sClass,sourceDetail:sDetail,msg:sMsg};this._stack.push(logEntry);this.newLogEvent.fire(logEntry);if(this._firebugEnabled){this._printToFirebug(logEntry);}
return true;}
else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log(null,"Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableFirebug=function(){YAHOO.log("YAHOO.Logger output to Firebug has been disabled.");this._firebugEnabled=false;};YAHOO.widget.Logger.enableFirebug=function(){this._firebugEnabled=true;YAHOO.log("YAHOO.Logger output to Firebug has been enabled.");};YAHOO.widget.Logger._createNewCategory=function(category){this.categories.push(category);this.categoryCreateEvent.fire(category);};YAHOO.widget.Logger._isNewCategory=function(category){for(var i=0;i<this.categories.length;i++){if(category==this.categories[i]){return false;}}
return true;};YAHOO.widget.Logger._createNewSource=function(source){this.sources.push(source);this.sourceCreateEvent.fire(source);};YAHOO.widget.Logger._isNewSource=function(source){if(source){for(var i=0;i<this.sources.length;i++){if(source==this.sources[i]){return false;}}
return true;}};YAHOO.widget.Logger._printToFirebug=function(entry){if(window.console&&console.log){var category=entry.category;var label=entry.category.substring(0,4).toUpperCase();var time=entry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
else{localTime=time.toString();}
var msecs=time.getTime();var elapsedTime=(YAHOO.widget.Logger._lastTime)?(msecs-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=msecs;var output=localTime+" ("+
elapsedTime+"ms): "+
entry.source+": "+
entry.msg;console.log(output);}};YAHOO.widget.Logger._onWindowError=function(msg,url,line){try{YAHOO.widget.Logger.log(msg+' ('+url+', line '+line+')',"window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}
catch(e){return false;}};if(window.onerror){YAHOO.widget.Logger._origOnWindowError=window.onerror;}
window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger.log("Logger initialized");YAHOO.widget.LogWriter=function(sSource){if(!sSource){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
YAHOO.widget.LogMsg=function(oConfigs){if(typeof oConfigs=="object"){for(var param in oConfigs){this[param]=oConfigs[param];}}};YAHOO.widget.LogMsg.prototype.msg=null;YAHOO.widget.LogMsg.prototype.time=null;YAHOO.widget.LogMsg.prototype.category=null;YAHOO.widget.LogMsg.prototype.source=null;YAHOO.widget.LogMsg.prototype.sourceDetail=null;YAHOO.widget.LogWriter=function(sSource){if(!sSource){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}
this._source=sSource;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(sMsg,sCategory){YAHOO.widget.Logger.log(sMsg,sCategory,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._sSource;};YAHOO.widget.LogWriter.prototype.setSource=function(sSource){if(!sSource){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return;}
else{this._sSource=sSource;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(containerEl,oConfig){var oSelf=this;if(typeof oConfig=="object"){for(var param in oConfig){this[param]=oConfig[param];}}
if(containerEl){if(typeof containerEl=="string"){this._containerEl=document.getElementById(containerEl);}
else if(containerEl.tagName){this._containerEl=containerEl;}
this._containerEl.className="yui-log";}
if(!this._containerEl){if(YAHOO.widget.LogReader._defaultContainerEl){this._containerEl=YAHOO.widget.LogReader._defaultContainerEl;}
else{this._containerEl=document.body.appendChild(document.createElement("div"));this._containerEl.id="yui-log";this._containerEl.className="yui-log";YAHOO.widget.LogReader._defaultContainerEl=this._containerEl;}
var containerStyle=this._containerEl.style;if(this.width){containerStyle.width=this.width;}
else{this._sSource=sSource;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(elContainer,oConfigs){var oSelf=this;this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;if(typeof oConfigs=="object"){for(var param in oConfigs){this[param]=oConfigs[param];}}
if(elContainer){if(typeof elContainer=="string"){this._elContainer=document.getElementById(elContainer);}
else if(elContainer.tagName){this._elContainer=elContainer;}
this._elContainer.className="yui-log";}
if(!this._elContainer){if(YAHOO.widget.LogReader._elDefaultContainer){this._elContainer=YAHOO.widget.LogReader._elDefaultContainer;}
else{this._elContainer=document.body.appendChild(document.createElement("div"));this._elContainer.id="yui-log";this._elContainer.className="yui-log";YAHOO.widget.LogReader._elDefaultContainer=this._elContainer;}
var containerStyle=this._elContainer.style;if(this.width){containerStyle.width=this.width;}
if(this.left){containerStyle.left=this.left;}
if(this.right){containerStyle.right=this.right;}
if(this.bottom){containerStyle.bottom=this.bottom;}
if(this.top){containerStyle.top=this.top;}
if(this.fontSize){containerStyle.fontSize=this.fontSize;}}
if(this._containerEl){if(!this._hdEl){this._hdEl=this._containerEl.appendChild(document.createElement("div"));this._hdEl.id="yui-log-hd"+YAHOO.widget.LogReader._index;this._hdEl.className="yui-log-hd";this._collapseEl=this._hdEl.appendChild(document.createElement("div"));this._collapseEl.className="yui-log-btns";this._collapseBtn=document.createElement("input");this._collapseBtn.type="button";this._collapseBtn.style.fontSize=YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");this._collapseBtn.className="yui-log-button";this._collapseBtn.value="Collapse";this._collapseBtn=this._collapseEl.appendChild(this._collapseBtn);YAHOO.util.Event.addListener(oSelf._collapseBtn,'click',oSelf._onClickCollapseBtn,oSelf);this._title=this._hdEl.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";if(YAHOO.util.DD&&(YAHOO.widget.LogReader._defaultContainerEl==this._containerEl)){var ylog_dd=new YAHOO.util.DD(this._containerEl.id);ylog_dd.setHandleElId(this._hdEl.id);this._hdEl.style.cursor="move";}}
if(!this._consoleEl){this._consoleEl=this._containerEl.appendChild(document.createElement("div"));this._consoleEl.className="yui-log-bd";if(this.height){this._consoleEl.style.height=this.height;}}
if(!this._ftEl&&this.footerEnabled){this._ftEl=this._containerEl.appendChild(document.createElement("div"));this._ftEl.className="yui-log-ft";this._btnsEl=this._ftEl.appendChild(document.createElement("div"));this._btnsEl.className="yui-log-btns";this._pauseBtn=document.createElement("input");this._pauseBtn.type="button";this._pauseBtn.style.fontSize=YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");this._pauseBtn.className="yui-log-button";this._pauseBtn.value="Pause";this._pauseBtn=this._btnsEl.appendChild(this._pauseBtn);YAHOO.util.Event.addListener(oSelf._pauseBtn,'click',oSelf._onClickPauseBtn,oSelf);this._clearBtn=document.createElement("input");this._clearBtn.type="button";this._clearBtn.style.fontSize=YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");this._clearBtn.className="yui-log-button";this._clearBtn.value="Clear";this._clearBtn=this._btnsEl.appendChild(this._clearBtn);YAHOO.util.Event.addListener(oSelf._clearBtn,'click',oSelf._onClickClearBtn,oSelf);this._categoryFiltersEl=this._ftEl.appendChild(document.createElement("div"));this._categoryFiltersEl.className="yui-log-categoryfilters";this._sourceFiltersEl=this._ftEl.appendChild(document.createElement("div"));this._sourceFiltersEl.className="yui-log-sourcefilters";}}
if(this._elContainer){if(!this._elHd){this._elHd=this._elContainer.appendChild(document.createElement("div"));this._elHd.id="yui-log-hd"+this._sName;this._elHd.className="yui-log-hd";this._elCollapse=this._elHd.appendChild(document.createElement("div"));this._elCollapse.className="yui-log-btns";this._btnCollapse=document.createElement("input");this._btnCollapse.type="button";this._btnCollapse.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");this._btnCollapse.className="yui-log-button";this._btnCollapse.value="Collapse";this._btnCollapse=this._elCollapse.appendChild(this._btnCollapse);YAHOO.util.Event.addListener(oSelf._btnCollapse,'click',oSelf._onClickCollapseBtn,oSelf);this._title=this._elHd.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";if(YAHOO.util.DD&&(YAHOO.widget.LogReader._elDefaultContainer==this._elContainer)){var ylog_dd=new YAHOO.util.DD(this._elContainer.id);ylog_dd.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}}
if(!this._elConsole){this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height;}}
if(!this._elFt&&this.footerEnabled){this._elFt=this._elContainer.appendChild(document.createElement("div"));this._elFt.className="yui-log-ft";this._elBtns=this._elFt.appendChild(document.createElement("div"));this._elBtns.className="yui-log-btns";this._btnPause=document.createElement("input");this._btnPause.type="button";this._btnPause.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");this._btnPause.className="yui-log-button";this._btnPause.value="Pause";this._btnPause=this._elBtns.appendChild(this._btnPause);YAHOO.util.Event.addListener(oSelf._btnPause,'click',oSelf._onClickPauseBtn,oSelf);this._btnClear=document.createElement("input");this._btnClear.type="button";this._btnClear.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");this._btnClear.className="yui-log-button";this._btnClear.value="Clear";this._btnClear=this._elBtns.appendChild(this._btnClear);YAHOO.util.Event.addListener(oSelf._btnClear,'click',oSelf._onClickClearBtn,oSelf);this._elCategoryFilters=this._elFt.appendChild(document.createElement("div"));this._elCategoryFilters.className="yui-log-categoryfilters";this._elSourceFilters=this._elFt.appendChild(document.createElement("div"));this._elSourceFilters.className="yui-log-sourcefilters";}}
if(!this._buffer){this._buffer=[];}
YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);this._lastTime=YAHOO.widget.Logger.getStartTime();this._categoryFilters=[];var catsLen=YAHOO.widget.Logger.categories.length;if(this._categoryFiltersEl){for(var i=0;i<catsLen;i++){this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);}}
this._sourceFilters=[];var sourcesLen=YAHOO.widget.Logger.sources.length;if(this._sourceFiltersEl){for(var j=0;j<sourcesLen;j++){this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);}}
YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);YAHOO.widget.LogReader._index++;this._filterLogs();};YAHOO.widget.LogReader.prototype.logReaderEnabled=true;YAHOO.widget.LogReader.prototype.width=null;YAHOO.widget.LogReader.prototype.height=null;YAHOO.widget.LogReader.prototype.top=null;YAHOO.widget.LogReader.prototype.left=null;YAHOO.widget.LogReader.prototype.right=null;YAHOO.widget.LogReader.prototype.bottom=null;YAHOO.widget.LogReader.prototype.fontSize=null;YAHOO.widget.LogReader.prototype.footerEnabled=true;YAHOO.widget.LogReader.prototype.verboseOutput=true;YAHOO.widget.LogReader.prototype.newestOnTop=true;YAHOO.widget.LogReader.prototype.pause=function(){this._timeout=null;this.logReaderEnabled=false;};YAHOO.widget.LogReader.prototype.resume=function(){this.logReaderEnabled=true;this._printBuffer();};YAHOO.widget.LogReader.prototype.hide=function(){this._containerEl.style.display="none";};YAHOO.widget.LogReader.prototype.show=function(){this._containerEl.style.display="block";};YAHOO.widget.LogReader.prototype.setTitle=function(sTitle){var regEx=/>/g;sTitle=sTitle.replace(regEx,"&gt;");regEx=/</g;sTitle=sTitle.replace(regEx,"&lt;");this._title.innerHTML=(sTitle);};YAHOO.widget.LogReader._index=0;YAHOO.widget.LogReader._defaultContainerEl=null;YAHOO.widget.LogReader.prototype._buffer=null;YAHOO.widget.LogReader.prototype._lastTime=null;YAHOO.widget.LogReader.prototype._timeout=null;YAHOO.widget.LogReader.prototype._categoryFilters=null;YAHOO.widget.LogReader.prototype._sourceFilters=null;YAHOO.widget.LogReader.prototype._containerEl=null;YAHOO.widget.LogReader.prototype._hdEl=null;YAHOO.widget.LogReader.prototype._collapseEl=null;YAHOO.widget.LogReader.prototype._collapseBtn=null;YAHOO.widget.LogReader.prototype._title=null;YAHOO.widget.LogReader.prototype._consoleEl=null;YAHOO.widget.LogReader.prototype._ftEl=null;YAHOO.widget.LogReader.prototype._btnsEl=null;YAHOO.widget.LogReader.prototype._categoryFiltersEl=null;YAHOO.widget.LogReader.prototype._sourceFiltersEl=null;YAHOO.widget.LogReader.prototype._pauseBtn=null;YAHOO.widget.LogReader.prototype._clearBtn=null;YAHOO.widget.LogReader.prototype._createCategoryCheckbox=function(category){var oSelf=this;if(this._ftEl){var parentEl=this._categoryFiltersEl;var filters=this._categoryFilters;var filterEl=parentEl.appendChild(document.createElement("span"));filterEl.className="yui-log-filtergrp";var categoryChk=document.createElement("input");categoryChk.id="yui-log-filter-"+category+YAHOO.widget.LogReader._index;categoryChk.className="yui-log-filter-"+category;categoryChk.type="checkbox";categoryChk.category=category;categoryChk=filterEl.appendChild(categoryChk);categoryChk.checked=true;filters.push(category);YAHOO.util.Event.addListener(categoryChk,'click',oSelf._onCheckCategory,oSelf);var categoryChkLbl=filterEl.appendChild(document.createElement("label"));categoryChkLbl.htmlFor=categoryChk.id;categoryChkLbl.className=category;categoryChkLbl.innerHTML=category;}};YAHOO.widget.LogReader.prototype._createSourceCheckbox=function(source){var oSelf=this;if(this._ftEl){var parentEl=this._sourceFiltersEl;var filters=this._sourceFilters;var filterEl=parentEl.appendChild(document.createElement("span"));filterEl.className="yui-log-filtergrp";var sourceChk=document.createElement("input");sourceChk.id="yui-log-filter"+source+YAHOO.widget.LogReader._index;sourceChk.className="yui-log-filter"+source;sourceChk.type="checkbox";sourceChk.source=source;sourceChk=filterEl.appendChild(sourceChk);sourceChk.checked=true;filters.push(source);YAHOO.util.Event.addListener(sourceChk,'click',oSelf._onCheckSource,oSelf);var sourceChkLbl=filterEl.appendChild(document.createElement("label"));sourceChkLbl.htmlFor=sourceChk.id;sourceChkLbl.className=source;sourceChkLbl.innerHTML=source;}};YAHOO.widget.LogReader.prototype._filterLogs=function(){if(this._consoleEl!==null){this._clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}};YAHOO.widget.LogReader.prototype._clearConsole=function(){this._timeout=null;this._buffer=[];this._lastTime=YAHOO.widget.Logger.getStartTime();var consoleEl=this._consoleEl;while(consoleEl.hasChildNodes()){consoleEl.removeChild(consoleEl.firstChild);}};YAHOO.widget.LogReader.prototype._printBuffer=function(){this._timeout=null;if(this._consoleEl!==null){var entries=[];for(var i=0;i<this._buffer.length;i++){entries[i]=this._buffer[i];}
this._buffer=[];this._printToConsole(entries);if(!this.newestOnTop){this._consoleEl.scrollTop=this._consoleEl.scrollHeight;}}};YAHOO.widget.LogReader.prototype._printToConsole=function(aEntries){var entriesLen=aEntries.length;var sourceFiltersLen=this._sourceFilters.length;var categoryFiltersLen=this._categoryFilters.length;for(var i=0;i<entriesLen;i++){var entry=aEntries[i];var category=entry.category;var source=entry.source;var sourceDetail=entry.sourceDetail;var okToPrint=false;var okToFilterCats=false;for(var j=0;j<sourceFiltersLen;j++){if(source==this._sourceFilters[j]){okToFilterCats=true;break;}}
if(okToFilterCats){for(var k=0;k<categoryFiltersLen;k++){if(category==this._categoryFilters[k]){okToPrint=true;break;}}}
if(okToPrint){var label=entry.category.substring(0,4).toUpperCase();var time=entry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
this._lastTime=YAHOO.widget.Logger.getStartTime();YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset,this);this._categoryFilters=[];var catsLen=YAHOO.widget.Logger.categories.length;if(this._elCategoryFilters){for(var i=0;i<catsLen;i++){this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);}}
this._sourceFilters=[];var sourcesLen=YAHOO.widget.Logger.sources.length;if(this._elSourceFilters){for(var j=0;j<sourcesLen;j++){this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);}}
YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);this._filterLogs();YAHOO.log("LogReader initialized",null,this.toString());};YAHOO.widget.LogReader.prototype.logReaderEnabled=true;YAHOO.widget.LogReader.prototype.width=null;YAHOO.widget.LogReader.prototype.height=null;YAHOO.widget.LogReader.prototype.top=null;YAHOO.widget.LogReader.prototype.left=null;YAHOO.widget.LogReader.prototype.right=null;YAHOO.widget.LogReader.prototype.bottom=null;YAHOO.widget.LogReader.prototype.fontSize=null;YAHOO.widget.LogReader.prototype.footerEnabled=true;YAHOO.widget.LogReader.prototype.verboseOutput=true;YAHOO.widget.LogReader.prototype.newestOnTop=true;YAHOO.widget.LogReader.prototype.thresholdMax=500;YAHOO.widget.LogReader.prototype.thresholdMin=100;YAHOO.widget.LogReader.prototype.toString=function(){return"LogReader instance"+this._sName;};YAHOO.widget.LogReader.prototype.pause=function(){this._timeout=null;this.logReaderEnabled=false;};YAHOO.widget.LogReader.prototype.resume=function(){this.logReaderEnabled=true;this._printBuffer();};YAHOO.widget.LogReader.prototype.hide=function(){this._elContainer.style.display="none";};YAHOO.widget.LogReader.prototype.show=function(){this._elContainer.style.display="block";};YAHOO.widget.LogReader.prototype.setTitle=function(sTitle){this._title.innerHTML=this.html2Text(sTitle);};YAHOO.widget.LogReader.prototype.getLastTime=function(){return this._lastTime;};YAHOO.widget.LogReader.prototype.formatMsg=function(oLogMsg){var category=oLogMsg.category;var label=category.substring(0,4).toUpperCase();var time=oLogMsg.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
else{localTime=time.toString();}
var msecs=time.getTime();var startTime=YAHOO.widget.Logger.getStartTime();var totalTime=msecs-startTime;var elapsedTime=msecs-this._lastTime;this._lastTime=msecs;var verboseOutput=(this.verboseOutput)?"<br>":"";var sourceAndDetail=(sourceDetail)?source+" "+sourceDetail:source;var output="<span class='"+category+"'>"+label+"</span> "+
totalTime+"ms (+"+
elapsedTime+") "+localTime+": "+
sourceAndDetail+": "+
verboseOutput+
entry.msg;var oNewElement=(this.newestOnTop)?this._consoleEl.insertBefore(document.createElement("p"),this._consoleEl.firstChild):this._consoleEl.appendChild(document.createElement("p"));oNewElement.innerHTML=output;}}};YAHOO.widget.LogReader.prototype._onCategoryCreate=function(type,args,oSelf){var category=args[0];if(oSelf._ftEl){oSelf._createCategoryCheckbox(category);}};YAHOO.widget.LogReader.prototype._onSourceCreate=function(type,args,oSelf){var source=args[0];if(oSelf._ftEl){oSelf._createSourceCheckbox(source);}};YAHOO.widget.LogReader.prototype._onCheckCategory=function(v,oSelf){var newFilter=this.category;var filtersArray=oSelf._categoryFilters;if(!this.checked){for(var i=0;i<filtersArray.length;i++){if(newFilter==filtersArray[i]){filtersArray.splice(i,1);break;}}}
var msecs=time.getTime();var startTime=YAHOO.widget.Logger.getStartTime();var totalTime=msecs-startTime;var elapsedTime=msecs-this.getLastTime();var source=oLogMsg.source;var sourceDetail=oLogMsg.sourceDetail;var sourceAndDetail=(sourceDetail)?source+" "+sourceDetail:source;var msg=this.html2Text(oLogMsg.msg);var output=(this.verboseOutput)?["<p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ","</p><p>",sourceAndDetail,": </p><p>",msg,"</p>"]:["<p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ",sourceAndDetail,": ",msg,"</p>"];return output.join("");};YAHOO.widget.LogReader.prototype.html2Text=function(sHtml){if(sHtml){sHtml+="";return sHtml.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");}
return"";};YAHOO.widget.LogReader._index=0;YAHOO.widget.LogReader.prototype._sName=null;YAHOO.widget.LogReader._elDefaultContainer=null;YAHOO.widget.LogReader.prototype._buffer=null;YAHOO.widget.LogReader.prototype._consoleMsgCount=0;YAHOO.widget.LogReader.prototype._lastTime=null;YAHOO.widget.LogReader.prototype._timeout=null;YAHOO.widget.LogReader.prototype._categoryFilters=null;YAHOO.widget.LogReader.prototype._sourceFilters=null;YAHOO.widget.LogReader.prototype._elContainer=null;YAHOO.widget.LogReader.prototype._elHd=null;YAHOO.widget.LogReader.prototype._elCollapse=null;YAHOO.widget.LogReader.prototype._btnCollapse=null;YAHOO.widget.LogReader.prototype._title=null;YAHOO.widget.LogReader.prototype._elConsole=null;YAHOO.widget.LogReader.prototype._elFt=null;YAHOO.widget.LogReader.prototype._elBtns=null;YAHOO.widget.LogReader.prototype._elCategoryFilters=null;YAHOO.widget.LogReader.prototype._elSourceFilters=null;YAHOO.widget.LogReader.prototype._btnPause=null;YAHOO.widget.LogReader.prototype._btnClear=null;YAHOO.widget.LogReader.prototype._createCategoryCheckbox=function(sCategory){var oSelf=this;if(this._elFt){var elParent=this._elCategoryFilters;var filters=this._categoryFilters;var elFilter=elParent.appendChild(document.createElement("span"));elFilter.className="yui-log-filtergrp";var chkCategory=document.createElement("input");chkCategory.id="yui-log-filter-"+sCategory+this._sName;chkCategory.className="yui-log-filter-"+sCategory;chkCategory.type="checkbox";chkCategory.category=sCategory;chkCategory=elFilter.appendChild(chkCategory);chkCategory.checked=true;filters.push(sCategory);YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);var lblCategory=elFilter.appendChild(document.createElement("label"));lblCategory.htmlFor=chkCategory.id;lblCategory.className=sCategory;lblCategory.innerHTML=sCategory;}};YAHOO.widget.LogReader.prototype._createSourceCheckbox=function(sSource){var oSelf=this;if(this._elFt){var elParent=this._elSourceFilters;var filters=this._sourceFilters;var elFilter=elParent.appendChild(document.createElement("span"));elFilter.className="yui-log-filtergrp";var chkSource=document.createElement("input");chkSource.id="yui-log-filter"+sSource+this._sName;chkSource.className="yui-log-filter"+sSource;chkSource.type="checkbox";chkSource.source=sSource;chkSource=elFilter.appendChild(chkSource);chkSource.checked=true;filters.push(sSource);YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);var lblSource=elFilter.appendChild(document.createElement("label"));lblSource.htmlFor=chkSource.id;lblSource.className=sSource;lblSource.innerHTML=sSource;}};YAHOO.widget.LogReader.prototype._filterLogs=function(){if(this._elConsole!==null){this._clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}};YAHOO.widget.LogReader.prototype._clearConsole=function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;this._lastTime=YAHOO.widget.Logger.getStartTime();var elConsole=this._elConsole;while(elConsole.hasChildNodes()){elConsole.removeChild(elConsole.firstChild);}};YAHOO.widget.LogReader.prototype._printBuffer=function(){this._timeout=null;if(this._elConsole!==null){var thresholdMax=this.thresholdMax;thresholdMax=(thresholdMax&&!isNaN(thresholdMax))?thresholdMax:500;if(this._consoleMsgCount<thresholdMax){var entries=[];for(var i=0;i<this._buffer.length;i++){entries[i]=this._buffer[i];}
this._buffer=[];this._printToConsole(entries);}
else{this._filterLogs();}
if(!this.newestOnTop){this._elConsole.scrollTop=this._elConsole.scrollHeight;}}};YAHOO.widget.LogReader.prototype._printToConsole=function(aEntries){var entriesLen=aEntries.length;var thresholdMin=this.thresholdMin;if(isNaN(thresholdMin)||(thresholdMin>this.thresholdMax)){thresholdMin=0;}
var entriesStartIndex=(entriesLen>thresholdMin)?(entriesLen-thresholdMin):0;var sourceFiltersLen=this._sourceFilters.length;var categoryFiltersLen=this._categoryFilters.length;for(var i=entriesStartIndex;i<entriesLen;i++){var okToPrint=false;var okToFilterCats=false;var entry=aEntries[i];var source=entry.source;var category=entry.category;for(var j=0;j<sourceFiltersLen;j++){if(source==this._sourceFilters[j]){okToFilterCats=true;break;}}
if(okToFilterCats){for(var k=0;k<categoryFiltersLen;k++){if(category==this._categoryFilters[k]){okToPrint=true;break;}}}
if(okToPrint){var output=this.formatMsg(entry);var container=(this.verboseOutput)?"CODE":"PRE";var oNewElement=(this.newestOnTop)?this._elConsole.insertBefore(document.createElement(container),this._elConsole.firstChild):this._elConsole.appendChild(document.createElement(container));oNewElement.innerHTML=output;this._consoleMsgCount++;this._lastTime=entry.time.getTime();}}};YAHOO.widget.LogReader.prototype._onCategoryCreate=function(sType,aArgs,oSelf){var category=aArgs[0];if(oSelf._elFt){oSelf._createCategoryCheckbox(category);}};YAHOO.widget.LogReader.prototype._onSourceCreate=function(sType,aArgs,oSelf){var source=aArgs[0];if(oSelf._elFt){oSelf._createSourceCheckbox(source);}};YAHOO.widget.LogReader.prototype._onCheckCategory=function(v,oSelf){var newFilter=this.category;var filtersArray=oSelf._categoryFilters;if(!this.checked){for(var i=0;i<filtersArray.length;i++){if(newFilter==filtersArray[i]){filtersArray.splice(i,1);break;}}}
else{filtersArray.push(newFilter);}
oSelf._filterLogs();};YAHOO.widget.LogReader.prototype._onCheckSource=function(v,oSelf){var newFilter=this.source;var filtersArray=oSelf._sourceFilters;if(!this.checked){for(var i=0;i<filtersArray.length;i++){if(newFilter==filtersArray[i]){filtersArray.splice(i,1);break;}}}
else{filtersArray.push(newFilter);}
oSelf._filterLogs();};YAHOO.widget.LogReader.prototype._onClickCollapseBtn=function(v,oSelf){var btn=oSelf._collapseBtn;if(btn.value=="Expand"){oSelf._consoleEl.style.display="block";if(oSelf._ftEl){oSelf._ftEl.style.display="block";}
oSelf._filterLogs();};YAHOO.widget.LogReader.prototype._onClickCollapseBtn=function(v,oSelf){var btn=oSelf._btnCollapse;if(btn.value=="Expand"){oSelf._elConsole.style.display="block";if(oSelf._elFt){oSelf._elFt.style.display="block";}
btn.value="Collapse";}
else{oSelf._consoleEl.style.display="none";if(oSelf._ftEl){oSelf._ftEl.style.display="none";}
btn.value="Expand";}};YAHOO.widget.LogReader.prototype._onClickPauseBtn=function(v,oSelf){var btn=oSelf._pauseBtn;if(btn.value=="Resume"){oSelf.resume();btn.value="Pause";}
else{oSelf.pause();btn.value="Resume";}};YAHOO.widget.LogReader.prototype._onClickClearBtn=function(v,oSelf){oSelf._clearConsole();};YAHOO.widget.LogReader.prototype._onNewLog=function(type,args,oSelf){var logEntry=args[0];oSelf._buffer.push(logEntry);if(oSelf.logReaderEnabled===true&&oSelf._timeout===null){oSelf._timeout=setTimeout(function(){oSelf._printBuffer();},100);}};
else{oSelf._elConsole.style.display="none";if(oSelf._elFt){oSelf._elFt.style.display="none";}
btn.value="Expand";}};YAHOO.widget.LogReader.prototype._onClickPauseBtn=function(v,oSelf){var btn=oSelf._btnPause;if(btn.value=="Resume"){oSelf.resume();btn.value="Pause";}
else{oSelf.pause();btn.value="Resume";}};YAHOO.widget.LogReader.prototype._onClickClearBtn=function(v,oSelf){oSelf._clearConsole();};YAHOO.widget.LogReader.prototype._onNewLog=function(sType,aArgs,oSelf){var logEntry=aArgs[0];oSelf._buffer.push(logEntry);if(oSelf.logReaderEnabled===true&&oSelf._timeout===null){oSelf._timeout=setTimeout(function(){oSelf._printBuffer();},100);}};YAHOO.widget.LogReader.prototype._onReset=function(sType,aArgs,oSelf){oSelf._filterLogs();};YAHOO.widget.Logger={loggerEnabled:true,_browserConsoleEnabled:false,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],maxStackEntries:2500,_startTime:new Date().getTime(),_lastTime:null};YAHOO.widget.Logger.log=function(sMsg,sCategory,sSource){if(this.loggerEnabled){if(!sCategory){sCategory="info";}
else{sCategory=sCategory.toLocaleLowerCase();if(this._isNewCategory(sCategory)){this._createNewCategory(sCategory);}}
var sClass="global";var sDetail=null;if(sSource){var spaceIndex=sSource.indexOf(" ");if(spaceIndex>0){sClass=sSource.substring(0,spaceIndex);sDetail=sSource.substring(spaceIndex,sSource.length);}
else{sClass=sSource;}
if(this._isNewSource(sClass)){this._createNewSource(sClass);}}
var timestamp=new Date();var logEntry=new YAHOO.widget.LogMsg({msg:sMsg,time:timestamp,category:sCategory,source:sClass,sourceDetail:sDetail});var stack=this._stack;var maxStackEntries=this.maxStackEntries;if(maxStackEntries&&!isNaN(maxStackEntries)&&(stack.length>=maxStackEntries)){stack.shift();}
stack.push(logEntry);this.newLogEvent.fire(logEntry);if(this._browserConsoleEnabled){this._printToBrowserConsole(logEntry);}
return true;}
else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(sCategory){this.categories.push(sCategory);this.categoryCreateEvent.fire(sCategory);};YAHOO.widget.Logger._isNewCategory=function(sCategory){for(var i=0;i<this.categories.length;i++){if(sCategory==this.categories[i]){return false;}}
return true;};YAHOO.widget.Logger._createNewSource=function(sSource){this.sources.push(sSource);this.sourceCreateEvent.fire(sSource);};YAHOO.widget.Logger._isNewSource=function(sSource){if(sSource){for(var i=0;i<this.sources.length;i++){if(sSource==this.sources[i]){return false;}}
return true;}};YAHOO.widget.Logger._printToBrowserConsole=function(oEntry){if(window.console&&console.log){var category=oEntry.category;var label=oEntry.category.substring(0,4).toUpperCase();var time=oEntry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
else{localTime=time.toString();}
var msecs=time.getTime();var elapsedTime=(YAHOO.widget.Logger._lastTime)?(msecs-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=msecs;var output=localTime+" ("+
elapsedTime+"ms): "+
oEntry.source+": "+
oEntry.msg;console.log(output);}};YAHOO.widget.Logger._onWindowError=function(sMsg,sUrl,sLine){try{YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')',"window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}
catch(e){return false;}};if(window.onerror){YAHOO.widget.Logger._origOnWindowError=window.onerror;}
window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger.log("Logger initialized");

1493
lib/yui/logger/logger.js vendored

File diff suppressed because it is too large Load diff

View file

@ -73,10 +73,152 @@ Fixed the following bugs:
* Users can now control or shift-click on MenuItem links
Changes
-------
Changes:
--------
* In the Menu stylesheet (menu.css), switched from using "first" class to
"first-of-type" class
* Changed case of MenuModuleItem class's "subMenuIndicator" property
to "submenuIndicator"
*** version 0.11.3 ***
Added the following features:
-----------------------------
* Added a "target" configuration property to the MenuModuleItem object that
allows the user to specify the target of an item's anchor element. Items
that make use of the "target" configuration property will require the user
to click exactly on the item's anchor element to navigate to the specified
URL.
* Items without a "url" property set will automatically hide their parent
menu instance(s) when clicked.
Fixed the following bugs:
-------------------------
* Items in a submenu should now navigate to their specified URL when clicked.
* Removed MenuBar's use of "overflow:hidden." This fixes an issue in Firefox
1.5 in which submenus of a Menubar instance cannot overlay other absolutely
positioned elements on the page.
* Submenus of a Menubar instance will now automatically have their iframe shim
enabled in IE<7.
* Statically positioned Menubar and Menu instances will now render with the
correct position and dimensions in Safari.
* MenuModuleItem's "focus" method now checks to make sure that an item's
"display" style property is not "none" before trying to set focus to its
anchor element.
* A ContextMenu instance will now hide all other ContextMenu instances before
displaying itself.
* Removed the dead space in front of an item's submenu indicator image in IE.
This space was causing an item's submenu to flicker when the user hovered
over it.
Changes:
--------
* Moved the DOM event handlers for every menu from the root DIV node of each
instance to the document object. This change reduces the number of DOM event
handlers used by Menu to eight, improving the cleanup time required by the
Event utility.
*** version 0.12 ***
Added the following features:
-----------------------------
* Added the YAHOO.widget.MenuManager singleton class.
* Added two new methods to YAHOO.widget.Menu:
* "addItems" - Adds an array of items to a menu.
* "getRoot" - Returns the root menu in a menu hierarchy.
* Added two new events to YAHOO.widget.Menu:
* "itemAddedEvent" - Fires when an item is added to a menu.
* "itemRemovedEvent" - Fires when an item is removed from a menu.
* Added two new properties to YAHOO.widget.Menu:
* "itemData" - Array of items to be added to the menu.
* "lazyLoad" - Boolean indicating if the menu's "lazy load" feature
is enabled.
* Added new configuration properties to YAHOO.widget.Menu:
* "hidedelay" - Hides the menu after the specified number of milliseconds.
* "showdelay" - Shows the menu after the specified number of milliseconds.
* "container" - The containing element the menu should be rendered into.
* "clicktohide" - Boolean indicating if the menu will automatically be
hidden if the user clicks outside of it.
* "autosubmenudisplay" - Boolean indicating if submenus are automatically
made visible when the user mouses over the menu's items.
* Added a "toString" method to YAHOO.widget.MenuItem, YAHOO.widget.MenuBarItem
and YAHOO.widget.ContextMenuItem that returns the class name followed by the
value of the item's "text" configuration property.
Fixed the following bugs:
-------------------------
* Setting a YAHOO.widget.ContextMenu instance's "trigger" configuration
property will remove all previous triggers before setting up the new ones.
* "destroy" method of YAHOO.widget.ContextMenu cleans up all DOM event handlers.
* Clicking on a menu item with a submenu no longer hides/collapses the
entire menu.
* Clicking an item's submenu indicator image no longer collapses the
entire menu.
Changes:
--------
* Deprecated the YAHOO.widget.MenuModule and YAHOO.widget.MenuModuleItem
classes. The Base classes are now YAHOO.widget.Menu and
YAHOO.widget.MenuItem.
* "addItem" and "insertItem" methods of YAHOO.widget.Menu now accept an
object literal representing YAHOO.widget.MenuItem configuration properties.
* "clearActiveItem" now takes an argument: flag indicating if the Menu
instance's active item should be blurred.
* Switched the default value of the "visible" configuration property for
YAHOO.widget.Menu to "false."
* Switched the default value of the "constraintoviewport" configuration
property for YAHOO.widget.Menu to "true."
* Overloaded the "submenu" configuration property for YAHOO.widget.MenuItem
so that it now can accept any of the following:
* YAHOO.widget.Menu instance
* Object literal representation of a menu
* Element id
* Element reference
* "hide" and "show" methods of statically positioned menus now toggle the their
element's "display" style property between "block" and "none."

View file

@ -1,23 +1,31 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
Version 0.11.0
http://developer.yahoo.com/yui/license.txt
Version: 0.12
*/
/* Menu styles */
div.yuimenu {
z-index:1;
visibility:hidden;
background-color:#f6f7ee;
border:solid 1px #c4c4be;
padding:1px;
}
/* Submenus are positioned absolute and hidden by default */
div.yuimenu div.yuimenu,
div.yuimenubar div.yuimenu {
position:absolute;
visibility:hidden;
}
/* MenuBar Styles */
@ -28,12 +36,12 @@ div.yuimenubar {
}
/*
Application of "zoom:1" triggers "haslayout" in IE so that the module's
Applying a width triggers "haslayout" in IE so that the module's
body clears its floated elements
*/
div.yuimenubar div.bd {
zoom:1;
width:100%;
}
@ -90,7 +98,6 @@ div.yuimenubar ul {
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
}
@ -263,7 +270,8 @@ div.yuimenu li.yuimenuitem img {
height:8px;
width:8px;
margin:0 -16px 0 10px;
margin:0 -16px 0 0;
padding-left:10px;
border:0;
}
@ -279,10 +287,11 @@ div.yuimenu li.checked img.checked {
height:8px;
width:8px;
margin:0;
padding:0;
border:0;
position:absolute;
left:6px;
_left:-16px; /* Underscore hack b/c this is for IE 5.5 and IE 6 only */
_left:-16px; /* Underscore hack b/c this is for IE 6 only */
top:.5em;
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

6921
lib/yui/menu/menu.js vendored

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,8 @@
YUI Library - Reset+Fonts+Grids (RFG) - Release Notes
Version 0.12.0
* Initial release.
* This file is a convenience file containing an in-order
concatenation of Reset, Fonts, and Grids.

View file

@ -0,0 +1,4 @@
/*Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
/*reset.css*/body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}
/*fonts.css*/body{font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
/*grids.css*/body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}

View file

@ -0,0 +1,174 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.12.0
*/
/*=============*/
/* reset.css */
/*=============*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
fieldset,img{border:0;}
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
ol,ul {list-style:none;}
caption,th {text-align:left;}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
q:before,q:after{content:'';}
abbr,acronym {border:0;}
/*=============*/
/* fonts.css */
/*=============*/
/**
* 84.5% for !IE, keywords for IE to preserve user font-size adjustment
* Percents could work for IE, but for backCompat purposes, we are using keywords.
* x-small is for IE6/7 quirks mode.
*
*/
body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
table {font-size:inherit;font:100%;}
/**
* 99% for safari; 100% is too large
*/
select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}
/**
* Bump up !IE to get to 13px equivalent
*/
pre, code {font:115% monospace;*font-size:100%;}
/**
* Default line-height based on font-size rather than "computed-value"
* see: http://www.w3.org/TR/CSS21/visudet.html#line-height
*/
body * {line-height:1.22em;}
/*=============*/
/* grids.css */
/*=============*/
/* for all templates and grids */
body{text-align:center;}
#ft{clear:both;}
/**/
/* 750 centered, and backward compatibility */
#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {
margin:auto;text-align:left;
width:57.69em;*width:56.3em;min-width:750px;}
/* 950 centered */
#doc2 {
width:73.074em;*width:71.313em;min-width:950px;}
/* 100% with 10px viewport side matting */
#doc3 {
margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */
width:auto;}
/* below required for all fluid grids; adjust widths and margins above accordingly */
/* to preserve source-order independence for Gecko */
.yui-b{position:relative;}
.yui-b{_position:static;} /* for IE < 7 */
#yui-main .yui-b{position:static;}
#yui-main {width:100%;}
.yui-t1 #yui-main,
.yui-t2 #yui-main,
.yui-t3 #yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}
.yui-t4 #yui-main,
.yui-t5 #yui-main,
.yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}
.yui-t1 .yui-b {
float:left;
width:12.3207em;*width:12.0106em;}
.yui-t1 #yui-main .yui-b{
margin-left:13.3207em;*margin-left:13.0106em;
}
.yui-t2 .yui-b {
float:left;
width:13.8456em;*width:13.512em;}
.yui-t2 #yui-main .yui-b {
margin-left:14.8456em;*margin-left:14.512em;
}
.yui-t3 .yui-b {
float:left;
width:23.0759em;*width:22.52em;}
.yui-t3 #yui-main .yui-b {
margin-left:24.0759em;*margin-left:23.52em;
}
.yui-t4 .yui-b {
float:right;
width:13.8456em;*width:13.512em;}
.yui-t4 #yui-main .yui-b {
margin-right:14.8456em;*margin-right:14.512em;
}
.yui-t5 .yui-b {
float:right;
width:18.4608em;*width:18.016em;}
.yui-t5 #yui-main .yui-b {
margin-right:19.4608em;*margin-right:19.016em;
}
.yui-t6 .yui-b {
float:right;
width:23.0759em;*width:22.52em;}
.yui-t6 #yui-main .yui-b {
margin-right:24.0759em;*margin-right:23.52em;
}
.yui-t7 #yui-main .yui-b {
display:block;margin:0 0 1em 0;
}
#yui-main .yui-b {float:none;width:auto;}
/* GRIDS (not TEMPLATES) */
.yui-g .yui-u,
.yui-g .yui-g,
.yui-gc .yui-u,
.yui-gc .yui-g .yui-u,
.yui-ge .yui-u,
.yui-gf .yui-u{float:right;display:inline;}
.yui-g div.first,
.yui-gc div.first,
.yui-gc div.first div.first,
.yui-gd div.first,
.yui-ge div.first,
.yui-gf div.first{float:left;}
.yui-g .yui-u,
.yui-g .yui-g{width:49.1%;}
.yui-g .yui-g .yui-u,
.yui-gc .yui-g .yui-u {width:48.1%;}
.yui-gb .yui-u,
.yui-gc .yui-u,
.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}
.yui-gb div.first,
.yui-gc div.first,
.yui-gd div.first{margin-left:0;}
.yui-gc div.first,
.yui-gd .yui-u{width:66%;}
.yui-gd div.first{width:32%;}
.yui-ge .yui-u{width:24%;}
.yui-ge div.first,
.yui-gf .yui-u{width:74.2%;}
.yui-gf div.first{width:24%;}
.yui-ge div.first{width:74.2%;}
#bd:after,
.yui-g:after,
.yui-gb:after,
.yui-gc:after,
.yui-gd:after,
.yui-ge:after,
.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
#bd,
.yui-g,
.yui-gb,
.yui-gc,
.yui-gd,
.yui-ge,
.yui-gf{zoom:1;}

View file

@ -1,9 +1,17 @@
CSS Reset Release Notes
YUI Library - Reset - Release Notes
*** version 0.11.0 ***
Version 0.12.0
* Added: h1,h2,h3,h4,h5,h6{font-weight:normal;}
* Added: abbr,acronym {border:0;}
* Added: textarea {padding:0;margin:0;}
Version 0.11.0
* No changes.
*** version 0.10.0 ***
Version 0.10.0
* Initial release
* Initial release.

View file

@ -1,7 +1 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';}
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}

View file

@ -2,13 +2,14 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
version: 0.12.0
*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
fieldset,img{border:0;}
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
ol,ul {list-style:none;}
caption,th {text-align:left;}
h1,h2,h3,h4,h5,h6{font-size:100%;}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
q:before,q:after{content:'';}
abbr,acronym {border:0;}

View file

@ -1,5 +1,30 @@
Slider - Release Notes
0.12.0
* Added "slideStart", "slideEnd", and "change" custom events. The abstract
methods these will eventually replace still work.
* The default animation duration is 0.2 seconds (reduced from 0.4 seconds),
and is configurable via the animationDuration property.
* Keyboard navigation is now built in. The background needs a tabindex for
keyboard nav to work. Keyboard nav can be disabled by setting enableKeys
to false. The number of pixels the slider moves when the arrow keys
are pressed is controlled by keyIncrement, and defaults to 20. Note,
Safari support limited to background element types that support focus
in that browser. http://bugs.webkit.org/show_bug.cgi?id=7138
* Fixed broken doctype in examples/index.html
* Catching an unhandled script exception in FF that could occur when
attempting to focus the slider background while a text field without
autocomplete="false" has focus
0.11.3
* No change
0.11.0
* When the thumb is clicked and dragged, the click position delta is properly

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

6
lib/yui/tabview/README Executable file
View file

@ -0,0 +1,6 @@
Tabview Release Notes
*** version 0.12.0 ***
* Initial release

1951
lib/yui/tabview/tabview-debug.js vendored Executable file

File diff suppressed because it is too large Load diff

1
lib/yui/tabview/tabview-min.js vendored Executable file

File diff suppressed because one or more lines are too long

1950
lib/yui/tabview/tabview.js vendored Executable file

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,35 @@
TreeView - Release Notes
0.12.0
* TreeView now augments EventProvider, and has custom events for expand,
collapse, animStart, animComplete, and labelClick. Existing implementations
using abstract methods for these events (if they exist) will still work.
New events can be plugged into the tree by the Node implementation. For
example, TaskNode adds a checkClick event. EventProvider makes it safe
to do this because implementing code can call subscribe() prior to the
event creation.
* YAHOO.util.Event is now a requirement for the widget
* TreeView::removeChildren no longer expands and collapses the node.
* Documented the moveComplete property
* createElement("DIV") changed to createElement("div")
0.11.4
* Fixed a javascript error on the HTML node example page.
0.11.3
* popNode now clears the tree, previousSibling, nextSibling, and parent
properties of the node that is being removed from the tree.
* Fixed the paths to the images in the tree.css file that is included in
build/assets.
0.11.0
* Added TreeView -> popNode, which differs from removeNode in that the

View file

@ -3,81 +3,81 @@
/* first or middle sibling, no children */
.ygtvtn {
width:16px; height:22px;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tn.gif) 0 0 no-repeat;
background: url(tn.gif) 0 0 no-repeat;
}
/* first or middle sibling, collapsable */
.ygtvtm {
width:16px; height:22px;
cursor:pointer ;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tm.gif) 0 0 no-repeat;
background: url(tm.gif) 0 0 no-repeat;
}
/* first or middle sibling, collapsable, hover */
.ygtvtmh {
width:16px; height:22px;
cursor:pointer ;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tmh.gif) 0 0 no-repeat;
background: url(tmh.gif) 0 0 no-repeat;
}
/* first or middle sibling, expandable */
.ygtvtp {
width:16px; height:22px;
cursor:pointer ;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tp.gif) 0 0 no-repeat;
background: url(tp.gif) 0 0 no-repeat;
}
/* first or middle sibling, expandable, hover */
.ygtvtph {
width:16px; height:22px;
cursor:pointer ;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tph.gif) 0 0 no-repeat;
background: url(tph.gif) 0 0 no-repeat;
}
/* last sibling, no children */
.ygtvln {
width:16px; height:22px;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/ln.gif) 0 0 no-repeat;
background: url(ln.gif) 0 0 no-repeat;
}
/* Last sibling, collapsable */
.ygtvlm {
width:16px; height:22px;
cursor:pointer ;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/lm.gif) 0 0 no-repeat;
background: url(lm.gif) 0 0 no-repeat;
}
/* Last sibling, collapsable, hover */
.ygtvlmh {
width:16px; height:22px;
cursor:pointer ;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/lmh.gif) 0 0 no-repeat;
background: url(lmh.gif) 0 0 no-repeat;
}
/* Last sibling, expandable */
.ygtvlp {
width:16px; height:22px;
cursor:pointer ;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/lp.gif) 0 0 no-repeat;
background: url(lp.gif) 0 0 no-repeat;
}
/* Last sibling, expandable, hover */
.ygtvlph {
width:16px; height:22px; cursor:pointer ;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/lph.gif) 0 0 no-repeat;
background: url(lph.gif) 0 0 no-repeat;
}
/* Loading icon */
.ygtvloading {
width:16px; height:22px;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/loading.gif) 0 0 no-repeat;
background: url(loading.gif) 0 0 no-repeat;
}
/* the style for the empty cells that are used for rendering the depth
* of the node */
.ygtvdepthcell {
width:16px; height:22px;
background: url(../../../../../../../i/us/nt/widg/tree/dflt/vline.gif) 0 0 no-repeat;
background: url(vline.gif) 0 0 no-repeat;
}
.ygtvblankdepthcell { width:16px; height:22px; }

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

23
lib/yui/yahoo-dom-event/README Executable file
View file

@ -0,0 +1,23 @@
yahoo-event-dom.js Release Notes
*** version 0.12.0 ***
The yahoo-event-dom.js file rolls up the three most commonly-used YUI Utilities
into a single file; it includes the following files:
* Yahoo Global Object
* Event
* Dom
These three files serve as a common foundation for most YUI components and
third-party implementations. On pages where you do not need additional YUI
Utilities (Connection Manager, Animation Utility, Drag & Drop Utility), the
yahoo-event-dom.js aggregate will often be an optimal choice.
Note: If you do require additional utilities, the full utilities.js file is
provided in this distribution; utilities.js includes all YUI Utilities in a
single file.
Please see the blog article on www.yuiblog.com titled "YUI: Weighing in on
Pageweights" at http://yuiblog.com/blog/2006/10/16/pageweight-yui0114/ for more
details.

1
lib/yui/yahoo-dom-event/yahoo-dom-event.js vendored Executable file

File diff suppressed because one or more lines are too long

View file

@ -1,10 +1,37 @@
YAHOO Global Namespace - Release Notes
0.12.0
* Added YAHOO.augment, which copies all or part of the prototype of one
object to another.
* YAHOO.namespace now can create multiple namespaces.
* Added an optional third parameter to YAHOO.extend: overrides. It takes
an object literal of properties/methods to apply to the subclass
prototype, overriding the superclass if present.
0.11.4
* Changed window.YAHOO = window.YAHOO || {} to
if (typeof YAHOO == "undefined") YAHOO = {} because the previous statement
contributed to a memory leak in IE6 when the library was hosted in an
iframe.
0.11.3
* Changed var YAHOO = window.YAHOO || {} to window.YAHOO = window.YAHOO || {}.
This fixes an issue in IE where YAHOO would get overwritten if previously
defined via array notation (window["YAHOO"]).
0.11.0
* Added YAHOO.extend, which provides an easy way to assign the prototype,
constructor, and superclass properties inheritance properties. It also
prevents the constructor of the superclass from being exectuted twice.
0.10.0
* Added YAHOO.log that provides a safe way to plumb logging statements in
code that will work if the logging component isn't available.

View file

@ -1,61 +1,81 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
version: 0.12.0
*/
/**
* The Yahoo global namespace
* @constructor
* The YAHOO object is the single global object used by YUI Library. It
* contains utility function for setting up namespaces, inheritance, and
* logging. YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces
* created automatically for and used by the library.
* @module yahoo
* @title YAHOO Global
*/
var YAHOO = window.YAHOO || {};
/**
* The YAHOO global namespace object
* @class YAHOO
* @static
*/
if (typeof YAHOO == "undefined") {
var YAHOO = {};
}
/**
* Returns the namespace specified and creates it if it doesn't exist
*
* <pre>
* YAHOO.namespace("property.package");
* YAHOO.namespace("YAHOO.property.package");
*
* </pre>
* Either of the above would create YAHOO.property, then
* YAHOO.property.package
*
* @param {String} ns The name of the namespace
* @return {Object} A reference to the namespace object
* Be careful when naming packages. Reserved words may work in some browsers
* and not others. For instance, the following will fail in Safari:
* <pre>
* YAHOO.namespace("really.long.nested.namespace");
* </pre>
* This fails because "long" is a future reserved word in ECMAScript
*
* @method namespace
* @static
* @param {String*} arguments 1-n namespaces to create
* @return {Object} A reference to the last namespace object created
*/
YAHOO.namespace = function(ns) {
if (!ns || !ns.length) {
return null;
}
var levels = ns.split(".");
var nsobj = YAHOO;
YAHOO.namespace = function() {
var a=arguments, o=null, i, j, d;
for (i=0; i<a.length; ++i) {
d=a[i].split(".");
o=YAHOO;
// YAHOO is implied, so it is ignored if it is included
for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {
nsobj[levels[i]] = nsobj[levels[i]] || {};
nsobj = nsobj[levels[i]];
for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; ++j) {
o[d[j]]=o[d[j]] || {};
o=o[d[j]];
}
}
return nsobj;
return o;
};
/**
* Uses YAHOO.widget.Logger to output a log message, if the widget is available.
*
* @param {string} sMsg The message to log.
* @param {string} sCategory The log category for the message. Default
* @method log
* @static
* @param {String} msg The message to log.
* @param {String} cat The log category for the message. Default
* categories are "info", "warn", "error", time".
* Custom categories can be used as well. (opt)
* @param {string} sSource The source of the the message (opt)
* @return {boolean} True if the log operation was successful.
* @param {String} src The source of the the message (opt)
* @return {Boolean} True if the log operation was successful.
*/
YAHOO.log = function(sMsg, sCategory, sSource) {
YAHOO.log = function(msg, cat, src) {
var l=YAHOO.widget.Logger;
if(l && l.log) {
return l.log(sMsg, sCategory, sSource);
return l.log(msg, cat, src);
} else {
return false;
}
@ -65,21 +85,61 @@ YAHOO.log = function(sMsg, sCategory, sSource) {
* Utility to set up the prototype, constructor and superclass properties to
* support an inheritance strategy that can chain constructors and methods.
*
* @param {Function} subclass the object to modify
* @param {Function} superclass the object to inherit
* @method extend
* @static
* @param {Function} subc the object to modify
* @param {Function} superc the object to inherit
* @param {String[]} overrides additional properties/methods to add to the
* subclass prototype. These will override the
* matching items obtained from the superclass
* if present.
*/
YAHOO.extend = function(subclass, superclass) {
var f = function() {};
f.prototype = superclass.prototype;
subclass.prototype = new f();
subclass.prototype.constructor = subclass;
subclass.superclass = superclass.prototype;
if (superclass.prototype.constructor == Object.prototype.constructor) {
superclass.prototype.constructor = superclass;
YAHOO.extend = function(subc, superc, overrides) {
var F = function() {};
F.prototype=superc.prototype;
subc.prototype=new F();
subc.prototype.constructor=subc;
subc.superclass=superc.prototype;
if (superc.prototype.constructor == Object.prototype.constructor) {
superc.prototype.constructor=superc;
}
if (overrides) {
for (var i in overrides) {
subc.prototype[i]=overrides[i];
}
}
};
YAHOO.namespace("util");
YAHOO.namespace("widget");
YAHOO.namespace("example");
/**
* Applies all prototype properties in the supplier to the receiver if the
* receiver does not have these properties yet. Optionally, one or more
* methods/properties can be specified (as additional parameters). This
* option will overwrite the property if receiver has it already.
*
* @method augment
* @static
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @param {String*} arguments zero or more properties methods to augment the
* receiver with. If none specified, everything
* in the supplier will be used unless it would
* overwrite an existing property in the receiver
*/
YAHOO.augment = function(r, s) {
var rp=r.prototype, sp=s.prototype, a=arguments, i, p;
if (a[2]) {
for (i=2; i<a.length; ++i) {
rp[a[i]] = sp[a[i]];
}
} else {
for (p in sp) {
if (!rp[p]) {
rp[p] = sp[p];
}
}
}
};
YAHOO.namespace("util", "widget", "example");

View file

@ -1 +1 @@
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.11.0 */ var YAHOO=window.YAHOO||{};YAHOO.namespace=function(ns){if(!ns||!ns.length){return null;}var _2=ns.split(".");var _3=YAHOO;for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){_3[_2[i]]=_3[_2[i]]||{};_3=_3[_2[i]];}return _3;};YAHOO.log=function(_5,_6,_7){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_5,_6,_7);}else{return false;}};YAHOO.extend=function(_9,_10){var f=function(){};f.prototype=_10.prototype;_9.prototype=new f();_9.prototype.constructor=_9;_9.superclass=_10.prototype;if(_10.prototype.constructor==Object.prototype.constructor){_10.prototype.constructor=_10;}};YAHOO.namespace("util");YAHOO.namespace("widget");YAHOO.namespace("example");
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ if(typeof YAHOO=="undefined"){var YAHOO={};}YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(_2,_3,_4){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_2,_3,_4);}else{return false;}};YAHOO.extend=function(_6,_7,_8){var F=function(){};F.prototype=_7.prototype;_6.prototype=new F();_6.prototype.constructor=_6;_6.superclass=_7.prototype;if(_7.prototype.constructor==Object.prototype.constructor){_7.prototype.constructor=_7;}if(_8){for(var i in _8){_6.prototype[i]=_8[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");

139
lib/yui/yahoo/yahoo.js vendored
View file

@ -2,59 +2,80 @@
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
version: 0.12.0
*/
/**
* The Yahoo global namespace
* @constructor
* The YAHOO object is the single global object used by YUI Library. It
* contains utility function for setting up namespaces, inheritance, and
* logging. YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces
* created automatically for and used by the library.
* @module yahoo
* @title YAHOO Global
*/
var YAHOO = window.YAHOO || {};
/**
* The YAHOO global namespace object
* @class YAHOO
* @static
*/
if (typeof YAHOO == "undefined") {
var YAHOO = {};
}
/**
* Returns the namespace specified and creates it if it doesn't exist
*
* <pre>
* YAHOO.namespace("property.package");
* YAHOO.namespace("YAHOO.property.package");
*
* </pre>
* Either of the above would create YAHOO.property, then
* YAHOO.property.package
*
* @param {String} ns The name of the namespace
* @return {Object} A reference to the namespace object
* Be careful when naming packages. Reserved words may work in some browsers
* and not others. For instance, the following will fail in Safari:
* <pre>
* YAHOO.namespace("really.long.nested.namespace");
* </pre>
* This fails because "long" is a future reserved word in ECMAScript
*
* @method namespace
* @static
* @param {String*} arguments 1-n namespaces to create
* @return {Object} A reference to the last namespace object created
*/
YAHOO.namespace = function(ns) {
if (!ns || !ns.length) {
return null;
}
var levels = ns.split(".");
var nsobj = YAHOO;
YAHOO.namespace = function() {
var a=arguments, o=null, i, j, d;
for (i=0; i<a.length; ++i) {
d=a[i].split(".");
o=YAHOO;
// YAHOO is implied, so it is ignored if it is included
for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {
nsobj[levels[i]] = nsobj[levels[i]] || {};
nsobj = nsobj[levels[i]];
for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; ++j) {
o[d[j]]=o[d[j]] || {};
o=o[d[j]];
}
}
return nsobj;
return o;
};
/**
* Uses YAHOO.widget.Logger to output a log message, if the widget is available.
*
* @param {string} sMsg The message to log.
* @param {string} sCategory The log category for the message. Default
* @method log
* @static
* @param {String} msg The message to log.
* @param {String} cat The log category for the message. Default
* categories are "info", "warn", "error", time".
* Custom categories can be used as well. (opt)
* @param {string} sSource The source of the the message (opt)
* @return {boolean} True if the log operation was successful.
* @param {String} src The source of the the message (opt)
* @return {Boolean} True if the log operation was successful.
*/
YAHOO.log = function(sMsg, sCategory, sSource) {
YAHOO.log = function(msg, cat, src) {
var l=YAHOO.widget.Logger;
if(l && l.log) {
return l.log(sMsg, sCategory, sSource);
return l.log(msg, cat, src);
} else {
return false;
}
@ -64,21 +85,61 @@ YAHOO.log = function(sMsg, sCategory, sSource) {
* Utility to set up the prototype, constructor and superclass properties to
* support an inheritance strategy that can chain constructors and methods.
*
* @param {Function} subclass the object to modify
* @param {Function} superclass the object to inherit
* @method extend
* @static
* @param {Function} subc the object to modify
* @param {Function} superc the object to inherit
* @param {String[]} overrides additional properties/methods to add to the
* subclass prototype. These will override the
* matching items obtained from the superclass
* if present.
*/
YAHOO.extend = function(subclass, superclass) {
var f = function() {};
f.prototype = superclass.prototype;
subclass.prototype = new f();
subclass.prototype.constructor = subclass;
subclass.superclass = superclass.prototype;
if (superclass.prototype.constructor == Object.prototype.constructor) {
superclass.prototype.constructor = superclass;
YAHOO.extend = function(subc, superc, overrides) {
var F = function() {};
F.prototype=superc.prototype;
subc.prototype=new F();
subc.prototype.constructor=subc;
subc.superclass=superc.prototype;
if (superc.prototype.constructor == Object.prototype.constructor) {
superc.prototype.constructor=superc;
}
if (overrides) {
for (var i in overrides) {
subc.prototype[i]=overrides[i];
}
}
};
YAHOO.namespace("util");
YAHOO.namespace("widget");
YAHOO.namespace("example");
/**
* Applies all prototype properties in the supplier to the receiver if the
* receiver does not have these properties yet. Optionally, one or more
* methods/properties can be specified (as additional parameters). This
* option will overwrite the property if receiver has it already.
*
* @method augment
* @static
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @param {String*} arguments zero or more properties methods to augment the
* receiver with. If none specified, everything
* in the supplier will be used unless it would
* overwrite an existing property in the receiver
*/
YAHOO.augment = function(r, s) {
var rp=r.prototype, sp=s.prototype, a=arguments, i, p;
if (a[2]) {
for (i=2; i<a.length; ++i) {
rp[a[i]] = sp[a[i]];
}
} else {
for (p in sp) {
if (!rp[p]) {
rp[p] = sp[p];
}
}
}
};
YAHOO.namespace("util", "widget", "example");