/* Copyright (c) 2008, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.5.1 */ /** * 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 */ /** * YAHOO_config is not included as part of the library. Instead it is an * object that can be defined by the implementer immediately before * including the YUI library. The properties included in this object * will be used to configure global properties needed as soon as the * library begins to load. * @class YAHOO_config * @static */ /** * A reference to a function that will be executed every time a YAHOO module * is loaded. As parameter, this function will receive the version * information for the module. See * YAHOO.env.getVersion for the description of the version data structure. * @property listener * @type Function * @static * @default undefined */ /** * Set to true if the library will be dynamically loaded after window.onload. * Defaults to false * @property injecting * @type boolean * @static * @default undefined */ /** * Instructs the yuiloader component to dynamically load yui components and * their dependencies. See the yuiloader documentation for more information * about dynamic loading * @property load * @static * @default undefined * @see yuiloader */ /** * Forces the use of the supplied locale where applicable in the library * @property locale * @type string * @static * @default undefined */ if (typeof YAHOO == "undefined" || !YAHOO) { /** * The YAHOO global namespace object. If YAHOO is already defined, the * existing YAHOO object will not be overwritten so that defined * namespaces are preserved. * @class YAHOO * @static */ var YAHOO = {}; } /** * Returns the namespace specified and creates it if it doesn't exist *
 * YAHOO.namespace("property.package");
 * YAHOO.namespace("YAHOO.property.package");
 * 
* Either of the above would create YAHOO.property, then * YAHOO.property.package * * Be careful when naming packages. Reserved words may work in some browsers * and not others. For instance, the following will fail in Safari: *
 * YAHOO.namespace("really.long.nested.namespace");
 * 
* This fails because "long" is a future reserved word in ECMAScript * * @method namespace * @static * @param {String*} arguments 1-n namespaces to create * @return {Object} A reference to the last namespace object created */ YAHOO.namespace = function() { var a=arguments, o=null, i, j, d; for (i=0; i *
name:
The name of the module
*
version:
The version in use
*
build:
The build number in use
*
versions:
All versions that were registered
*
builds:
All builds that were registered.
*
mainClass:
An object that was was stamped with the * current version and build. If * mainClass.VERSION != version or mainClass.BUILD != build, * multiple versions of pieces of the library have been * loaded, potentially causing issues.
* * * @method getVersion * @static * @param {String} name the name of the module (event, slider, etc) * @return {Object} The version info */ YAHOO.env.getVersion = function(name) { return YAHOO.env.modules[name] || null; }; /** * Do not fork for a browser if it can be avoided. Use feature detection when * you can. Use the user agent as a last resort. YAHOO.env.ua stores a version * number for the browser engine, 0 otherwise. This value may or may not map * to the version number of the browser using the engine. The value is * presented as a float so that it can easily be used for boolean evaluation * as well as for looking for a particular range of versions. Because of this, * some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9 * reports 1.8). * @class YAHOO.env.ua * @static */ YAHOO.env.ua = function() { var o={ /** * Internet Explorer version number or 0. Example: 6 * @property ie * @type float */ ie:0, /** * Opera version number or 0. Example: 9.2 * @property opera * @type float */ opera:0, /** * Gecko engine revision number. Will evaluate to 1 if Gecko * is detected but the revision could not be found. Other browsers * will be 0. Example: 1.8 *
         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
         * Firefox 1.5.0.9: 1.8.0.9 <-- Reports 1.8
         * Firefox 2.0.0.3: 1.8.1.3 <-- Reports 1.8
         * Firefox 3 alpha: 1.9a4   <-- Reports 1.9
         * 
* @property gecko * @type float */ gecko:0, /** * AppleWebKit version. KHTML browsers that are not WebKit browsers * will evaluate to 1, other browsers 0. Example: 418.9.1 *
         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the 
         *                                   latest available for Mac OSX 10.3.
         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
         * Safari 2.0.4:         418     <-- preventDefault fixed
         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
         *                                   different versions of webkit
         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
         *                                   updated, but not updated
         *                                   to the latest patch.
         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native SVG
         *                                   and many major issues fixed).  
         * 3.x yahoo.com, flickr:422     <-- Safari 3.x hacks the user agent
         *                                   string when hitting yahoo.com and 
         *                                   flickr.com.
         * Safari 3.0.4 (523.12):523.12  <-- First Tiger release - automatic update
         *                                   from 2.x via the 10.4.11 OS patch
         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event.
         *                                   yahoo.com user agent hack removed.
         *                                   
         * 
* http://developer.apple.com/internet/safari/uamatrix.html * @property webkit * @type float */ webkit: 0, /** * The mobile property will be set to a string containing any relevant * user agent information when a modern mobile browser is detected. * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series * devices with the WebKit-based browser, and Opera Mini. * @property mobile * @type string */ mobile: null, /** * Adobe AIR version number or 0. Only populated if webkit is detected. * Example: 1.0 * @property air * @type float */ air: 0 }; var ua=navigator.userAgent, m; // Modern KHTML browsers should qualify as Safari X-Grade if ((/KHTML/).test(ua)) { o.webkit=1; } // Modern WebKit browsers are at least X-Grade m=ua.match(/AppleWebKit\/([^\s]*)/); if (m&&m[1]) { o.webkit=parseFloat(m[1]); // Mobile browser check if (/ Mobile\//.test(ua)) { o.mobile = "Apple"; // iPhone or iPod Touch } else { m=ua.match(/NokiaN[^\/]*/); if (m) { o.mobile = m[0]; // Nokia N-series, ex: NokiaN95 } } m=ua.match(/AdobeAIR\/([^\s]*)/); if (m) { o.air = m[0]; // Adobe AIR 1.0 or better } } if (!o.webkit) { // not webkit // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr) m=ua.match(/Opera[\s\/]([^\s]*)/); if (m&&m[1]) { o.opera=parseFloat(m[1]); m=ua.match(/Opera Mini[^;]*/); if (m) { o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316 } } else { // not opera or webkit m=ua.match(/MSIE\s([^;]*)/); if (m&&m[1]) { o.ie=parseFloat(m[1]); } else { // not opera, webkit, or ie m=ua.match(/Gecko\/([^\s]*)/); if (m) { o.gecko=1; // Gecko detected, look for revision m=ua.match(/rv:([^\s\)]*)/); if (m&&m[1]) { o.gecko=parseFloat(m[1]); } } } } } return o; }(); /* * Initializes the global by creating the default namespaces and applying * any new configuration information that is detected. This is the setup * for env. * @method init * @static * @private */ (function() { YAHOO.namespace("util", "widget", "example"); if ("undefined" !== typeof YAHOO_config) { var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i; if (l) { // if YAHOO is loaded multiple times we need to check to see if // this is a new config object. If it is, add the new component // load listener to the stack for (i=0;i * var A = function() {}; * A.prototype.foo = 'foo'; * var a = new A(); * a.foo = 'foo'; * alert(a.hasOwnProperty('foo')); // true * alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback * * @method hasOwnProperty * @param {any} o The object being testing * @return {boolean} the result */ hasOwnProperty: function(o, prop) { if (Object.prototype.hasOwnProperty) { return o.hasOwnProperty(prop); } return !YAHOO.lang.isUndefined(o[prop]) && o.constructor.prototype[prop] !== o[prop]; }, /** * IE will not enumerate native functions in a derived object even if the * function was overridden. This is a workaround for specific functions * we care about on the Object prototype. * @property _IEEnumFix * @param {Function} r the object to receive the augmentation * @param {Function} s the object that supplies the properties to augment * @static * @private */ _IEEnumFix: function(r, s) { if (YAHOO.env.ua.ie) { var add=["toString", "valueOf"], i; for (i=0;i 0) ? l.dump(o[i], d-1) : OBJ); } else { s.push(o[i]); } s.push(COMMA); } if (s.length > 1) { s.pop(); } s.push("]"); // objects {k1 => v1, k2 => v2} } else { s.push("{"); for (i in o) { if (l.hasOwnProperty(o, i)) { s.push(i + ARROW); if (l.isObject(o[i])) { s.push((d > 0) ? l.dump(o[i], d-1) : OBJ); } else { s.push(o[i]); } s.push(COMMA); } } if (s.length > 1) { s.pop(); } s.push("}"); } return s.join(""); }, /** * Does variable substitution on a string. It scans through the string * looking for expressions enclosed in { } braces. If an expression * is found, it is used a key on the object. If there is a space in * the key, the first word is used for the key and the rest is provided * to an optional function to be used to programatically determine the * value (the extra information might be used for this decision). If * the value for the key in the object, or what is returned from the * function has a string value, number value, or object value, it is * substituted for the bracket expression and it repeats. If this * value is an object, it uses the Object's toString() if this has * been overridden, otherwise it does a shallow dump of the key/value * pairs. * @method substitute * @since 2.3.0 * @param s {String} The string that will be modified. * @param o {Object} An object containing the replacement values * @param f {Function} An optional function that can be used to * process each match. It receives the key, * value, and any extra metadata included with * the key inside of the braces. * @return {String} the substituted string */ substitute: function (s, o, f) { var i, j, k, key, v, meta, l=YAHOO.lang, saved=[], token, DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}'; for (;;) { i = s.lastIndexOf(LBRACE); if (i < 0) { break; } j = s.indexOf(RBRACE, i); if (i + 1 >= j) { break; } //Extract key and meta info token = s.substring(i + 1, j); key = token; meta = null; k = key.indexOf(SPACE); if (k > -1) { meta = key.substring(k + 1); key = key.substring(0, k); } // lookup the value v = o[key]; // if a substitution function was provided, execute it if (f) { v = f(key, v, meta); } if (l.isObject(v)) { if (l.isArray(v)) { v = l.dump(v, parseInt(meta, 10)); } else { meta = meta || ""; // look for the keyword 'dump', if found force obj dump var dump = meta.indexOf(DUMP); if (dump > -1) { meta = meta.substring(4); } // use the toString if it is not the Object toString // and the 'dump' meta info was not found if (v.toString===Object.prototype.toString||dump>-1) { v = l.dump(v, parseInt(meta, 10)); } else { v = v.toString(); } } } else if (!l.isString(v) && !l.isNumber(v)) { // This {block} has no replace string. Save it for later. v = "~-" + saved.length + "-~"; saved[saved.length] = token; // break; } s = s.substring(0, i) + v + s.substring(j + 1); } // restore saved {block}s for (i=saved.length-1; i>=0; i=i-1) { s = s.replace(new RegExp("~-" + i + "-~"), "{" + saved[i] + "}", "g"); } return s; }, /** * Returns a string without any leading or trailing whitespace. If * the input is not a string, the input will be returned untouched. * @method trim * @since 2.3.0 * @param s {string} the string to trim * @return {string} the trimmed string */ trim: function(s){ try { return s.replace(/^\s+|\s+$/g, ""); } catch(e) { return s; } }, /** * Returns a new object containing all of the properties of * all the supplied objects. The properties from later objects * will overwrite those in earlier objects. * @method merge * @since 2.3.0 * @param arguments {Object*} the objects to merge * @return the new merged object */ merge: function() { var o={}, a=arguments; for (var i=0, l=a.length; iYAHOO.lang * @class YAHOO.util.Lang */ YAHOO.util.Lang = YAHOO.lang; /** * Same as YAHOO.lang.augmentObject, except it only applies prototype * properties. This is an alias for augmentProto. * @see YAHOO.lang.augmentObject * @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*|boolean} 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. if true * is specified as the third parameter, all properties will * be applied and will overwrite an existing property in * the receiver */ YAHOO.lang.augment = YAHOO.lang.augmentProto; /** * An alias for YAHOO.lang.augment * @for YAHOO * @method augment * @static * @param {Function} r the object to receive the augmentation * @param {Function} s the object that supplies the properties to augment * @param {String*} arguments zero or more properties methods to * augment the receiver with. If none specified, everything * in the supplier will be used unless it would * overwrite an existing property in the receiver */ YAHOO.augment = YAHOO.lang.augmentProto; /** * An alias for YAHOO.lang.extend * @method extend * @static * @param {Function} subc the object to modify * @param {Function} superc the object to inherit * @param {Object} overrides additional properties/methods to add to the * subclass prototype. These will override the * matching items obtained from the superclass if present. */ YAHOO.extend = YAHOO.lang.extend; YAHOO.register("yahoo", YAHOO, {version: "2.5.1", build: "984"}); /* Copyright (c) 2008, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.5.1 */ /** * The CustomEvent class lets you define events for your application * that can be subscribed to by one or more independent component. * * @param {String} type The type of event, which is passed to the callback * when the event fires * @param {Object} oScope The context the event will fire from. "this" will * refer to this object in the callback. Default value: * the window object. The listener can override this. * @param {boolean} silent pass true to prevent the event from writing to * the debugsystem * @param {int} signature the signature that the custom event subscriber * will receive. YAHOO.util.CustomEvent.LIST or * YAHOO.util.CustomEvent.FLAT. The default is * YAHOO.util.CustomEvent.LIST. * @namespace YAHOO.util * @class CustomEvent * @constructor */ YAHOO.util.CustomEvent = function(type, oScope, silent, signature) { /** * The type of event, returned to subscribers when the event fires * @property type * @type string */ this.type = type; /** * The scope the the event will fire from by default. Defaults to the window * obj * @property scope * @type object */ this.scope = oScope || window; /** * By default all custom events are logged in the debug build, set silent * to true to disable debug outpu for this event. * @property silent * @type boolean */ this.silent = silent; /** * Custom events support two styles of arguments provided to the event * subscribers. *
    *
  • YAHOO.util.CustomEvent.LIST: *
      *
    • param1: event name
    • *
    • param2: array of arguments sent to fire
    • *
    • param3: a custom object supplied by the subscriber
    • *
    *
  • *
  • YAHOO.util.CustomEvent.FLAT *
      *
    • param1: the first argument passed to fire. If you need to * pass multiple parameters, use and array or object literal
    • *
    • param2: a custom object supplied by the subscriber
    • *
    *
  • *
* @property signature * @type int */ this.signature = signature || YAHOO.util.CustomEvent.LIST; /** * The subscribers to this event * @property subscribers * @type Subscriber[] */ this.subscribers = []; if (!this.silent) { } var onsubscribeType = "_YUICEOnSubscribe"; // Only add subscribe events for events that are not generated by // CustomEvent if (type !== onsubscribeType) { /** * Custom events provide a custom event that fires whenever there is * a new subscriber to the event. This provides an opportunity to * handle the case where there is a non-repeating event that has * already fired has a new subscriber. * * @event subscribeEvent * @type YAHOO.util.CustomEvent * @param {Function} fn The function to execute * @param {Object} obj An object to be passed along when the event * fires * @param {boolean|Object} override If true, the obj passed in becomes * the execution scope of the listener. * if an object, that object becomes the * the execution scope. */ this.subscribeEvent = new YAHOO.util.CustomEvent(onsubscribeType, this, true); } /** * In order to make it possible to execute the rest of the subscriber * stack when one thows an exception, the subscribers exceptions are * caught. The most recent exception is stored in this property * @property lastError * @type Error */ this.lastError = null; }; /** * Subscriber listener sigature constant. The LIST type returns three * parameters: the event type, the array of args passed to fire, and * the optional custom object * @property YAHOO.util.CustomEvent.LIST * @static * @type int */ YAHOO.util.CustomEvent.LIST = 0; /** * Subscriber listener sigature constant. The FLAT type returns two * parameters: the first argument passed to fire and the optional * custom object * @property YAHOO.util.CustomEvent.FLAT * @static * @type int */ YAHOO.util.CustomEvent.FLAT = 1; YAHOO.util.CustomEvent.prototype = { /** * Subscribes the caller to this event * @method subscribe * @param {Function} fn The function to execute * @param {Object} obj An object to be passed along when the event * fires * @param {boolean|Object} override If true, the obj passed in becomes * the execution scope of the listener. * if an object, that object becomes the * the execution scope. */ subscribe: function(fn, obj, override) { if (!fn) { throw new Error("Invalid callback for subscriber to '" + this.type + "'"); } if (this.subscribeEvent) { this.subscribeEvent.fire(fn, obj, override); } this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, override) ); }, /** * Unsubscribes subscribers. * @method unsubscribe * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed * @param {Object} obj The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {boolean} True if the subscriber was found and detached. */ unsubscribe: function(fn, obj) { if (!fn) { return this.unsubscribeAll(); } var found = false; for (var i=0, len=this.subscribers.length; i *
  • The type of event
  • *
  • All of the arguments fire() was executed with as an array
  • *
  • The custom object (if any) that was passed into the subscribe() * method
  • * * @method fire * @param {Object*} arguments an arbitrary set of parameters to pass to * the handler. * @return {boolean} false if one of the subscribers returned false, * true otherwise */ fire: function() { var len=this.subscribers.length; if (!len && this.silent) { return true; } var args=[].slice.call(arguments, 0), ret=true, i, rebuild=false; if (!this.silent) { } // make a copy of the subscribers so that there are // no index problems if one subscriber removes another. var subs = this.subscribers.slice(); for (i=0; i 0) { param = args[0]; } try { ret = s.fn.call(scope, param, s.obj); } catch(e) { this.lastError = e; } } else { try { ret = s.fn.call(scope, this.type, args, s.obj); } catch(ex) { this.lastError = ex; } } if (false === ret) { if (!this.silent) { } //break; return false; } } } // if (rebuild) { // var newlist=this.,subs=this.subscribers; // for (i=0,len=subs.length; i-1; i--) { this._delete(i); } this.subscribers=[]; return i; }, /** * @method _delete * @private */ _delete: function(index) { var s = this.subscribers[index]; if (s) { delete s.fn; delete s.obj; } // this.subscribers[index]=null; this.subscribers.splice(index, 1); }, /** * @method toString */ toString: function() { return "CustomEvent: " + "'" + this.type + "', " + "scope: " + this.scope; } }; ///////////////////////////////////////////////////////////////////// /** * Stores the subscriber information to be used when the event fires. * @param {Function} fn The function to execute * @param {Object} obj An object to be passed along when the event fires * @param {boolean} override If true, the obj passed in becomes the execution * scope of the listener * @class Subscriber * @constructor */ YAHOO.util.Subscriber = function(fn, obj, override) { /** * The callback that will be execute when the event fires * @property fn * @type function */ this.fn = fn; /** * An optional custom object that will passed to the callback when * the event fires * @property obj * @type object */ this.obj = YAHOO.lang.isUndefined(obj) ? null : obj; /** * The default execution scope for the event listener is defined when the * event is created (usually the object which contains the event). * By setting override to true, the execution scope becomes the custom * object passed in by the subscriber. If override is an object, that * object becomes the scope. * @property override * @type boolean|object */ this.override = override; }; /** * Returns the execution scope for this listener. If override was set to true * the custom obj will be the scope. If override is an object, that is the * scope, otherwise the default scope will be used. * @method getScope * @param {Object} defaultScope the scope to use if this listener does not * override it. */ YAHOO.util.Subscriber.prototype.getScope = function(defaultScope) { if (this.override) { if (this.override === true) { return this.obj; } else { return this.override; } } return defaultScope; }; /** * Returns true if the fn and obj match this objects properties. * Used by the unsubscribe method to match the right subscriber. * * @method contains * @param {Function} fn the function to execute * @param {Object} obj an object to be passed along when the event fires * @return {boolean} true if the supplied arguments match this * subscriber's signature. */ YAHOO.util.Subscriber.prototype.contains = function(fn, obj) { if (obj) { return (this.fn == fn && this.obj == obj); } else { return (this.fn == fn); } }; /** * @method toString */ YAHOO.util.Subscriber.prototype.toString = function() { return "Subscriber { obj: " + this.obj + ", override: " + (this.override || "no") + " }"; }; /** * The Event Utility provides utilities for managing DOM Events and tools * for building event systems * * @module event * @title Event Utility * @namespace YAHOO.util * @requires yahoo */ // The first instance of Event will win if it is loaded more than once. // @TODO this needs to be changed so that only the state data that needs to // be preserved is kept, while methods are overwritten/added as needed. // This means that the module pattern can't be used. if (!YAHOO.util.Event) { /** * The event utility provides functions to add and remove event listeners, * event cleansing. It also tries to automatically remove listeners it * registers during the unload event. * * @class Event * @static */ YAHOO.util.Event = function() { /** * True after the onload event has fired * @property loadComplete * @type boolean * @static * @private */ var loadComplete = false; /** * Cache of wrapped listeners * @property listeners * @type array * @static * @private */ var listeners = []; /** * User-defined unload function that will be fired before all events * are detached * @property unloadListeners * @type array * @static * @private */ var unloadListeners = []; /** * Cache of DOM0 event handlers to work around issues with DOM2 events * in Safari * @property legacyEvents * @static * @private */ var legacyEvents = []; /** * Listener stack for DOM0 events * @property legacyHandlers * @static * @private */ var legacyHandlers = []; /** * The number of times to poll after window.onload. This number is * increased if additional late-bound handlers are requested after * the page load. * @property retryCount * @static * @private */ var retryCount = 0; /** * onAvailable listeners * @property onAvailStack * @static * @private */ var onAvailStack = []; /** * Lookup table for legacy events * @property legacyMap * @static * @private */ var legacyMap = []; /** * Counter for auto id generation * @property counter * @static * @private */ var counter = 0; /** * Normalized keycodes for webkit/safari * @property webkitKeymap * @type {int: int} * @private * @static * @final */ var webkitKeymap = { 63232: 38, // up 63233: 40, // down 63234: 37, // left 63235: 39, // right 63276: 33, // page up 63277: 34, // page down 25: 9 // SHIFT-TAB (Safari provides a different key code in // this case, even though the shiftKey modifier is set) }; return { /** * The number of times we should look for elements that are not * in the DOM at the time the event is requested after the document * has been loaded. The default is 2000@amp;20 ms, so it will poll * for 40 seconds or until all outstanding handlers are bound * (whichever comes first). * @property POLL_RETRYS * @type int * @static * @final */ POLL_RETRYS: 2000, /** * The poll interval in milliseconds * @property POLL_INTERVAL * @type int * @static * @final */ POLL_INTERVAL: 20, /** * Element to bind, int constant * @property EL * @type int * @static * @final */ EL: 0, /** * Type of event, int constant * @property TYPE * @type int * @static * @final */ TYPE: 1, /** * Function to execute, int constant * @property FN * @type int * @static * @final */ FN: 2, /** * Function wrapped for scope correction and cleanup, int constant * @property WFN * @type int * @static * @final */ WFN: 3, /** * Object passed in by the user that will be returned as a * parameter to the callback, int constant. Specific to * unload listeners * @property OBJ * @type int * @static * @final */ UNLOAD_OBJ: 3, /** * Adjusted scope, either the element we are registering the event * on or the custom object passed in by the listener, int constant * @property ADJ_SCOPE * @type int * @static * @final */ ADJ_SCOPE: 4, /** * The original obj passed into addListener * @property OBJ * @type int * @static * @final */ OBJ: 5, /** * The original scope parameter passed into addListener * @property OVERRIDE * @type int * @static * @final */ OVERRIDE: 6, /** * addListener/removeListener can throw errors in unexpected scenarios. * These errors are suppressed, the method returns false, and this property * is set * @property lastError * @static * @type Error */ lastError: null, /** * Safari detection * @property isSafari * @private * @static * @deprecated use YAHOO.env.ua.webkit */ isSafari: YAHOO.env.ua.webkit, /** * webkit version * @property webkit * @type string * @private * @static * @deprecated use YAHOO.env.ua.webkit */ webkit: YAHOO.env.ua.webkit, /** * IE detection * @property isIE * @private * @static * @deprecated use YAHOO.env.ua.ie */ isIE: YAHOO.env.ua.ie, /** * poll handle * @property _interval * @static * @private */ _interval: null, /** * document readystate poll handle * @property _dri * @static * @private */ _dri: null, /** * True when the document is initially usable * @property DOMReady * @type boolean * @static */ DOMReady: false, /** * @method startInterval * @static * @private */ startInterval: function() { if (!this._interval) { var self = this; var callback = function() { self._tryPreloadAttach(); }; this._interval = setInterval(callback, this.POLL_INTERVAL); } }, /** * Executes the supplied callback when the item with the supplied * id is found. This is meant to be used to execute behavior as * soon as possible as the page loads. If you use this after the * initial page load it will poll for a fixed time for the element. * The number of times it will poll and the frequency are * configurable. By default it will poll for 10 seconds. * *

    The callback is executed with a single parameter: * the custom object parameter, if provided.

    * * @method onAvailable * * @param {string||string[]} p_id the id of the element, or an array * of ids to look for. * @param {function} p_fn what to execute when the element is found. * @param {object} p_obj an optional object to be passed back as * a parameter to p_fn. * @param {boolean|object} p_override If set to true, p_fn will execute * in the scope of p_obj, if set to an object it * will execute in the scope of that object * @param checkContent {boolean} check child node readiness (onContentReady) * @static */ onAvailable: function(p_id, p_fn, p_obj, p_override, checkContent) { var a = (YAHOO.lang.isString(p_id)) ? [p_id] : p_id; for (var i=0; iThe callback is executed with a single parameter: * the custom object parameter, if provided.

    * * @method onContentReady * * @param {string} p_id the id of the element to look for. * @param {function} p_fn what to execute when the element is ready. * @param {object} p_obj an optional object to be passed back as * a parameter to p_fn. * @param {boolean|object} p_override If set to true, p_fn will execute * in the scope of p_obj. If an object, p_fn will * exectute in the scope of that object * * @static */ onContentReady: function(p_id, p_fn, p_obj, p_override) { this.onAvailable(p_id, p_fn, p_obj, p_override, true); }, /** * Executes the supplied callback when the DOM is first usable. This * will execute immediately if called after the DOMReady event has * fired. @todo the DOMContentReady event does not fire when the * script is dynamically injected into the page. This means the * DOMReady custom event will never fire in FireFox or Opera when the * library is injected. It _will_ fire in Safari, and the IE * implementation would allow for us to fire it if the defered script * is not available. We want this to behave the same in all browsers. * Is there a way to identify when the script has been injected * instead of included inline? Is there a way to know whether the * window onload event has fired without having had a listener attached * to it when it did so? * *

    The callback is a CustomEvent, so the signature is:

    *

    type <string>, args <array>, customobject <object>

    *

    For DOMReady events, there are no fire argments, so the * signature is:

    *

    "DOMReady", [], obj

    * * * @method onDOMReady * * @param {function} p_fn what to execute when the element is found. * @param {object} p_obj an optional object to be passed back as * a parameter to p_fn. * @param {boolean|object} p_scope If set to true, p_fn will execute * in the scope of p_obj, if set to an object it * will execute in the scope of that object * * @static */ onDOMReady: function(p_fn, p_obj, p_override) { if (this.DOMReady) { setTimeout(function() { var s = window; if (p_override) { if (p_override === true) { s = p_obj; } else { s = p_override; } } p_fn.call(s, "DOMReady", [], p_obj); }, 0); } else { this.DOMReadyEvent.subscribe(p_fn, p_obj, p_override); } }, /** * Appends an event handler * * @method addListener * * @param {String|HTMLElement|Array|NodeList} el An id, an element * reference, or a collection of ids and/or elements to assign the * listener to. * @param {String} sType The type of event to append * @param {Function} fn The method the event invokes * @param {Object} obj An arbitrary object that will be * passed as a parameter to the handler * @param {Boolean|object} override If true, the obj passed in becomes * the execution scope of the listener. If an * object, this object becomes the execution * scope. * @return {Boolean} True if the action was successful or defered, * false if one or more of the elements * could not have the listener attached, * or if the operation throws an exception. * @static */ addListener: function(el, sType, fn, obj, override) { if (!fn || !fn.call) { return false; } // The el argument can be an array of elements or element ids. if ( this._isValidCollection(el)) { var ok = true; for (var i=0,len=el.length; i-1; i--) { ok = ( this.removeListener(el[i], sType, fn) && ok ); } return ok; } if (!fn || !fn.call) { //return false; return this.purgeElement(el, false, sType); } if ("unload" == sType) { for (i=unloadListeners.length-1; i>-1; i--) { li = unloadListeners[i]; if (li && li[0] == el && li[1] == sType && li[2] == fn) { unloadListeners.splice(i, 1); // unloadListeners[i]=null; return true; } } return false; } var cacheItem = null; // The index is a hidden parameter; needed to remove it from // the method signature because it was tempting users to // try and take advantage of it, which is not possible. var index = arguments[3]; if ("undefined" === typeof index) { index = this._getCacheIndex(el, sType, fn); } if (index >= 0) { cacheItem = listeners[index]; } if (!el || !cacheItem) { return false; } if (this.useLegacyEvent(el, sType)) { var legacyIndex = this.getLegacyIndex(el, sType); var llist = legacyHandlers[legacyIndex]; if (llist) { for (i=0, len=llist.length; i 0 && onAvailStack.length > 0); } // onAvailable var notAvail = []; var executeItem = function (el, item) { var scope = el; if (item.override) { if (item.override === true) { scope = item.obj; } else { scope = item.override; } } item.fn.call(scope, item.obj); }; var i, len, item, el, ready=[]; // onAvailable onContentReady for (i=0, len=onAvailStack.length; i-1; i--) { item = onAvailStack[i]; if (!item || !item.id) { onAvailStack.splice(i, 1); } } this.startInterval(); } else { clearInterval(this._interval); this._interval = null; } this.locked = false; }, /** * Removes all listeners attached to the given element via addListener. * Optionally, the node's children can also be purged. * Optionally, you can specify a specific type of event to remove. * @method purgeElement * @param {HTMLElement} el the element to purge * @param {boolean} recurse recursively purge this element's children * as well. Use with caution. * @param {string} sType optional type of listener to purge. If * left out, all listeners will be removed * @static */ purgeElement: function(el, recurse, sType) { var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el; var elListeners = this.getListeners(oEl, sType), i, len; if (elListeners) { for (i=elListeners.length-1; i>-1; i--) { var l = elListeners[i]; this.removeListener(oEl, l.type, l.fn); } } if (recurse && oEl && oEl.childNodes) { for (i=0,len=oEl.childNodes.length; i 0) { // 2.5.0 listeners are removed for all browsers again. FireFox preserves // at least some listeners between page refreshes, potentially causing // errors during page load (mouseover listeners firing before they // should if the user moves the mouse at the correct moment). if (listeners) { for (j=listeners.length-1; j>-1; j--) { l = listeners[j]; if (l) { EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], j); } } l=null; } legacyEvents = null; EU._simpleRemove(window, "unload", EU._unload); }, /** * Returns scrollLeft * @method _getScrollLeft * @static * @private */ _getScrollLeft: function() { return this._getScroll()[1]; }, /** * Returns scrollTop * @method _getScrollTop * @static * @private */ _getScrollTop: function() { return this._getScroll()[0]; }, /** * Returns the scrollTop and scrollLeft. Used to calculate the * pageX and pageY in Internet Explorer * @method _getScroll * @static * @private */ _getScroll: function() { var dd = document.documentElement, db = document.body; if (dd && (dd.scrollTop || dd.scrollLeft)) { return [dd.scrollTop, dd.scrollLeft]; } else if (db) { return [db.scrollTop, db.scrollLeft]; } else { return [0, 0]; } }, /** * Used by old versions of CustomEvent, restored for backwards * compatibility * @method regCE * @private * @static * @deprecated still here for backwards compatibility */ regCE: function() { // does nothing }, /** * Adds a DOM event directly without the caching, cleanup, scope adj, etc * * @method _simpleAdd * @param {HTMLElement} el the element to bind the handler to * @param {string} sType the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ _simpleAdd: function () { if (window.addEventListener) { return function(el, sType, fn, capture) { el.addEventListener(sType, fn, (capture)); }; } else if (window.attachEvent) { return function(el, sType, fn, capture) { el.attachEvent("on" + sType, fn); }; } else { return function(){}; } }(), /** * Basic remove listener * * @method _simpleRemove * @param {HTMLElement} el the element to bind the handler to * @param {string} sType the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ _simpleRemove: function() { if (window.removeEventListener) { return function (el, sType, fn, capture) { el.removeEventListener(sType, fn, (capture)); }; } else if (window.detachEvent) { return function (el, sType, fn) { el.detachEvent("on" + sType, fn); }; } else { return function(){}; } }() }; }(); (function() { var EU = YAHOO.util.Event; /** * YAHOO.util.Event.on is an alias for addListener * @method on * @see addListener * @static */ EU.on = EU.addListener; /*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */ // Internet Explorer: use the readyState of a defered script. // This isolates what appears to be a safe moment to manipulate // the DOM prior to when the document's readyState suggests // it is safe to do so. if (EU.isIE) { // Process onAvailable/onContentReady items when the // DOM is ready. YAHOO.util.Event.onDOMReady( YAHOO.util.Event._tryPreloadAttach, YAHOO.util.Event, true); var n = document.createElement('p'); EU._dri = setInterval(function() { try { // throws an error if doc is not ready n.doScroll('left'); clearInterval(EU._dri); EU._dri = null; EU._ready(); n = null; } catch (ex) { } }, EU.POLL_INTERVAL); // The document's readyState in Safari currently will // change to loaded/complete before images are loaded. } else if (EU.webkit && EU.webkit < 525) { EU._dri = setInterval(function() { var rs=document.readyState; if ("loaded" == rs || "complete" == rs) { clearInterval(EU._dri); EU._dri = null; EU._ready(); } }, EU.POLL_INTERVAL); // FireFox and Opera: These browsers provide a event for this // moment. The latest WebKit releases now support this event. } else { EU._simpleAdd(document, "DOMContentLoaded", EU._ready); } ///////////////////////////////////////////////////////////// EU._simpleAdd(window, "load", EU._load); EU._simpleAdd(window, "unload", EU._unload); EU._tryPreloadAttach(); })(); } /** * EventProvider is designed to be used with YAHOO.augment to wrap * CustomEvents in an interface that allows events to be subscribed to * and fired by name. This makes it possible for implementing code to * subscribe to an event that either has not been created yet, or will * not be created at all. * * @Class EventProvider */ YAHOO.util.EventProvider = function() { }; YAHOO.util.EventProvider.prototype = { /** * Private storage of custom events * @property __yui_events * @type Object[] * @private */ __yui_events: null, /** * Private storage of custom event subscribers * @property __yui_subscribers * @type Object[] * @private */ __yui_subscribers: null, /** * Subscribe to a CustomEvent by event type * * @method subscribe * @param p_type {string} the type, or name of the event * @param p_fn {function} the function to exectute when the event fires * @param p_obj {Object} An object to be passed along when the event * fires * @param p_override {boolean} If true, the obj passed in becomes the * execution scope of the listener */ subscribe: function(p_type, p_fn, p_obj, p_override) { this.__yui_events = this.__yui_events || {}; var ce = this.__yui_events[p_type]; if (ce) { ce.subscribe(p_fn, p_obj, p_override); } else { this.__yui_subscribers = this.__yui_subscribers || {}; var subs = this.__yui_subscribers; if (!subs[p_type]) { subs[p_type] = []; } subs[p_type].push( { fn: p_fn, obj: p_obj, override: p_override } ); } }, /** * Unsubscribes one or more listeners the from the specified event * @method unsubscribe * @param p_type {string} The type, or name of the event. If the type * is not specified, it will attempt to remove * the listener from all hosted events. * @param p_fn {Function} The subscribed function to unsubscribe, if not * supplied, all subscribers will be removed. * @param p_obj {Object} The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {boolean} true if the subscriber was found and detached. */ unsubscribe: function(p_type, p_fn, p_obj) { this.__yui_events = this.__yui_events || {}; var evts = this.__yui_events; if (p_type) { var ce = evts[p_type]; if (ce) { return ce.unsubscribe(p_fn, p_obj); } } else { var ret = true; for (var i in evts) { if (YAHOO.lang.hasOwnProperty(evts, i)) { ret = ret && evts[i].unsubscribe(p_fn, p_obj); } } return ret; } return false; }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method unsubscribeAll * @param p_type {string} The type, or name of the event */ unsubscribeAll: function(p_type) { return this.unsubscribe(p_type); }, /** * Creates a new custom event of the specified type. If a custom event * by that name already exists, it will not be re-created. In either * case the custom event is returned. * * @method createEvent * * @param p_type {string} the type, or name of the event * @param p_config {object} optional config params. Valid properties are: * *
      *
    • * scope: defines the default execution scope. If not defined * the default scope will be this instance. *
    • *
    • * silent: if true, the custom event will not generate log messages. * This is false by default. *
    • *
    • * onSubscribeCallback: specifies a callback to execute when the * event has a new subscriber. This will fire immediately for * each queued subscriber if any exist prior to the creation of * the event. *
    • *
    * * @return {CustomEvent} the custom event * */ createEvent: function(p_type, p_config) { this.__yui_events = this.__yui_events || {}; var opts = p_config || {}; var events = this.__yui_events; if (events[p_type]) { } else { var scope = opts.scope || this; var silent = (opts.silent); var ce = new YAHOO.util.CustomEvent(p_type, scope, silent, YAHOO.util.CustomEvent.FLAT); events[p_type] = ce; if (opts.onSubscribeCallback) { ce.subscribeEvent.subscribe(opts.onSubscribeCallback); } this.__yui_subscribers = this.__yui_subscribers || {}; var qs = this.__yui_subscribers[p_type]; if (qs) { for (var i=0; i *
  • The first argument fire() was executed with
  • *
  • The custom object (if any) that was passed into the subscribe() * method
  • * * If the custom event has not been explicitly created, it will be * created now with the default config, scoped to the host object * @method fireEvent * @param p_type {string} the type, or name of the event * @param arguments {Object*} an arbitrary set of parameters to pass to * the handler. * @return {boolean} the return value from CustomEvent.fire * */ fireEvent: function(p_type, arg1, arg2, etc) { this.__yui_events = this.__yui_events || {}; var ce = this.__yui_events[p_type]; if (!ce) { return null; } var args = []; for (var i=1; i= this.left && region.right <= this.right && region.top >= this.top && region.bottom <= this.bottom ); }; /** * Returns the area of the region * @method getArea * @return {Int} the region's area */ YAHOO.util.Region.prototype.getArea = function() { return ( (this.bottom - this.top) * (this.right - this.left) ); }; /** * 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 */ YAHOO.util.Region.prototype.intersect = function(region) { var t = Math.max( this.top, region.top ); var r = Math.min( this.right, region.right ); var b = Math.min( this.bottom, region.bottom ); var l = Math.max( this.left, region.left ); if (b >= t && r >= l) { return new YAHOO.util.Region(t, r, b, l); } else { return null; } }; /** * 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 */ YAHOO.util.Region.prototype.union = function(region) { var t = Math.min( this.top, region.top ); var r = Math.max( this.right, region.right ); var b = Math.max( this.bottom, region.bottom ); var l = Math.min( this.left, region.left ); return new YAHOO.util.Region(t, r, b, l); }; /** * toString * @method toString * @return string the region properties */ YAHOO.util.Region.prototype.toString = function() { return ( "Region {" + "top: " + this.top + ", right: " + this.right + ", bottom: " + this.bottom + ", left: " + this.left + "}" ); }; /** * 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 */ YAHOO.util.Region.getRegion = function(el) { var p = YAHOO.util.Dom.getXY(el); var t = p[1]; var r = p[0] + el.offsetWidth; var b = p[1] + el.offsetHeight; var l = p[0]; return new YAHOO.util.Region(t, r, b, l); }; ///////////////////////////////////////////////////////////////////////////// /** * A point is a region that is special in that it represents a single point on * the grid. * @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 YAHOO.util.Region */ YAHOO.util.Point = function(x, y) { if (YAHOO.lang.isArray(x)) { // accept input from Dom.getXY, Event.getXY, etc. y = x[1]; // dont blow away x yet x = x[0]; } /** * The X position of the point, which is also the right, left and index zero (for Dom.getXY symmetry) * @property x * @type Int */ this.x = this.right = this.left = this[0] = x; /** * The Y position of the point, which is also the top, bottom and index one (for Dom.getXY symmetry) * @property y * @type Int */ this.y = this.top = this.bottom = this[1] = y; }; YAHOO.util.Point.prototype = new YAHOO.util.Region(); YAHOO.register("dom", YAHOO.util.Dom, {version: "2.5.1", build: "984"}); /* Copyright (c) 2008, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.5.1 */ /** * The drag and drop utility provides a framework for building drag and drop * applications. In addition to enabling drag and drop for specific elements, * the drag and drop elements are tracked by the manager class, and the * interactions between the various elements are tracked during the drag and * the implementing code is notified about these important moments. * @module dragdrop * @title Drag and Drop * @requires yahoo,dom,event * @namespace YAHOO.util */ // Only load the library once. Rewriting the manager class would orphan // existing drag and drop instances. if (!YAHOO.util.DragDropMgr) { /** * DragDropMgr is a singleton that tracks the element interaction for * all DragDrop items in the window. Generally, you will not call * this class directly, but it does have helper methods that could * be useful in your DragDrop implementations. * @class DragDropMgr * @static */ YAHOO.util.DragDropMgr = function() { var Event = YAHOO.util.Event; return { /** * Two dimensional Array of registered DragDrop objects. The first * dimension is the DragDrop item group, the second the DragDrop * object. * @property ids * @type {string: string} * @private * @static */ ids: {}, /** * Array of element ids defined as drag handles. Used to determine * if the element that generated the mousedown event is actually the * handle and not the html element itself. * @property handleIds * @type {string: string} * @private * @static */ handleIds: {}, /** * the DragDrop object that is currently being dragged * @property dragCurrent * @type DragDrop * @private * @static **/ dragCurrent: null, /** * the DragDrop object(s) that are being hovered over * @property dragOvers * @type Array * @private * @static */ dragOvers: {}, /** * the X distance between the cursor and the object being dragged * @property deltaX * @type int * @private * @static */ deltaX: 0, /** * the Y distance between the cursor and the object being dragged * @property deltaY * @type int * @private * @static */ deltaY: 0, /** * Flag to determine if we should prevent the default behavior of the * events we define. By default this is true, but this can be set to * false if you need the default behavior (not recommended) * @property preventDefault * @type boolean * @static */ preventDefault: true, /** * Flag to determine if we should stop the propagation of the events * we generate. This is true by default but you may want to set it to * false if the html element contains other features that require the * mouse click. * @property stopPropagation * @type boolean * @static */ stopPropagation: true, /** * Internal flag that is set to true when drag and drop has been * initialized * @property initialized * @private * @static */ initialized: false, /** * All drag and drop can be disabled. * @property locked * @private * @static */ locked: false, /** * Provides additional information about the the current set of * interactions. Can be accessed from the event handlers. It * contains the following properties: * * out: onDragOut interactions * enter: onDragEnter interactions * over: onDragOver interactions * drop: onDragDrop interactions * point: The location of the cursor * draggedRegion: The location of dragged element at the time * of the interaction * sourceRegion: The location of the source elemtn at the time * of the interaction * validDrop: boolean * @property interactionInfo * @type object * @static */ interactionInfo: null, /** * Called the first time an element is registered. * @method init * @private * @static */ init: function() { this.initialized = true; }, /** * In point mode, drag and drop interaction is defined by the * location of the cursor during the drag/drop * @property POINT * @type int * @static * @final */ POINT: 0, /** * In intersect mode, drag and drop interaction is defined by the * cursor position or the amount of overlap of two or more drag and * drop objects. * @property INTERSECT * @type int * @static * @final */ INTERSECT: 1, /** * In intersect mode, drag and drop interaction is defined only by the * overlap of two or more drag and drop objects. * @property STRICT_INTERSECT * @type int * @static * @final */ STRICT_INTERSECT: 2, /** * The current drag and drop mode. Default: POINT * @property mode * @type int * @static */ mode: 0, /** * Runs method on all drag and drop objects * @method _execOnAll * @private * @static */ _execOnAll: function(sMethod, args) { for (var i in this.ids) { for (var j in this.ids[i]) { var oDD = this.ids[i][j]; if (! this.isTypeOfDD(oDD)) { continue; } oDD[sMethod].apply(oDD, args); } } }, /** * Drag and drop initialization. Sets up the global event handlers * @method _onLoad * @private * @static */ _onLoad: function() { this.init(); Event.on(document, "mouseup", this.handleMouseUp, this, true); Event.on(document, "mousemove", this.handleMouseMove, this, true); Event.on(window, "unload", this._onUnload, this, true); Event.on(window, "resize", this._onResize, this, true); // Event.on(window, "mouseout", this._test); }, /** * Reset constraints on all drag and drop objs * @method _onResize * @private * @static */ _onResize: function(e) { this._execOnAll("resetConstraints", []); }, /** * Lock all drag and drop functionality * @method lock * @static */ lock: function() { this.locked = true; }, /** * Unlock all drag and drop functionality * @method unlock * @static */ unlock: function() { this.locked = false; }, /** * Is drag and drop locked? * @method isLocked * @return {boolean} True if drag and drop is locked, false otherwise. * @static */ isLocked: function() { return this.locked; }, /** * Location cache that is set for all drag drop objects when a drag is * initiated, cleared when the drag is finished. * @property locationCache * @private * @static */ locationCache: {}, /** * Set useCache to false if you want to force object the lookup of each * drag and drop linked element constantly during a drag. * @property useCache * @type boolean * @static */ useCache: true, /** * The number of pixels that the mouse needs to move after the * mousedown before the drag is initiated. Default=3; * @property clickPixelThresh * @type int * @static */ clickPixelThresh: 3, /** * The number of milliseconds after the mousedown event to initiate the * drag if we don't get a mouseup event. Default=1000 * @property clickTimeThresh * @type int * @static */ clickTimeThresh: 1000, /** * Flag that indicates that either the drag pixel threshold or the * mousdown time threshold has been met * @property dragThreshMet * @type boolean * @private * @static */ dragThreshMet: false, /** * Timeout used for the click time threshold * @property clickTimeout * @type Object * @private * @static */ clickTimeout: null, /** * The X position of the mousedown event stored for later use when a * drag threshold is met. * @property startX * @type int * @private * @static */ startX: 0, /** * The Y position of the mousedown event stored for later use when a * drag threshold is met. * @property startY * @type int * @private * @static */ startY: 0, /** * Flag to determine if the drag event was fired from the click timeout and * not the mouse move threshold. * @property fromTimeout * @type boolean * @private * @static */ fromTimeout: false, /** * Each DragDrop instance must be registered with the DragDropMgr. * This is executed in DragDrop.init() * @method regDragDrop * @param {DragDrop} oDD the DragDrop object to register * @param {String} sGroup the name of the group this element belongs to * @static */ regDragDrop: function(oDD, sGroup) { if (!this.initialized) { this.init(); } if (!this.ids[sGroup]) { this.ids[sGroup] = {}; } this.ids[sGroup][oDD.id] = oDD; }, /** * Removes the supplied dd instance from the supplied group. Executed * by DragDrop.removeFromGroup, so don't call this function directly. * @method removeDDFromGroup * @private * @static */ removeDDFromGroup: function(oDD, sGroup) { if (!this.ids[sGroup]) { this.ids[sGroup] = {}; } var obj = this.ids[sGroup]; if (obj && obj[oDD.id]) { delete obj[oDD.id]; } }, /** * Unregisters a drag and drop item. This is executed in * DragDrop.unreg, use that method instead of calling this directly. * @method _remove * @private * @static */ _remove: function(oDD) { for (var g in oDD.groups) { if (g && this.ids[g][oDD.id]) { delete this.ids[g][oDD.id]; } } delete this.handleIds[oDD.id]; }, /** * Each DragDrop handle element must be registered. This is done * automatically when executing DragDrop.setHandleElId() * @method regHandle * @param {String} sDDId the DragDrop id this element is a handle for * @param {String} sHandleId the id of the element that is the drag * handle * @static */ regHandle: function(sDDId, sHandleId) { if (!this.handleIds[sDDId]) { this.handleIds[sDDId] = {}; } this.handleIds[sDDId][sHandleId] = sHandleId; }, /** * Utility function to determine if a given element has been * registered as a drag drop item. * @method isDragDrop * @param {String} id the element id to check * @return {boolean} true if this element is a DragDrop item, * false otherwise * @static */ isDragDrop: function(id) { return ( this.getDDById(id) ) ? true : false; }, /** * Returns the drag and drop instances that are in all groups the * passed in instance belongs to. * @method getRelated * @param {DragDrop} p_oDD the obj to get related data for * @param {boolean} bTargetsOnly if true, only return targetable objs * @return {DragDrop[]} the related instances * @static */ getRelated: function(p_oDD, bTargetsOnly) { var oDDs = []; for (var i in p_oDD.groups) { for (var j in this.ids[i]) { var dd = this.ids[i][j]; if (! this.isTypeOfDD(dd)) { continue; } if (!bTargetsOnly || dd.isTarget) { oDDs[oDDs.length] = dd; } } } return oDDs; }, /** * Returns true if the specified dd target is a legal target for * the specifice drag obj * @method isLegalTarget * @param {DragDrop} the drag obj * @param {DragDrop} the target * @return {boolean} true if the target is a legal target for the * dd obj * @static */ isLegalTarget: function (oDD, oTargetDD) { var targets = this.getRelated(oDD, true); for (var i=0, len=targets.length;i this.clickPixelThresh || diffY > this.clickPixelThresh) { this.startDrag(this.startX, this.startY); } } if (this.dragThreshMet) { if (dc && dc.events.b4Drag) { dc.b4Drag(e); dc.fireEvent('b4DragEvent', { e: e}); } if (dc && dc.events.drag) { dc.onDrag(e); dc.fireEvent('dragEvent', { e: e}); } if (dc) { this.fireEvents(e, false); } } this.stopEvent(e); } }, /** * Iterates over all of the DragDrop elements to find ones we are * hovering over or dropping on * @method fireEvents * @param {Event} e the event * @param {boolean} isDrop is this a drop op or a mouseover op? * @private * @static */ fireEvents: function(e, isDrop) { var dc = this.dragCurrent; // If the user did the mouse up outside of the window, we could // get here even though we have ended the drag. // If the config option dragOnly is true, bail out and don't fire the events if (!dc || dc.isLocked() || dc.dragOnly) { return; } var x = YAHOO.util.Event.getPageX(e), y = YAHOO.util.Event.getPageY(e), pt = new YAHOO.util.Point(x,y), pos = dc.getTargetCoord(pt.x, pt.y), el = dc.getDragEl(), events = ['out', 'over', 'drop', 'enter'], curRegion = new YAHOO.util.Region( pos.y, pos.x + el.offsetWidth, pos.y + el.offsetHeight, pos.x ), oldOvers = [], // cache the previous dragOver array inGroupsObj = {}, inGroups = [], data = { outEvts: [], overEvts: [], dropEvts: [], enterEvts: [] }; // Check to see if the object(s) we were hovering over is no longer // being hovered over so we can fire the onDragOut event for (var i in this.dragOvers) { var ddo = this.dragOvers[i]; if (! this.isTypeOfDD(ddo)) { continue; } if (! this.isOverTarget(pt, ddo, this.mode, curRegion)) { data.outEvts.push( ddo ); } oldOvers[i] = true; delete this.dragOvers[i]; } for (var sGroup in dc.groups) { if ("string" != typeof sGroup) { continue; } for (i in this.ids[sGroup]) { var oDD = this.ids[sGroup][i]; if (! this.isTypeOfDD(oDD)) { continue; } if (oDD.isTarget && !oDD.isLocked() && oDD != dc) { if (this.isOverTarget(pt, oDD, this.mode, curRegion)) { inGroupsObj[sGroup] = true; // look for drop interactions if (isDrop) { data.dropEvts.push( oDD ); // look for drag enter and drag over interactions } else { // initial drag over: dragEnter fires if (!oldOvers[oDD.id]) { data.enterEvts.push( oDD ); // subsequent drag overs: dragOver fires } else { data.overEvts.push( oDD ); } this.dragOvers[oDD.id] = oDD; } } } } } this.interactionInfo = { out: data.outEvts, enter: data.enterEvts, over: data.overEvts, drop: data.dropEvts, point: pt, draggedRegion: curRegion, sourceRegion: this.locationCache[dc.id], validDrop: isDrop }; for (var inG in inGroupsObj) { inGroups.push(inG); } // notify about a drop that did not find a target if (isDrop && !data.dropEvts.length) { this.interactionInfo.validDrop = false; if (dc.events.invalidDrop) { dc.onInvalidDrop(e); dc.fireEvent('invalidDropEvent', { e: e }); } } for (i = 0; i < events.length; i++) { var tmp = null; if (data[events[i] + 'Evts']) { tmp = data[events[i] + 'Evts']; } if (tmp && tmp.length) { var type = events[i].charAt(0).toUpperCase() + events[i].substr(1), ev = 'onDrag' + type, b4 = 'b4Drag' + type, cev = 'drag' + type + 'Event', check = 'drag' + type; if (this.mode) { if (dc.events[b4]) { dc[b4](e, tmp, inGroups); dc.fireEvent(b4 + 'Event', { event: e, info: tmp, group: inGroups }); } if (dc.events[check]) { dc[ev](e, tmp, inGroups); dc.fireEvent(cev, { event: e, info: tmp, group: inGroups }); } } else { for (var b = 0, len = tmp.length; b < len; ++b) { if (dc.events[b4]) { dc[b4](e, tmp[b].id, inGroups[0]); dc.fireEvent(b4 + 'Event', { event: e, info: tmp[b].id, group: inGroups[0] }); } if (dc.events[check]) { dc[ev](e, tmp[b].id, inGroups[0]); dc.fireEvent(cev, { event: e, info: tmp[b].id, group: inGroups[0] }); } } } } } }, /** * Helper function for getting the best match from the list of drag * and drop objects returned by the drag and drop events when we are * in INTERSECT mode. It returns either the first object that the * cursor is over, or the object that has the greatest overlap with * the dragged element. * @method getBestMatch * @param {DragDrop[]} dds The array of drag and drop objects * targeted * @return {DragDrop} The best single match * @static */ getBestMatch: function(dds) { var winner = null; var len = dds.length; if (len == 1) { winner = dds[0]; } else { // Loop through the targeted items for (var i=0; i * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups); * * Alternatively: * * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true}); * * @TODO this really should be an indexed array. Alternatively this * method could accept both. * @method refreshCache * @param {Object} groups an associative array of groups to refresh * @static */ refreshCache: function(groups) { // refresh everything if group array is not provided var g = groups || this.ids; for (var sGroup in g) { if ("string" != typeof sGroup) { continue; } for (var i in this.ids[sGroup]) { var oDD = this.ids[sGroup][i]; if (this.isTypeOfDD(oDD)) { var loc = this.getLocation(oDD); if (loc) { this.locationCache[oDD.id] = loc; } else { delete this.locationCache[oDD.id]; } } } } }, /** * This checks to make sure an element exists and is in the DOM. The * main purpose is to handle cases where innerHTML is used to remove * drag and drop objects from the DOM. IE provides an 'unspecified * error' when trying to access the offsetParent of such an element * @method verifyEl * @param {HTMLElement} el the element to check * @return {boolean} true if the element looks usable * @static */ verifyEl: function(el) { try { if (el) { var parent = el.offsetParent; if (parent) { return true; } } } catch(e) { } return false; }, /** * Returns a Region object containing the drag and drop element's position * and size, including the padding configured for it * @method getLocation * @param {DragDrop} oDD the drag and drop object to get the * location for * @return {YAHOO.util.Region} a Region object representing the total area * the element occupies, including any padding * the instance is configured for. * @static */ getLocation: function(oDD) { if (! this.isTypeOfDD(oDD)) { return null; } var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l; try { pos= YAHOO.util.Dom.getXY(el); } catch (e) { } if (!pos) { return null; } x1 = pos[0]; x2 = x1 + el.offsetWidth; y1 = pos[1]; y2 = y1 + el.offsetHeight; t = y1 - oDD.padding[0]; r = x2 + oDD.padding[1]; b = y2 + oDD.padding[2]; l = x1 - oDD.padding[3]; return new YAHOO.util.Region( t, r, b, l ); }, /** * Checks the cursor location to see if it over the target * @method isOverTarget * @param {YAHOO.util.Point} pt The point to evaluate * @param {DragDrop} oTarget the DragDrop object we are inspecting * @param {boolean} intersect true if we are in intersect mode * @param {YAHOO.util.Region} pre-cached location of the dragged element * @return {boolean} true if the mouse is over the target * @private * @static */ isOverTarget: function(pt, oTarget, intersect, curRegion) { // use cache if available var loc = this.locationCache[oTarget.id]; if (!loc || !this.useCache) { loc = this.getLocation(oTarget); this.locationCache[oTarget.id] = loc; } if (!loc) { return false; } oTarget.cursorIsOver = loc.contains( pt ); // DragDrop is using this as a sanity check for the initial mousedown // in this case we are done. In POINT mode, if the drag obj has no // contraints, we are done. Otherwise we need to evaluate the // region the target as occupies to determine if the dragged element // overlaps with it. var dc = this.dragCurrent; if (!dc || (!intersect && !dc.constrainX && !dc.constrainY)) { //if (oTarget.cursorIsOver) { //} return oTarget.cursorIsOver; } oTarget.overlap = null; // Get the current location of the drag element, this is the // location of the mouse event less the delta that represents // where the original mousedown happened on the element. We // need to consider constraints and ticks as well. if (!curRegion) { var pos = dc.getTargetCoord(pt.x, pt.y); var el = dc.getDragEl(); curRegion = new YAHOO.util.Region( pos.y, pos.x + el.offsetWidth, pos.y + el.offsetHeight, pos.x ); } var overlap = curRegion.intersect(loc); if (overlap) { oTarget.overlap = overlap; return (intersect) ? true : oTarget.cursorIsOver; } else { return false; } }, /** * unload event handler * @method _onUnload * @private * @static */ _onUnload: function(e, me) { this.unregAll(); }, /** * Cleans up the drag and drop events and objects. * @method unregAll * @private * @static */ unregAll: function() { if (this.dragCurrent) { this.stopDrag(); this.dragCurrent = null; } this._execOnAll("unreg", []); //for (var i in this.elementCache) { //delete this.elementCache[i]; //} //this.elementCache = {}; this.ids = {}; }, /** * A cache of DOM elements * @property elementCache * @private * @static * @deprecated elements are not cached now */ elementCache: {}, /** * Get the wrapper for the DOM element specified * @method getElWrapper * @param {String} id the id of the element to get * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element * @private * @deprecated This wrapper isn't that useful * @static */ getElWrapper: function(id) { var oWrapper = this.elementCache[id]; if (!oWrapper || !oWrapper.el) { oWrapper = this.elementCache[id] = new this.ElementWrapper(YAHOO.util.Dom.get(id)); } return oWrapper; }, /** * Returns the actual DOM element * @method getElement * @param {String} id the id of the elment to get * @return {Object} The element * @deprecated use YAHOO.util.Dom.get instead * @static */ getElement: function(id) { return YAHOO.util.Dom.get(id); }, /** * Returns the style property for the DOM element (i.e., * document.getElById(id).style) * @method getCss * @param {String} id the id of the elment to get * @return {Object} The style property of the element * @deprecated use YAHOO.util.Dom instead * @static */ getCss: function(id) { var el = YAHOO.util.Dom.get(id); return (el) ? el.style : null; }, /** * Inner class for cached elements * @class DragDropMgr.ElementWrapper * @for DragDropMgr * @private * @deprecated */ ElementWrapper: function(el) { /** * The element * @property el */ this.el = el || null; /** * The element id * @property id */ this.id = this.el && el.id; /** * A reference to the style property * @property css */ this.css = this.el && el.style; }, /** * Returns the X position of an html element * @method getPosX * @param el the element for which to get the position * @return {int} the X coordinate * @for DragDropMgr * @deprecated use YAHOO.util.Dom.getX instead * @static */ getPosX: function(el) { return YAHOO.util.Dom.getX(el); }, /** * Returns the Y position of an html element * @method getPosY * @param el the element for which to get the position * @return {int} the Y coordinate * @deprecated use YAHOO.util.Dom.getY instead * @static */ getPosY: function(el) { return YAHOO.util.Dom.getY(el); }, /** * Swap two nodes. In IE, we use the native method, for others we * emulate the IE behavior * @method swapNode * @param n1 the first node to swap * @param n2 the other node to swap * @static */ swapNode: function(n1, n2) { if (n1.swapNode) { n1.swapNode(n2); } else { var p = n2.parentNode; var s = n2.nextSibling; if (s == n1) { p.insertBefore(n1, n2); } else if (n2 == n1.nextSibling) { p.insertBefore(n2, n1); } else { n1.parentNode.replaceChild(n2, n1); p.insertBefore(n1, s); } } }, /** * Returns the current scroll position * @method getScroll * @private * @static */ getScroll: function () { var t, l, dde=document.documentElement, db=document.body; if (dde && (dde.scrollTop || dde.scrollLeft)) { t = dde.scrollTop; l = dde.scrollLeft; } else if (db) { t = db.scrollTop; l = db.scrollLeft; } else { } return { top: t, left: l }; }, /** * Returns the specified element style property * @method getStyle * @param {HTMLElement} el the element * @param {string} styleProp the style property * @return {string} The value of the style property * @deprecated use YAHOO.util.Dom.getStyle * @static */ getStyle: function(el, styleProp) { return YAHOO.util.Dom.getStyle(el, styleProp); }, /** * Gets the scrollTop * @method getScrollTop * @return {int} the document's scrollTop * @static */ getScrollTop: function () { return this.getScroll().top; }, /** * Gets the scrollLeft * @method getScrollLeft * @return {int} the document's scrollTop * @static */ getScrollLeft: function () { return this.getScroll().left; }, /** * Sets the x/y position of an element to the location of the * target element. * @method moveToEl * @param {HTMLElement} moveEl The element to move * @param {HTMLElement} targetEl The position reference element * @static */ moveToEl: function (moveEl, targetEl) { var aCoord = YAHOO.util.Dom.getXY(targetEl); YAHOO.util.Dom.setXY(moveEl, aCoord); }, /** * Gets the client height * @method getClientHeight * @return {int} client height in px * @deprecated use YAHOO.util.Dom.getViewportHeight instead * @static */ getClientHeight: function() { return YAHOO.util.Dom.getViewportHeight(); }, /** * Gets the client width * @method getClientWidth * @return {int} client width in px * @deprecated use YAHOO.util.Dom.getViewportWidth instead * @static */ getClientWidth: function() { return YAHOO.util.Dom.getViewportWidth(); }, /** * Numeric array sort function * @method numericSort * @static */ numericSort: function(a, b) { return (a - b); }, /** * Internal counter * @property _timeoutCount * @private * @static */ _timeoutCount: 0, /** * Trying to make the load order less important. Without this we get * an error if this file is loaded before the Event Utility. * @method _addListeners * @private * @static */ _addListeners: function() { var DDM = YAHOO.util.DDM; if ( YAHOO.util.Event && document ) { DDM._onLoad(); } else { if (DDM._timeoutCount > 2000) { } else { setTimeout(DDM._addListeners, 10); if (document && document.body) { DDM._timeoutCount += 1; } } } }, /** * Recursively searches the immediate parent and all child nodes for * the handle element in order to determine wheter or not it was * clicked. * @method handleWasClicked * @param node the html element to inspect * @static */ handleWasClicked: function(node, id) { if (this.isHandle(id, node.id)) { return true; } else { // check to see if this is a text node child of the one we want var p = node.parentNode; while (p) { if (this.isHandle(id, p.id)) { return true; } else { p = p.parentNode; } } } return false; } }; }(); // shorter alias, save a few bytes YAHOO.util.DDM = YAHOO.util.DragDropMgr; YAHOO.util.DDM._addListeners(); } (function() { var Event=YAHOO.util.Event; var Dom=YAHOO.util.Dom; /** * Defines the interface and base operation of items that that can be * dragged or can be drop targets. It was designed to be extended, overriding * the event handlers for startDrag, onDrag, onDragOver, onDragOut. * Up to three html elements can be associated with a DragDrop instance: *
      *
    • linked element: the element that is passed into the constructor. * This is the element which defines the boundaries for interaction with * other DragDrop objects.
    • *
    • handle element(s): The drag operation only occurs if the element that * was clicked matches a handle element. By default this is the linked * element, but there are times that you will want only a portion of the * linked element to initiate the drag operation, and the setHandleElId() * method provides a way to define this.
    • *
    • drag element: this represents an the element that would be moved along * with the cursor during a drag operation. By default, this is the linked * element itself as in {@link YAHOO.util.DD}. setDragElId() lets you define * a separate element that would be moved, as in {@link YAHOO.util.DDProxy} *
    • *
    * This class should not be instantiated until the onload event to ensure that * the associated elements are available. * The following would define a DragDrop obj that would interact with any * other DragDrop obj in the "group1" group: *
     *  dd = new YAHOO.util.DragDrop("div1", "group1");
     * 
    * Since none of the event handlers have been implemented, nothing would * actually happen if you were to run the code above. Normally you would * override this class or one of the default implementations, but you can * also override the methods you want on an instance of the class... *
     *  dd.onDragDrop = function(e, id) {
     *    alert("dd was dropped on " + id);
     *  }
     * 
    * @namespace YAHOO.util * @class DragDrop * @constructor * @param {String} id of the element that is linked to this instance * @param {String} sGroup the group of related DragDrop objects * @param {object} config an object containing configurable attributes * Valid properties for DragDrop: * padding, isTarget, maintainOffset, primaryButtonOnly, */ YAHOO.util.DragDrop = function(id, sGroup, config) { if (id) { this.init(id, sGroup, config); } }; YAHOO.util.DragDrop.prototype = { /** * An Object Literal containing the events that we will be using: mouseDown, b4MouseDown, mouseUp, b4StartDrag, startDrag, b4EndDrag, endDrag, mouseUp, drag, b4Drag, invalidDrop, b4DragOut, dragOut, dragEnter, b4DragOver, dragOver, b4DragDrop, dragDrop * By setting any of these to false, then event will not be fired. * @property events * @type object */ events: null, /** * @method on * @description Shortcut for EventProvider.subscribe, see YAHOO.util.EventProvider.subscribe */ on: function() { this.subscribe.apply(this, arguments); }, /** * The id of the element associated with this object. This is what we * refer to as the "linked element" because the size and position of * this element is used to determine when the drag and drop objects have * interacted. * @property id * @type String */ id: null, /** * Configuration attributes passed into the constructor * @property config * @type object */ config: null, /** * The id of the element that will be dragged. By default this is same * as the linked element , but could be changed to another element. Ex: * YAHOO.util.DDProxy * @property dragElId * @type String * @private */ dragElId: null, /** * the id of the element that initiates the drag operation. By default * this is the linked element, but could be changed to be a child of this * element. This lets us do things like only starting the drag when the * header element within the linked html element is clicked. * @property handleElId * @type String * @private */ handleElId: null, /** * An associative array of HTML tags that will be ignored if clicked. * @property invalidHandleTypes * @type {string: string} */ invalidHandleTypes: null, /** * An associative array of ids for elements that will be ignored if clicked * @property invalidHandleIds * @type {string: string} */ invalidHandleIds: null, /** * An indexted array of css class names for elements that will be ignored * if clicked. * @property invalidHandleClasses * @type string[] */ invalidHandleClasses: null, /** * The linked element's absolute X position at the time the drag was * started * @property startPageX * @type int * @private */ startPageX: 0, /** * The linked element's absolute X position at the time the drag was * started * @property startPageY * @type int * @private */ startPageY: 0, /** * The group defines a logical collection of DragDrop objects that are * related. Instances only get events when interacting with other * DragDrop object in the same group. This lets us define multiple * groups using a single DragDrop subclass if we want. * @property groups * @type {string: string} */ groups: null, /** * Individual drag/drop instances can be locked. This will prevent * onmousedown start drag. * @property locked * @type boolean * @private */ locked: false, /** * Lock this instance * @method lock */ lock: function() { this.locked = true; }, /** * Unlock this instace * @method unlock */ unlock: function() { this.locked = false; }, /** * By default, all instances can be a drop target. This can be disabled by * setting isTarget to false. * @property isTarget * @type boolean */ isTarget: true, /** * The padding configured for this drag and drop object for calculating * the drop zone intersection with this object. * @property padding * @type int[] */ padding: null, /** * If this flag is true, do not fire drop events. The element is a drag only element (for movement not dropping) * @property dragOnly * @type Boolean */ dragOnly: false, /** * Cached reference to the linked element * @property _domRef * @private */ _domRef: null, /** * Internal typeof flag * @property __ygDragDrop * @private */ __ygDragDrop: true, /** * Set to true when horizontal contraints are applied * @property constrainX * @type boolean * @private */ constrainX: false, /** * Set to true when vertical contraints are applied * @property constrainY * @type boolean * @private */ constrainY: false, /** * The left constraint * @property minX * @type int * @private */ minX: 0, /** * The right constraint * @property maxX * @type int * @private */ maxX: 0, /** * The up constraint * @property minY * @type int * @type int * @private */ minY: 0, /** * The down constraint * @property maxY * @type int * @private */ maxY: 0, /** * The difference between the click position and the source element's location * @property deltaX * @type int * @private */ deltaX: 0, /** * The difference between the click position and the source element's location * @property deltaY * @type int * @private */ deltaY: 0, /** * Maintain offsets when we resetconstraints. Set to true when you want * the position of the element relative to its parent to stay the same * when the page changes * * @property maintainOffset * @type boolean */ maintainOffset: false, /** * Array of pixel locations the element will snap to if we specified a * horizontal graduation/interval. This array is generated automatically * when you define a tick interval. * @property xTicks * @type int[] */ xTicks: null, /** * Array of pixel locations the element will snap to if we specified a * vertical graduation/interval. This array is generated automatically * when you define a tick interval. * @property yTicks * @type int[] */ yTicks: null, /** * By default the drag and drop instance will only respond to the primary * button click (left button for a right-handed mouse). Set to true to * allow drag and drop to start with any mouse click that is propogated * by the browser * @property primaryButtonOnly * @type boolean */ primaryButtonOnly: true, /** * The availabe property is false until the linked dom element is accessible. * @property available * @type boolean */ available: false, /** * By default, drags can only be initiated if the mousedown occurs in the * region the linked element is. This is done in part to work around a * bug in some browsers that mis-report the mousedown if the previous * mouseup happened outside of the window. This property is set to true * if outer handles are defined. * * @property hasOuterHandles * @type boolean * @default false */ hasOuterHandles: false, /** * Property that is assigned to a drag and drop object when testing to * see if it is being targeted by another dd object. This property * can be used in intersect mode to help determine the focus of * the mouse interaction. DDM.getBestMatch uses this property first to * determine the closest match in INTERSECT mode when multiple targets * are part of the same interaction. * @property cursorIsOver * @type boolean */ cursorIsOver: false, /** * Property that is assigned to a drag and drop object when testing to * see if it is being targeted by another dd object. This is a region * that represents the area the draggable element overlaps this target. * DDM.getBestMatch uses this property to compare the size of the overlap * to that of other targets in order to determine the closest match in * INTERSECT mode when multiple targets are part of the same interaction. * @property overlap * @type YAHOO.util.Region */ overlap: null, /** * Code that executes immediately before the startDrag event * @method b4StartDrag * @private */ b4StartDrag: function(x, y) { }, /** * Abstract method called after a drag/drop object is clicked * and the drag or mousedown time thresholds have beeen met. * @method startDrag * @param {int} X click location * @param {int} Y click location */ startDrag: function(x, y) { /* override this */ }, /** * Code that executes immediately before the onDrag event * @method b4Drag * @private */ b4Drag: function(e) { }, /** * Abstract method called during the onMouseMove event while dragging an * object. * @method onDrag * @param {Event} e the mousemove event */ onDrag: function(e) { /* override this */ }, /** * Abstract method called when this element fist begins hovering over * another DragDrop obj * @method onDragEnter * @param {Event} e the mousemove event * @param {String|DragDrop[]} id In POINT mode, the element * id this is hovering over. In INTERSECT mode, an array of one or more * dragdrop items being hovered over. */ onDragEnter: function(e, id) { /* override this */ }, /** * Code that executes immediately before the onDragOver event * @method b4DragOver * @private */ b4DragOver: function(e) { }, /** * Abstract method called when this element is hovering over another * DragDrop obj * @method onDragOver * @param {Event} e the mousemove event * @param {String|DragDrop[]} id In POINT mode, the element * id this is hovering over. In INTERSECT mode, an array of dd items * being hovered over. */ onDragOver: function(e, id) { /* override this */ }, /** * Code that executes immediately before the onDragOut event * @method b4DragOut * @private */ b4DragOut: function(e) { }, /** * Abstract method called when we are no longer hovering over an element * @method onDragOut * @param {Event} e the mousemove event * @param {String|DragDrop[]} id In POINT mode, the element * id this was hovering over. In INTERSECT mode, an array of dd items * that the mouse is no longer over. */ onDragOut: function(e, id) { /* override this */ }, /** * Code that executes immediately before the onDragDrop event * @method b4DragDrop * @private */ b4DragDrop: function(e) { }, /** * Abstract method called when this item is dropped on another DragDrop * obj * @method onDragDrop * @param {Event} e the mouseup event * @param {String|DragDrop[]} id In POINT mode, the element * id this was dropped on. In INTERSECT mode, an array of dd items this * was dropped on. */ onDragDrop: function(e, id) { /* override this */ }, /** * Abstract method called when this item is dropped on an area with no * drop target * @method onInvalidDrop * @param {Event} e the mouseup event */ onInvalidDrop: function(e) { /* override this */ }, /** * Code that executes immediately before the endDrag event * @method b4EndDrag * @private */ b4EndDrag: function(e) { }, /** * Fired when we are done dragging the object * @method endDrag * @param {Event} e the mouseup event */ endDrag: function(e) { /* override this */ }, /** * Code executed immediately before the onMouseDown event * @method b4MouseDown * @param {Event} e the mousedown event * @private */ b4MouseDown: function(e) { }, /** * Event handler that fires when a drag/drop obj gets a mousedown * @method onMouseDown * @param {Event} e the mousedown event */ onMouseDown: function(e) { /* override this */ }, /** * Event handler that fires when a drag/drop obj gets a mouseup * @method onMouseUp * @param {Event} e the mouseup event */ onMouseUp: function(e) { /* override this */ }, /** * Override the onAvailable method to do what is needed after the initial * position was determined. * @method onAvailable */ onAvailable: function () { }, /** * Returns a reference to the linked element * @method getEl * @return {HTMLElement} the html element */ getEl: function() { if (!this._domRef) { this._domRef = Dom.get(this.id); } return this._domRef; }, /** * Returns a reference to the actual element to drag. By default this is * the same as the html element, but it can be assigned to another * element. An example of this can be found in YAHOO.util.DDProxy * @method getDragEl * @return {HTMLElement} the html element */ getDragEl: function() { return Dom.get(this.dragElId); }, /** * Sets up the DragDrop object. Must be called in the constructor of any * YAHOO.util.DragDrop subclass * @method init * @param id the id of the linked element * @param {String} sGroup the group of related items * @param {object} config configuration attributes */ init: function(id, sGroup, config) { this.initTarget(id, sGroup, config); Event.on(this._domRef || this.id, "mousedown", this.handleMouseDown, this, true); // Event.on(this.id, "selectstart", Event.preventDefault); for (var i in this.events) { this.createEvent(i + 'Event'); } }, /** * Initializes Targeting functionality only... the object does not * get a mousedown handler. * @method initTarget * @param id the id of the linked element * @param {String} sGroup the group of related items * @param {object} config configuration attributes */ initTarget: function(id, sGroup, config) { // configuration attributes this.config = config || {}; this.events = {}; // create a local reference to the drag and drop manager this.DDM = YAHOO.util.DDM; // initialize the groups object this.groups = {}; // assume that we have an element reference instead of an id if the // parameter is not a string if (typeof id !== "string") { this._domRef = id; id = Dom.generateId(id); } // set the id this.id = id; // add to an interaction group this.addToGroup((sGroup) ? sGroup : "default"); // We don't want to register this as the handle with the manager // so we just set the id rather than calling the setter. this.handleElId = id; Event.onAvailable(id, this.handleOnAvailable, this, true); // the linked element is the element that gets dragged by default this.setDragElId(id); // by default, clicked anchors will not start drag operations. // @TODO what else should be here? Probably form fields. this.invalidHandleTypes = { A: "A" }; this.invalidHandleIds = {}; this.invalidHandleClasses = []; this.applyConfig(); }, /** * Applies the configuration parameters that were passed into the constructor. * This is supposed to happen at each level through the inheritance chain. So * a DDProxy implentation will execute apply config on DDProxy, DD, and * DragDrop in order to get all of the parameters that are available in * each object. * @method applyConfig */ applyConfig: function() { this.events = { mouseDown: true, b4MouseDown: true, mouseUp: true, b4StartDrag: true, startDrag: true, b4EndDrag: true, endDrag: true, drag: true, b4Drag: true, invalidDrop: true, b4DragOut: true, dragOut: true, dragEnter: true, b4DragOver: true, dragOver: true, b4DragDrop: true, dragDrop: true }; if (this.config.events) { for (var i in this.config.events) { if (this.config.events[i] === false) { this.events[i] = false; } } } // configurable properties: // padding, isTarget, maintainOffset, primaryButtonOnly this.padding = this.config.padding || [0, 0, 0, 0]; this.isTarget = (this.config.isTarget !== false); this.maintainOffset = (this.config.maintainOffset); this.primaryButtonOnly = (this.config.primaryButtonOnly !== false); this.dragOnly = ((this.config.dragOnly === true) ? true : false); }, /** * Executed when the linked element is available * @method handleOnAvailable * @private */ handleOnAvailable: function() { this.available = true; this.resetConstraints(); this.onAvailable(); }, /** * Configures the padding for the target zone in px. Effectively expands * (or reduces) the virtual object size for targeting calculations. * Supports css-style shorthand; if only one parameter is passed, all sides * will have that padding, and if only two are passed, the top and bottom * will have the first param, the left and right the second. * @method setPadding * @param {int} iTop Top pad * @param {int} iRight Right pad * @param {int} iBot Bot pad * @param {int} iLeft Left pad */ setPadding: function(iTop, iRight, iBot, iLeft) { // this.padding = [iLeft, iRight, iTop, iBot]; if (!iRight && 0 !== iRight) { this.padding = [iTop, iTop, iTop, iTop]; } else if (!iBot && 0 !== iBot) { this.padding = [iTop, iRight, iTop, iRight]; } else { this.padding = [iTop, iRight, iBot, iLeft]; } }, /** * Stores the initial placement of the linked element. * @method setInitialPosition * @param {int} diffX the X offset, default 0 * @param {int} diffY the Y offset, default 0 * @private */ setInitPosition: function(diffX, diffY) { var el = this.getEl(); if (!this.DDM.verifyEl(el)) { if (el && el.style && (el.style.display == 'none')) { } else { } return; } var dx = diffX || 0; var dy = diffY || 0; var p = Dom.getXY( el ); this.initPageX = p[0] - dx; this.initPageY = p[1] - dy; this.lastPageX = p[0]; this.lastPageY = p[1]; this.setStartPosition(p); }, /** * Sets the start position of the element. This is set when the obj * is initialized, the reset when a drag is started. * @method setStartPosition * @param pos current position (from previous lookup) * @private */ setStartPosition: function(pos) { var p = pos || Dom.getXY(this.getEl()); this.deltaSetXY = null; this.startPageX = p[0]; this.startPageY = p[1]; }, /** * Add this instance to a group of related drag/drop objects. All * instances belong to at least one group, and can belong to as many * groups as needed. * @method addToGroup * @param sGroup {string} the name of the group */ addToGroup: function(sGroup) { this.groups[sGroup] = true; this.DDM.regDragDrop(this, sGroup); }, /** * Remove's this instance from the supplied interaction group * @method removeFromGroup * @param {string} sGroup The group to drop */ removeFromGroup: function(sGroup) { if (this.groups[sGroup]) { delete this.groups[sGroup]; } this.DDM.removeDDFromGroup(this, sGroup); }, /** * Allows you to specify that an element other than the linked element * will be moved with the cursor during a drag * @method setDragElId * @param id {string} the id of the element that will be used to initiate the drag */ setDragElId: function(id) { this.dragElId = id; }, /** * Allows you to specify a child of the linked element that should be * used to initiate the drag operation. An example of this would be if * you have a content div with text and links. Clicking anywhere in the * content area would normally start the drag operation. Use this method * to specify that an element inside of the content div is the element * that starts the drag operation. * @method setHandleElId * @param id {string} the id of the element that will be used to * initiate the drag. */ setHandleElId: function(id) { if (typeof id !== "string") { id = Dom.generateId(id); } this.handleElId = id; this.DDM.regHandle(this.id, id); }, /** * Allows you to set an element outside of the linked element as a drag * handle * @method setOuterHandleElId * @param id the id of the element that will be used to initiate the drag */ setOuterHandleElId: function(id) { if (typeof id !== "string") { id = Dom.generateId(id); } Event.on(id, "mousedown", this.handleMouseDown, this, true); this.setHandleElId(id); this.hasOuterHandles = true; }, /** * Remove all drag and drop hooks for this element * @method unreg */ unreg: function() { Event.removeListener(this.id, "mousedown", this.handleMouseDown); this._domRef = null; this.DDM._remove(this); }, /** * Returns true if this instance is locked, or the drag drop mgr is locked * (meaning that all drag/drop is disabled on the page.) * @method isLocked * @return {boolean} true if this obj or all drag/drop is locked, else * false */ isLocked: function() { return (this.DDM.isLocked() || this.locked); }, /** * Fired when this object is clicked * @method handleMouseDown * @param {Event} e * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj) * @private */ handleMouseDown: function(e, oDD) { var button = e.which || e.button; if (this.primaryButtonOnly && button > 1) { return; } if (this.isLocked()) { return; } // firing the mousedown events prior to calculating positions var b4Return = this.b4MouseDown(e); if (this.events.b4MouseDown) { b4Return = this.fireEvent('b4MouseDownEvent', e); } var mDownReturn = this.onMouseDown(e); if (this.events.mouseDown) { mDownReturn = this.fireEvent('mouseDownEvent', e); } if ((b4Return === false) || (mDownReturn === false)) { return; } this.DDM.refreshCache(this.groups); // var self = this; // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0); // Only process the event if we really clicked within the linked // element. The reason we make this check is that in the case that // another element was moved between the clicked element and the // cursor in the time between the mousedown and mouseup events. When // this happens, the element gets the next mousedown event // regardless of where on the screen it happened. var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e)); if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) ) { } else { if (this.clickValidator(e)) { // set the initial element position this.setStartPosition(); // start tracking mousemove distance and mousedown time to // determine when to start the actual drag this.DDM.handleMouseDown(e, this); // this mousedown is mine this.DDM.stopEvent(e); } else { } } }, /** * @method clickValidator * @description Method validates that the clicked element * was indeed the handle or a valid child of the handle * @param {Event} e */ clickValidator: function(e) { var target = YAHOO.util.Event.getTarget(e); return ( this.isValidHandleChild(target) && (this.id == this.handleElId || this.DDM.handleWasClicked(target, this.id)) ); }, /** * Finds the location the element should be placed if we want to move * it to where the mouse location less the click offset would place us. * @method getTargetCoord * @param {int} iPageX the X coordinate of the click * @param {int} iPageY the Y coordinate of the click * @return an object that contains the coordinates (Object.x and Object.y) * @private */ getTargetCoord: function(iPageX, iPageY) { var x = iPageX - this.deltaX; var y = iPageY - this.deltaY; if (this.constrainX) { if (x < this.minX) { x = this.minX; } if (x > this.maxX) { x = this.maxX; } } if (this.constrainY) { if (y < this.minY) { y = this.minY; } if (y > this.maxY) { y = this.maxY; } } x = this.getTick(x, this.xTicks); y = this.getTick(y, this.yTicks); return {x:x, y:y}; }, /** * Allows you to specify a tag name that should not start a drag operation * when clicked. This is designed to facilitate embedding links within a * drag handle that do something other than start the drag. * @method addInvalidHandleType * @param {string} tagName the type of element to exclude */ addInvalidHandleType: function(tagName) { var type = tagName.toUpperCase(); this.invalidHandleTypes[type] = type; }, /** * Lets you to specify an element id for a child of a drag handle * that should not initiate a drag * @method addInvalidHandleId * @param {string} id the element id of the element you wish to ignore */ addInvalidHandleId: function(id) { if (typeof id !== "string") { id = Dom.generateId(id); } this.invalidHandleIds[id] = id; }, /** * Lets you specify a css class of elements that will not initiate a drag * @method addInvalidHandleClass * @param {string} cssClass the class of the elements you wish to ignore */ addInvalidHandleClass: function(cssClass) { this.invalidHandleClasses.push(cssClass); }, /** * Unsets an excluded tag name set by addInvalidHandleType * @method removeInvalidHandleType * @param {string} tagName the type of element to unexclude */ removeInvalidHandleType: function(tagName) { var type = tagName.toUpperCase(); // this.invalidHandleTypes[type] = null; delete this.invalidHandleTypes[type]; }, /** * Unsets an invalid handle id * @method removeInvalidHandleId * @param {string} id the id of the element to re-enable */ removeInvalidHandleId: function(id) { if (typeof id !== "string") { id = Dom.generateId(id); } delete this.invalidHandleIds[id]; }, /** * Unsets an invalid css class * @method removeInvalidHandleClass * @param {string} cssClass the class of the element(s) you wish to * re-enable */ removeInvalidHandleClass: function(cssClass) { for (var i=0, len=this.invalidHandleClasses.length; i= this.minX; i = i - iTickSize) { if (!tickMap[i]) { this.xTicks[this.xTicks.length] = i; tickMap[i] = true; } } for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) { if (!tickMap[i]) { this.xTicks[this.xTicks.length] = i; tickMap[i] = true; } } this.xTicks.sort(this.DDM.numericSort) ; }, /** * Create the array of vertical tick marks if an interval was specified in * setYConstraint(). * @method setYTicks * @private */ setYTicks: function(iStartY, iTickSize) { this.yTicks = []; this.yTickSize = iTickSize; var tickMap = {}; for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) { if (!tickMap[i]) { this.yTicks[this.yTicks.length] = i; tickMap[i] = true; } } for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) { if (!tickMap[i]) { this.yTicks[this.yTicks.length] = i; tickMap[i] = true; } } this.yTicks.sort(this.DDM.numericSort) ; }, /** * By default, the element can be dragged any place on the screen. Use * this method to limit the horizontal travel of the element. Pass in * 0,0 for the parameters if you want to lock the drag to the y axis. * @method setXConstraint * @param {int} iLeft the number of pixels the element can move to the left * @param {int} iRight the number of pixels the element can move to the * right * @param {int} iTickSize optional parameter for specifying that the * element * should move iTickSize pixels at a time. */ setXConstraint: function(iLeft, iRight, iTickSize) { this.leftConstraint = parseInt(iLeft, 10); this.rightConstraint = parseInt(iRight, 10); this.minX = this.initPageX - this.leftConstraint; this.maxX = this.initPageX + this.rightConstraint; if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); } this.constrainX = true; }, /** * Clears any constraints applied to this instance. Also clears ticks * since they can't exist independent of a constraint at this time. * @method clearConstraints */ clearConstraints: function() { this.constrainX = false; this.constrainY = false; this.clearTicks(); }, /** * Clears any tick interval defined for this instance * @method clearTicks */ clearTicks: function() { this.xTicks = null; this.yTicks = null; this.xTickSize = 0; this.yTickSize = 0; }, /** * By default, the element can be dragged any place on the screen. Set * this to limit the vertical travel of the element. Pass in 0,0 for the * parameters if you want to lock the drag to the x axis. * @method setYConstraint * @param {int} iUp the number of pixels the element can move up * @param {int} iDown the number of pixels the element can move down * @param {int} iTickSize optional parameter for specifying that the * element should move iTickSize pixels at a time. */ setYConstraint: function(iUp, iDown, iTickSize) { this.topConstraint = parseInt(iUp, 10); this.bottomConstraint = parseInt(iDown, 10); this.minY = this.initPageY - this.topConstraint; this.maxY = this.initPageY + this.bottomConstraint; if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); } this.constrainY = true; }, /** * resetConstraints must be called if you manually reposition a dd element. * @method resetConstraints */ resetConstraints: function() { // Maintain offsets if necessary if (this.initPageX || this.initPageX === 0) { // figure out how much this thing has moved var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0; var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0; this.setInitPosition(dx, dy); // This is the first time we have detected the element's position } else { this.setInitPosition(); } if (this.constrainX) { this.setXConstraint( this.leftConstraint, this.rightConstraint, this.xTickSize ); } if (this.constrainY) { this.setYConstraint( this.topConstraint, this.bottomConstraint, this.yTickSize ); } }, /** * Normally the drag element is moved pixel by pixel, but we can specify * that it move a number of pixels at a time. This method resolves the * location when we have it set up like this. * @method getTick * @param {int} val where we want to place the object * @param {int[]} tickArray sorted array of valid points * @return {int} the closest tick * @private */ getTick: function(val, tickArray) { if (!tickArray) { // If tick interval is not defined, it is effectively 1 pixel, // so we return the value passed to us. return val; } else if (tickArray[0] >= val) { // The value is lower than the first tick, so we return the first // tick. return tickArray[0]; } else { for (var i=0, len=tickArray.length; i= val) { var diff1 = val - tickArray[i]; var diff2 = tickArray[next] - val; return (diff2 > diff1) ? tickArray[i] : tickArray[next]; } } // The value is larger than the last tick, so we return the last // tick. return tickArray[tickArray.length - 1]; } }, /** * toString method * @method toString * @return {string} string representation of the dd obj */ toString: function() { return ("DragDrop " + this.id); } }; YAHOO.augment(YAHOO.util.DragDrop, YAHOO.util.EventProvider); /** * @event mouseDownEvent * @description Provides access to the mousedown event. The mousedown does not always result in a drag operation. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4MouseDownEvent * @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event mouseUpEvent * @description Fired from inside DragDropMgr when the drag operation is finished. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4StartDragEvent * @description Fires before the startDragEvent, returning false will cancel the startDrag Event. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event startDragEvent * @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4EndDragEvent * @description Fires before the endDragEvent. Returning false will cancel. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event endDragEvent * @description Fires on the mouseup event after a drag has been initiated (startDrag fired). * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragEvent * @description Occurs every mousemove event while dragging. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragEvent * @description Fires before the dragEvent. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event invalidDropEvent * @description Fires when the dragged objects is dropped in a location that contains no drop targets. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragOutEvent * @description Fires before the dragOutEvent * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragOutEvent * @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragEnterEvent * @description Occurs when the dragged object first interacts with another targettable drag and drop object. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragOverEvent * @description Fires before the dragOverEvent. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragOverEvent * @description Fires every mousemove event while over a drag and drop object. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragDropEvent * @description Fires before the dragDropEvent * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragDropEvent * @description Fires when the dragged objects is dropped on another. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ })(); /** * A DragDrop implementation where the linked element follows the * mouse cursor during a drag. * @class DD * @extends YAHOO.util.DragDrop * @constructor * @param {String} id the id of the linked element * @param {String} sGroup the group of related DragDrop items * @param {object} config an object containing configurable attributes * Valid properties for DD: * scroll */ YAHOO.util.DD = function(id, sGroup, config) { if (id) { this.init(id, sGroup, config); } }; YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, { /** * When set to true, the utility automatically tries to scroll the browser * window wehn a drag and drop element is dragged near the viewport boundary. * Defaults to true. * @property scroll * @type boolean */ scroll: true, /** * Sets the pointer offset to the distance between the linked element's top * left corner and the location the element was clicked * @method autoOffset * @param {int} iPageX the X coordinate of the click * @param {int} iPageY the Y coordinate of the click */ autoOffset: function(iPageX, iPageY) { var x = iPageX - this.startPageX; var y = iPageY - this.startPageY; this.setDelta(x, y); }, /** * Sets the pointer offset. You can call this directly to force the * offset to be in a particular location (e.g., pass in 0,0 to set it * to the center of the object, as done in YAHOO.widget.Slider) * @method setDelta * @param {int} iDeltaX the distance from the left * @param {int} iDeltaY the distance from the top */ setDelta: function(iDeltaX, iDeltaY) { this.deltaX = iDeltaX; this.deltaY = iDeltaY; }, /** * Sets the drag element to the location of the mousedown or click event, * maintaining the cursor location relative to the location on the element * that was clicked. Override this if you want to place the element in a * location other than where the cursor is. * @method setDragElPos * @param {int} iPageX the X coordinate of the mousedown or drag event * @param {int} iPageY the Y coordinate of the mousedown or drag event */ setDragElPos: function(iPageX, iPageY) { // the first time we do this, we are going to check to make sure // the element has css positioning var el = this.getDragEl(); this.alignElWithMouse(el, iPageX, iPageY); }, /** * Sets the element to the location of the mousedown or click event, * maintaining the cursor location relative to the location on the element * that was clicked. Override this if you want to place the element in a * location other than where the cursor is. * @method alignElWithMouse * @param {HTMLElement} el the element to move * @param {int} iPageX the X coordinate of the mousedown or drag event * @param {int} iPageY the Y coordinate of the mousedown or drag event */ alignElWithMouse: function(el, iPageX, iPageY) { var oCoord = this.getTargetCoord(iPageX, iPageY); if (!this.deltaSetXY) { var aCoord = [oCoord.x, oCoord.y]; YAHOO.util.Dom.setXY(el, aCoord); var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 ); var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 ); this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ]; } else { YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px"); YAHOO.util.Dom.setStyle(el, "top", (oCoord.y + this.deltaSetXY[1]) + "px"); } this.cachePosition(oCoord.x, oCoord.y); var self = this; setTimeout(function() { self.autoScroll.call(self, oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth); }, 0); }, /** * Saves the most recent position so that we can reset the constraints and * tick marks on-demand. We need to know this so that we can calculate the * number of pixels the element is offset from its original position. * @method cachePosition * @param iPageX the current x position (optional, this just makes it so we * don't have to look it up again) * @param iPageY the current y position (optional, this just makes it so we * don't have to look it up again) */ cachePosition: function(iPageX, iPageY) { if (iPageX) { this.lastPageX = iPageX; this.lastPageY = iPageY; } else { var aCoord = YAHOO.util.Dom.getXY(this.getEl()); this.lastPageX = aCoord[0]; this.lastPageY = aCoord[1]; } }, /** * Auto-scroll the window if the dragged object has been moved beyond the * visible window boundary. * @method autoScroll * @param {int} x the drag element's x position * @param {int} y the drag element's y position * @param {int} h the height of the drag element * @param {int} w the width of the drag element * @private */ autoScroll: function(x, y, h, w) { if (this.scroll) { // The client height var clientH = this.DDM.getClientHeight(); // The client width var clientW = this.DDM.getClientWidth(); // The amt scrolled down var st = this.DDM.getScrollTop(); // The amt scrolled right var sl = this.DDM.getScrollLeft(); // Location of the bottom of the element var bot = h + y; // Location of the right of the element var right = w + x; // The distance from the cursor to the bottom of the visible area, // adjusted so that we don't scroll if the cursor is beyond the // element drag constraints var toBot = (clientH + st - y - this.deltaY); // The distance from the cursor to the right of the visible area var toRight = (clientW + sl - x - this.deltaX); // How close to the edge the cursor must be before we scroll // var thresh = (document.all) ? 100 : 40; var thresh = 40; // How many pixels to scroll per autoscroll op. This helps to reduce // clunky scrolling. IE is more sensitive about this ... it needs this // value to be higher. var scrAmt = (document.all) ? 80 : 30; // Scroll down if we are near the bottom of the visible page and the // obj extends below the crease if ( bot > clientH && toBot < thresh ) { window.scrollTo(sl, st + scrAmt); } // Scroll up if the window is scrolled down and the top of the object // goes above the top border if ( y < st && st > 0 && y - st < thresh ) { window.scrollTo(sl, st - scrAmt); } // Scroll right if the obj is beyond the right border and the cursor is // near the border. if ( right > clientW && toRight < thresh ) { window.scrollTo(sl + scrAmt, st); } // Scroll left if the window has been scrolled to the right and the obj // extends past the left border if ( x < sl && sl > 0 && x - sl < thresh ) { window.scrollTo(sl - scrAmt, st); } } }, /* * Sets up config options specific to this class. Overrides * YAHOO.util.DragDrop, but all versions of this method through the * inheritance chain are called */ applyConfig: function() { YAHOO.util.DD.superclass.applyConfig.call(this); this.scroll = (this.config.scroll !== false); }, /* * Event that fires prior to the onMouseDown event. Overrides * YAHOO.util.DragDrop. */ b4MouseDown: function(e) { this.setStartPosition(); // this.resetConstraints(); this.autoOffset(YAHOO.util.Event.getPageX(e), YAHOO.util.Event.getPageY(e)); }, /* * Event that fires prior to the onDrag event. Overrides * YAHOO.util.DragDrop. */ b4Drag: function(e) { this.setDragElPos(YAHOO.util.Event.getPageX(e), YAHOO.util.Event.getPageY(e)); }, toString: function() { return ("DD " + this.id); } ////////////////////////////////////////////////////////////////////////// // Debugging ygDragDrop events that can be overridden ////////////////////////////////////////////////////////////////////////// /* startDrag: function(x, y) { }, onDrag: function(e) { }, onDragEnter: function(e, id) { }, onDragOver: function(e, id) { }, onDragOut: function(e, id) { }, onDragDrop: function(e, id) { }, endDrag: function(e) { } */ /** * @event mouseDownEvent * @description Provides access to the mousedown event. The mousedown does not always result in a drag operation. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4MouseDownEvent * @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event mouseUpEvent * @description Fired from inside DragDropMgr when the drag operation is finished. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4StartDragEvent * @description Fires before the startDragEvent, returning false will cancel the startDrag Event. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event startDragEvent * @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4EndDragEvent * @description Fires before the endDragEvent. Returning false will cancel. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event endDragEvent * @description Fires on the mouseup event after a drag has been initiated (startDrag fired). * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragEvent * @description Occurs every mousemove event while dragging. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragEvent * @description Fires before the dragEvent. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event invalidDropEvent * @description Fires when the dragged objects is dropped in a location that contains no drop targets. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragOutEvent * @description Fires before the dragOutEvent * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragOutEvent * @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragEnterEvent * @description Occurs when the dragged object first interacts with another targettable drag and drop object. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragOverEvent * @description Fires before the dragOverEvent. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragOverEvent * @description Fires every mousemove event while over a drag and drop object. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragDropEvent * @description Fires before the dragDropEvent * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragDropEvent * @description Fires when the dragged objects is dropped on another. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ }); /** * A DragDrop implementation that inserts an empty, bordered div into * the document that follows the cursor during drag operations. At the time of * the click, the frame div is resized to the dimensions of the linked html * element, and moved to the exact location of the linked element. * * References to the "frame" element refer to the single proxy element that * was created to be dragged in place of all DDProxy elements on the * page. * * @class DDProxy * @extends YAHOO.util.DD * @constructor * @param {String} id the id of the linked html element * @param {String} sGroup the group of related DragDrop objects * @param {object} config an object containing configurable attributes * Valid properties for DDProxy in addition to those in DragDrop: * resizeFrame, centerFrame, dragElId */ YAHOO.util.DDProxy = function(id, sGroup, config) { if (id) { this.init(id, sGroup, config); this.initFrame(); } }; /** * The default drag frame div id * @property YAHOO.util.DDProxy.dragElId * @type String * @static */ YAHOO.util.DDProxy.dragElId = "ygddfdiv"; YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, { /** * By default we resize the drag frame to be the same size as the element * we want to drag (this is to get the frame effect). We can turn it off * if we want a different behavior. * @property resizeFrame * @type boolean */ resizeFrame: true, /** * By default the frame is positioned exactly where the drag element is, so * we use the cursor offset provided by YAHOO.util.DD. Another option that works only if * you do not have constraints on the obj is to have the drag frame centered * around the cursor. Set centerFrame to true for this effect. * @property centerFrame * @type boolean */ centerFrame: false, /** * Creates the proxy element if it does not yet exist * @method createFrame */ createFrame: function() { var self=this, body=document.body; if (!body || !body.firstChild) { setTimeout( function() { self.createFrame(); }, 50 ); return; } var div=this.getDragEl(), Dom=YAHOO.util.Dom; if (!div) { div = document.createElement("div"); div.id = this.dragElId; var s = div.style; s.position = "absolute"; s.visibility = "hidden"; s.cursor = "move"; s.border = "2px solid #aaa"; s.zIndex = 999; s.height = "25px"; s.width = "25px"; var _data = document.createElement('div'); Dom.setStyle(_data, 'height', '100%'); Dom.setStyle(_data, 'width', '100%'); /** * If the proxy element has no background-color, then it is considered to the "transparent" by Internet Explorer. * Since it is "transparent" then the events pass through it to the iframe below. * So creating a "fake" div inside the proxy element and giving it a background-color, then setting it to an * opacity of 0, it appears to not be there, however IE still thinks that it is so the events never pass through. */ Dom.setStyle(_data, 'background-color', '#ccc'); Dom.setStyle(_data, 'opacity', '0'); div.appendChild(_data); /** * It seems that IE will fire the mouseup event if you pass a proxy element over a select box * Placing the IFRAME element inside seems to stop this issue */ if (YAHOO.env.ua.ie) { //Only needed for Internet Explorer var ifr = document.createElement('iframe'); ifr.setAttribute('src', 'about:blank'); ifr.setAttribute('scrolling', 'no'); ifr.setAttribute('frameborder', '0'); div.insertBefore(ifr, div.firstChild); Dom.setStyle(ifr, 'height', '100%'); Dom.setStyle(ifr, 'width', '100%'); Dom.setStyle(ifr, 'position', 'absolute'); Dom.setStyle(ifr, 'top', '0'); Dom.setStyle(ifr, 'left', '0'); Dom.setStyle(ifr, 'opacity', '0'); Dom.setStyle(ifr, 'zIndex', '-1'); Dom.setStyle(ifr.nextSibling, 'zIndex', '2'); } // appendChild can blow up IE if invoked prior to the window load event // while rendering a table. It is possible there are other scenarios // that would cause this to happen as well. body.insertBefore(div, body.firstChild); } }, /** * Initialization for the drag frame element. Must be called in the * constructor of all subclasses * @method initFrame */ initFrame: function() { this.createFrame(); }, applyConfig: function() { YAHOO.util.DDProxy.superclass.applyConfig.call(this); this.resizeFrame = (this.config.resizeFrame !== false); this.centerFrame = (this.config.centerFrame); this.setDragElId(this.config.dragElId || YAHOO.util.DDProxy.dragElId); }, /** * Resizes the drag frame to the dimensions of the clicked object, positions * it over the object, and finally displays it * @method showFrame * @param {int} iPageX X click position * @param {int} iPageY Y click position * @private */ showFrame: function(iPageX, iPageY) { var el = this.getEl(); var dragEl = this.getDragEl(); var s = dragEl.style; this._resizeProxy(); if (this.centerFrame) { this.setDelta( Math.round(parseInt(s.width, 10)/2), Math.round(parseInt(s.height, 10)/2) ); } this.setDragElPos(iPageX, iPageY); YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible"); }, /** * The proxy is automatically resized to the dimensions of the linked * element when a drag is initiated, unless resizeFrame is set to false * @method _resizeProxy * @private */ _resizeProxy: function() { if (this.resizeFrame) { var DOM = YAHOO.util.Dom; var el = this.getEl(); var dragEl = this.getDragEl(); var bt = parseInt( DOM.getStyle(dragEl, "borderTopWidth" ), 10); var br = parseInt( DOM.getStyle(dragEl, "borderRightWidth" ), 10); var bb = parseInt( DOM.getStyle(dragEl, "borderBottomWidth" ), 10); var bl = parseInt( DOM.getStyle(dragEl, "borderLeftWidth" ), 10); if (isNaN(bt)) { bt = 0; } if (isNaN(br)) { br = 0; } if (isNaN(bb)) { bb = 0; } if (isNaN(bl)) { bl = 0; } var newWidth = Math.max(0, el.offsetWidth - br - bl); var newHeight = Math.max(0, el.offsetHeight - bt - bb); DOM.setStyle( dragEl, "width", newWidth + "px" ); DOM.setStyle( dragEl, "height", newHeight + "px" ); } }, // overrides YAHOO.util.DragDrop b4MouseDown: function(e) { this.setStartPosition(); var x = YAHOO.util.Event.getPageX(e); var y = YAHOO.util.Event.getPageY(e); this.autoOffset(x, y); // This causes the autoscroll code to kick off, which means autoscroll can // happen prior to the check for a valid drag handle. // this.setDragElPos(x, y); }, // overrides YAHOO.util.DragDrop b4StartDrag: function(x, y) { // show the drag frame this.showFrame(x, y); }, // overrides YAHOO.util.DragDrop b4EndDrag: function(e) { YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden"); }, // overrides YAHOO.util.DragDrop // By default we try to move the element to the last location of the frame. // This is so that the default behavior mirrors that of YAHOO.util.DD. endDrag: function(e) { var DOM = YAHOO.util.Dom; var lel = this.getEl(); var del = this.getDragEl(); // Show the drag frame briefly so we can get its position // del.style.visibility = ""; DOM.setStyle(del, "visibility", ""); // Hide the linked element before the move to get around a Safari // rendering bug. //lel.style.visibility = "hidden"; DOM.setStyle(lel, "visibility", "hidden"); YAHOO.util.DDM.moveToEl(lel, del); //del.style.visibility = "hidden"; DOM.setStyle(del, "visibility", "hidden"); //lel.style.visibility = ""; DOM.setStyle(lel, "visibility", ""); }, toString: function() { return ("DDProxy " + this.id); } /** * @event mouseDownEvent * @description Provides access to the mousedown event. The mousedown does not always result in a drag operation. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4MouseDownEvent * @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event mouseUpEvent * @description Fired from inside DragDropMgr when the drag operation is finished. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4StartDragEvent * @description Fires before the startDragEvent, returning false will cancel the startDrag Event. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event startDragEvent * @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4EndDragEvent * @description Fires before the endDragEvent. Returning false will cancel. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event endDragEvent * @description Fires on the mouseup event after a drag has been initiated (startDrag fired). * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragEvent * @description Occurs every mousemove event while dragging. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragEvent * @description Fires before the dragEvent. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event invalidDropEvent * @description Fires when the dragged objects is dropped in a location that contains no drop targets. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragOutEvent * @description Fires before the dragOutEvent * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragOutEvent * @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragEnterEvent * @description Occurs when the dragged object first interacts with another targettable drag and drop object. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragOverEvent * @description Fires before the dragOverEvent. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragOverEvent * @description Fires every mousemove event while over a drag and drop object. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event b4DragDropEvent * @description Fires before the dragDropEvent * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ /** * @event dragDropEvent * @description Fires when the dragged objects is dropped on another. * @type YAHOO.util.CustomEvent See Element.addListener for more information on listening for this event. */ }); /** * A DragDrop implementation that does not move, but can be a drop * target. You would get the same result by simply omitting implementation * for the event callbacks, but this way we reduce the processing cost of the * event listener and the callbacks. * @class DDTarget * @extends YAHOO.util.DragDrop * @constructor * @param {String} id the id of the element that is a drop target * @param {String} sGroup the group of related DragDrop objects * @param {object} config an object containing configurable attributes * Valid properties for DDTarget in addition to those in * DragDrop: * none */ YAHOO.util.DDTarget = function(id, sGroup, config) { if (id) { this.initTarget(id, sGroup, config); } }; // YAHOO.util.DDTarget.prototype = new YAHOO.util.DragDrop(); YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, { toString: function() { return ("DDTarget " + this.id); } }); YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.5.1", build: "984"}); /* Copyright (c) 2008, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.5.1 */ (function() { var Y = YAHOO.util; /* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt */ /** * The animation module provides allows effects to be added to HTMLElements. * @module animation * @requires yahoo, event, dom */ /** * * Base animation class that provides the interface for building animated effects. *

    Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);

    * @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 | 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"). * 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 YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) */ var Anim = function(el, attributes, duration, method) { if (!el) { } this.init(el, attributes, duration, method); }; Anim.NAME = 'Anim'; Anim.prototype = { /** * Provides a readable name for the Anim instance. * @method toString * @return {String} */ toString: function() { var el = this.getEl() || {}; var id = el.id || el.tagName; return (this.constructor.NAME + ': ' + id); }, patterns: { // cached for performance noNegatives: /width|height|opacity|padding/i, // keep at zero or above offsetAttribute: /^((width|height)|(top|left))$/, // use offsetValue as default defaultUnit: /width|height|top$|bottom$|left$|right$/i, // use 'px' by default offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i // IE may return these, so convert these to offset }, /** * 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. * @return {Number} The Value to be applied to the attribute. */ doMethod: function(attr, start, end) { return this.method(this.currentFrame, start, end - start, this.totalFrames); }, /** * 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. */ setAttribute: function(attr, val, unit) { if ( this.patterns.noNegatives.test(attr) ) { val = (val > 0) ? val : 0; } Y.Dom.setStyle(this.getEl(), attr, val + unit); }, /** * 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. */ getAttribute: function(attr) { var el = this.getEl(); var val = Y.Dom.getStyle(el, attr); if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) { return parseFloat(val); } var a = this.patterns.offsetAttribute.exec(attr) || []; var pos = !!( a[3] ); // top or left var box = !!( a[2] ); // width or height // use offsets for width/height and abs pos top/left if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) { val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)]; } else { // default to zero for other 'auto' val = 0; } return val; }, /** * Returns the unit to use when none is supplied. * @method getDefaultUnit * @param {attr} attr The name of the attribute. * @return {String} The default unit to be used. */ getDefaultUnit: function(attr) { if ( this.patterns.defaultUnit.test(attr) ) { return 'px'; } return ''; }, /** * Sets the actual values to be used during the animation. Should only be needed for subclass use. * @method setRuntimeAttribute * @param {Object} attr The attribute object * @private */ setRuntimeAttribute: function(attr) { var start; var end; var attributes = this.attributes; this.runtimeAttributes[attr] = {}; var isset = function(prop) { return (typeof prop !== 'undefined'); }; if ( !isset(attributes[attr]['to']) && !isset(attributes[attr]['by']) ) { return false; // note return; nothing to animate to } start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr); // To beats by, per SMIL 2.1 spec if ( isset(attributes[attr]['to']) ) { end = attributes[attr]['to']; } else if ( isset(attributes[attr]['by']) ) { if (start.constructor == Array) { end = []; for (var i = 0, len = start.length; i < len; ++i) { end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by" } } else { end = start + attributes[attr]['by'] * 1; } } this.runtimeAttributes[attr].start = start; this.runtimeAttributes[attr].end = end; // set units if needed this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? attributes[attr]['unit'] : this.getDefaultUnit(attr); return true; }, /** * 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"). * 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 YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) */ init: function(el, attributes, duration, method) { /** * Whether or not the animation is running. * @property isAnimated * @private * @type Boolean */ var isAnimated = false; /** * A Date object that is created when the animation begins. * @property startTime * @private * @type Date */ var startTime = null; /** * The number of frames this animation was able to execute. * @property actualFrames * @private * @type Int */ var actualFrames = 0; /** * The element to be animated. * @property el * @private * @type HTMLElement */ el = Y.Dom.get(el); /** * The collection of attributes to be animated. * Each attribute must have at least a "to" or "by" defined in order to animate. * 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. * 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 = !YAHOO.lang.isUndefined(duration) ? duration : 1; /** * 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 || Y.Easing.easeNone; /** * Whether or not the duration should be treated as seconds. * Defaults to true. * @property useSeconds * @type Boolean */ this.useSeconds = true; // default to seconds /** * 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; /** * 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 = Y.AnimMgr.fps; /** * Changes the animated element * @method setEl */ this.setEl = function(element) { el = Y.Dom.get(element); }; /** * 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() { return isAnimated; }; /** * Returns the animation start time. * @method getStartTime * @return {Date} current value of startTime. */ this.getStartTime = function() { return startTime; }; this.runtimeAttributes = {}; /** * Starts the animation by registering it with the animation manager. * @method animate */ this.animate = function() { if ( this.isAnimated() ) { return false; } this.currentFrame = 0; this.totalFrames = ( this.useSeconds ) ? Math.ceil(Y.AnimMgr.fps * this.duration) : this.duration; if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration this.totalFrames = 1; } Y.AnimMgr.registerElement(this); return true; }; /** * 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(finish) { if (!this.isAnimated()) { // nothing to stop return false; } if (finish) { this.currentFrame = this.totalFrames; this._onTween.fire(); } Y.AnimMgr.stop(this); }; var onStart = function() { this.onStart.fire(); this.runtimeAttributes = {}; for (var attr in this.attributes) { this.setRuntimeAttribute(attr); } isAnimated = true; actualFrames = 0; startTime = new Date(); }; /** * Feeds the starting and ending values for each animated attribute to doMethod once per frame, then applies the resulting value to the attribute(s). * @private */ var onTween = function() { var data = { duration: new Date() - this.getStartTime(), currentFrame: this.currentFrame }; data.toString = function() { return ( 'duration: ' + data.duration + ', currentFrame: ' + data.currentFrame ); }; this.onTween.fire(data); var runtimeAttributes = this.runtimeAttributes; for (var attr in runtimeAttributes) { this.setAttribute(attr, this.doMethod(attr, runtimeAttributes[attr].start, runtimeAttributes[attr].end), runtimeAttributes[attr].unit); } actualFrames += 1; }; var onComplete = function() { var actual_duration = (new Date() - startTime) / 1000 ; var data = { duration: actual_duration, frames: actualFrames, fps: actualFrames / actual_duration }; data.toString = function() { return ( 'duration: ' + data.duration + ', frames: ' + data.frames + ', fps: ' + data.fps ); }; isAnimated = false; actualFrames = 0; this.onComplete.fire(data); }; /** * Custom event that fires after onStart, useful in subclassing * @private */ this._onStart = new Y.CustomEvent('_start', this, true); /** * Custom event that fires when animation begins * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction) * @event onStart */ this.onStart = new Y.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 Y.CustomEvent('tween', this); /** * Custom event that fires after onTween * @private */ this._onTween = new Y.CustomEvent('_tween', this, true); /** * Custom event that fires when animation ends * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction) * @event onComplete */ this.onComplete = new Y.CustomEvent('complete', this); /** * Custom event that fires after onComplete * @private */ this._onComplete = new Y.CustomEvent('_complete', this, true); this._onStart.subscribe(onStart); this._onTween.subscribe(onTween); this._onComplete.subscribe(onComplete); } }; Y.Anim = Anim; })(); /** * 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. * @property thread * @private * @type Int */ var thread = null; /** * The current queue of registered animation objects. * @property queue * @private * @type Array */ var queue = []; /** * The number of active animations. * @property tweenCount * @private * @type Int */ var tweenCount = 0; /** * Base frame rate (frames per second). * Arbitrarily high for better x-browser calibration (slower browsers drop more frames). * @property fps * @type Int * */ this.fps = 1000; /** * Interval delay in milliseconds, defaults to fastest possible. * @property delay * @type Int * */ this.delay = 1; /** * 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) { queue[queue.length] = tween; tweenCount += 1; tween._onStart.fire(); 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) { index = index || getIndex(tween); if (!tween.isAnimated() || index == -1) { return false; } tween._onComplete.fire(); queue.splice(index, 1); tweenCount -= 1; if (tweenCount <= 0) { this.stop(); } return true; }; /** * 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); } }; /** * 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. */ this.stop = function(tween) { if (!tween) { clearInterval(thread); for (var i = 0, len = queue.length; i < len; ++i) { this.unRegister(queue[0], 0); } queue = []; thread = null; tweenCount = 0; } else { this.unRegister(tween); } }; /** * Called per Interval to handle each animation frame. * @method run */ this.run = function() { for (var i = 0, len = queue.length; i < len; ++i) { var tween = queue[i]; if ( !tween || !tween.isAnimated() ) { continue; } if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null) { tween.currentFrame += 1; if (tween.useSeconds) { correctFrame(tween); } tween._onTween.fire(); } else { YAHOO.util.AnimMgr.stop(tween, i); } } }; var getIndex = function(anim) { for (var i = 0, len = queue.length; i < len; ++i) { if (queue[i] == anim) { return i; // note return; } } return -1; }; /** * On the fly frame correction to keep animation on time. * @method correctFrame * @private * @param {Object} tween The Anim instance being corrected. */ var correctFrame = function(tween) { var frames = tween.totalFrames; var frame = tween.currentFrame; var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames); var elapsed = (new Date() - tween.getStartTime()); var tweak = 0; if (elapsed < tween.duration * 1000) { // check if falling behind tweak = Math.round((elapsed / expected - 1) * tween.currentFrame); } else { // went over duration, so jump to end tweak = frames - (frame + 1); } if (tweak > 0 && isFinite(tweak)) { // adjust if needed if (tween.currentFrame + tweak >= frames) {// dont go past last frame tweak = frames - (frame + 1); } tween.currentFrame += tweak; } }; }; /** * Used to calculate Bezier splines for any number of control points. * @class Bezier * @namespace YAHOO.util * */ YAHOO.util.Bezier = new function() { /** * Get the current position of the animated element based on t. * Each point is an array of "x" and "y" values (0 = x, 1 = y) * 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 */ this.getPosition = function(points, t) { var n = points.length; var tmp = []; for (var i = 0; i < n; ++i){ tmp[i] = [points[i][0], points[i][1]]; // save input } for (var j = 1; j < n; ++j) { for (i = 0; i < n - j; ++i) { tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; } } return [ tmp[0][0], tmp[0][1] ]; }; }; (function() { /** * Anim subclass for color transitions. *

    Usage: var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut); Color values can be specified with either 112233, #112233, * [255,255,255], or rgb(255,255,255)

    * @class ColorAnim * @namespace YAHOO.util * @requires YAHOO.util.Anim * @requires YAHOO.util.AnimMgr * @requires YAHOO.util.Easing * @requires YAHOO.util.Bezier * @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 YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) */ var ColorAnim = function(el, attributes, duration, method) { ColorAnim.superclass.constructor.call(this, el, attributes, duration, method); }; ColorAnim.NAME = 'ColorAnim'; // shorthand var Y = YAHOO.util; YAHOO.extend(ColorAnim, Y.Anim); var superclass = ColorAnim.superclass; var proto = ColorAnim.prototype; 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. */ proto.parseColor = function(s) { if (s.length == 3) { return s; } var c = this.patterns.hex.exec(s); if (c && c.length == 4) { return [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ]; } c = this.patterns.rgb.exec(s); if (c && c.length == 4) { return [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ]; } c = this.patterns.hex3.exec(s); if (c && c.length == 4) { return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ]; } return null; }; proto.getAttribute = function(attr) { var el = this.getEl(); if ( this.patterns.color.test(attr) ) { var val = YAHOO.util.Dom.getStyle(el, attr); 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 && this.patterns.transparent.test(val)) { parent = parent.parentNode; val = Y.Dom.getStyle(parent, attr); if (parent.tagName.toUpperCase() == 'HTML') { val = '#fff'; } } } } else { val = superclass.getAttribute.call(this, attr); } return val; }; proto.doMethod = function(attr, start, end) { var val; if ( this.patterns.color.test(attr) ) { val = []; for (var i = 0, len = start.length; i < len; ++i) { val[i] = superclass.doMethod.call(this, attr, start[i], end[i]); } val = 'rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')'; } else { val = superclass.doMethod.call(this, attr, start, end); } return val; }; proto.setRuntimeAttribute = function(attr) { superclass.setRuntimeAttribute.call(this, attr); if ( this.patterns.color.test(attr) ) { var attributes = this.attributes; var start = this.parseColor(this.runtimeAttributes[attr].start); var end = this.parseColor(this.runtimeAttributes[attr].end); // fix colors if going "by" if ( typeof attributes[attr]['to'] === 'undefined' && typeof attributes[attr]['by'] !== 'undefined' ) { end = this.parseColor(attributes[attr].by); for (var i = 0, len = start.length; i < len; ++i) { end[i] = start[i] + end[i]; } } this.runtimeAttributes[attr].start = start; this.runtimeAttributes[attr].end = end; } }; Y.ColorAnim = ColorAnim; })(); /*! TERMS OF USE - EASING EQUATIONS Open source under the BSD License. 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: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * 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. * @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; }, /** * Begins slowly and accelerates towards end. (quadratic) * @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; }, /** * Begins quickly and decelerates towards end. (quadratic) * @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; }, /** * Begins slowly and decelerates towards end. (quadratic) * @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; } return -c/2 * ((--t)*(t-2) - 1) + b; }, /** * Begins slowly and accelerates towards end. (quartic) * @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; }, /** * Begins quickly and decelerates towards end. (quartic) * @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; }, /** * Begins slowly and decelerates towards end. (quartic) * @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; } return -c/2 * ((t-=2)*t*t*t - 2) + b; }, /** * 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} a Amplitude (optional) * @param {Number} p Period (optional) * @return {Number} The computed value for the current animation frame */ elasticIn: function (t, b, c, d, a, p) { if (t == 0) { return b; } if ( (t /= d) == 1 ) { return b+c; } if (!p) { p=d*.3; } if (!a || a < Math.abs(c)) { a = c; var s = p/4; } else { var s = p/(2*Math.PI) * Math.asin (c/a); } return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, /** * 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} a Amplitude (optional) * @param {Number} p Period (optional) * @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; } if (!a || a < Math.abs(c)) { a = c; var s = p / 4; } else { var s = p/(2*Math.PI) * Math.asin (c/a); } return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, /** * 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} a Amplitude (optional) * @param {Number} p Period (optional) * @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); } if ( !a || a < Math.abs(c) ) { a = c; var s = p/4; } else { var s = p/(2*Math.PI) * Math.asin (c/a); } if (t < 1) { return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; } return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, /** * 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; } return c*(t/=d)*t*((s+1)*t - s) + b; }, /** * 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; } return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, /** * 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; } if ((t /= d/2 ) < 1) { return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; } return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, /** * 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; }, /** * 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)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; }, /** * 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; } return YAHOO.util.Easing.bounceOut(t*2-d, 0, c, d) * .5 + c*.5 + b; } }; (function() { /** * Anim subclass for moving elements along a path defined by the "points" * member of "attributes". All "points" are arrays with x, y coordinates. *

    Usage: var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);

    * @class Motion * @namespace YAHOO.util * @requires YAHOO.util.Anim * @requires YAHOO.util.AnimMgr * @requires YAHOO.util.Easing * @requires YAHOO.util.Bezier * @requires YAHOO.util.Dom * @requires YAHOO.util.Event * @requires YAHOO.util.CustomEvent * @constructor * @extends YAHOO.util.ColorAnim * @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"). * 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 YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) */ var Motion = function(el, attributes, duration, method) { if (el) { // dont break existing subclasses not using YAHOO.extend Motion.superclass.constructor.call(this, el, attributes, duration, method); } }; Motion.NAME = 'Motion'; // shorthand var Y = YAHOO.util; YAHOO.extend(Motion, Y.ColorAnim); var superclass = Motion.superclass; var proto = Motion.prototype; proto.patterns.points = /^points$/i; proto.setAttribute = function(attr, val, unit) { if ( this.patterns.points.test(attr) ) { unit = unit || 'px'; superclass.setAttribute.call(this, 'left', val[0], unit); superclass.setAttribute.call(this, 'top', val[1], unit); } else { superclass.setAttribute.call(this, attr, val, unit); } }; proto.getAttribute = function(attr) { if ( this.patterns.points.test(attr) ) { var val = [ superclass.getAttribute.call(this, 'left'), superclass.getAttribute.call(this, 'top') ]; } else { val = superclass.getAttribute.call(this, attr); } return val; }; proto.doMethod = function(attr, start, end) { var val = null; if ( this.patterns.points.test(attr) ) { var t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100; val = Y.Bezier.getPosition(this.runtimeAttributes[attr], t); } else { val = superclass.doMethod.call(this, attr, start, end); } return val; }; proto.setRuntimeAttribute = function(attr) { if ( this.patterns.points.test(attr) ) { var el = this.getEl(); var attributes = this.attributes; var start; var control = attributes['points']['control'] || []; var end; var i, len; if (control.length > 0 && !(control[0] instanceof Array) ) { // could be single point or array of points control = [control]; } else { // break reference to attributes.points.control var tmp = []; for (i = 0, len = control.length; i< len; ++i) { tmp[i] = control[i]; } control = tmp; } if (Y.Dom.getStyle(el, 'position') == 'static') { // default to relative Y.Dom.setStyle(el, 'position', 'relative'); } if ( isset(attributes['points']['from']) ) { Y.Dom.setXY(el, attributes['points']['from']); // set position to from point } else { Y.Dom.setXY( el, Y.Dom.getXY(el) ); } // set it to current position start = this.getAttribute('points'); // get actual top & left // TO beats BY, per SMIL 2.1 spec if ( isset(attributes['points']['to']) ) { end = translateValues.call(this, attributes['points']['to'], start); var pageXY = Y.Dom.getXY(this.getEl()); for (i = 0, len = control.length; i < len; ++i) { control[i] = translateValues.call(this, control[i], start); } } else if ( isset(attributes['points']['by']) ) { end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ]; for (i = 0, len = control.length; i < len; ++i) { control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ]; } } this.runtimeAttributes[attr] = [start]; if (control.length > 0) { this.runtimeAttributes[attr] = this.runtimeAttributes[attr].concat(control); } this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end; } else { superclass.setRuntimeAttribute.call(this, attr); } }; var translateValues = function(val, start) { var pageXY = Y.Dom.getXY(this.getEl()); val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1] ]; return val; }; var isset = function(prop) { return (typeof prop !== 'undefined'); }; Y.Motion = Motion; })(); (function() { /** * 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. *

    Usage: var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);

    * @class Scroll * @namespace YAHOO.util * @requires YAHOO.util.Anim * @requires YAHOO.util.AnimMgr * @requires YAHOO.util.Easing * @requires YAHOO.util.Bezier * @requires YAHOO.util.Dom * @requires YAHOO.util.Event * @requires YAHOO.util.CustomEvent * @extends YAHOO.util.ColorAnim * @constructor * @param {String or 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"). * 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 YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) */ var Scroll = function(el, attributes, duration, method) { if (el) { // dont break existing subclasses not using YAHOO.extend Scroll.superclass.constructor.call(this, el, attributes, duration, method); } }; Scroll.NAME = 'Scroll'; // shorthand var Y = YAHOO.util; YAHOO.extend(Scroll, Y.ColorAnim); var superclass = Scroll.superclass; var proto = Scroll.prototype; proto.doMethod = function(attr, start, end) { var val = null; if (attr == 'scroll') { val = [ this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames), this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames) ]; } else { val = superclass.doMethod.call(this, attr, start, end); } return val; }; proto.getAttribute = function(attr) { var val = null; var el = this.getEl(); if (attr == 'scroll') { val = [ el.scrollLeft, el.scrollTop ]; } else { val = superclass.getAttribute.call(this, attr); } return val; }; proto.setAttribute = function(attr, val, unit) { var el = this.getEl(); if (attr == 'scroll') { el.scrollLeft = val[0]; el.scrollTop = val[1]; } else { superclass.setAttribute.call(this, attr, val, unit); } }; Y.Scroll = Scroll; })(); YAHOO.register("animation", YAHOO.util.Anim, {version: "2.5.1", build: "984"}); // http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/event_1.0.1.js yui=window.yui||{};yui.CustomEvent=function(_1,_2){this.type=_1;this.scope=_2||window;this.subscribers=[];if(yui["Event"]){yui.Event.regCE(this);}};yui.CustomEvent.prototype.subscribe=function(fn,_4){this.subscribers.push(new yui.Subscriber(fn,_4));};yui.CustomEvent.prototype.unsubscribe=function(fn,_5){for(var i=0;i=0){_28=this.listeners[_29];}if(!el||!_28){return false;}if(el.removeEventListener){el.removeEventListener(_27,_28[this.WFN],false);}else{if(el.detachEvent){el.detachEvent("on"+_27,_28[this.WFN]);}}delete this.listeners[_29][this.WFN];delete this.listeners[_29][this.FN];delete this.listeners[_29];return true;};this.getTarget=function(ev,_31){var t=ev.target||ev.srcElement;if(_31&&t&&"#text"==t.nodeName){return t.parentNode;}else{return t;}};this.getPageX=function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;};this.getPageY=function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;};this.getRelatedTarget=function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return t;};this.getTime=function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}return ev.time;};this.stopEvent=function(ev){this.stopPropagation(ev);this.preventDefault(ev);};this.stopPropagation=function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}};this.preventDefault=function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}};this.getEvent=function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;};this.getCharCode=function(ev){return ev.charCode||(ev.type=="keypress")?ev.keyCode:0;};this._getCacheIndex=function(el,_36,fn){for(var i=0;i0){for(i=0;i= 200 && httpStatus < 300 || httpStatus === 1223){ responseObject = this.createResponseObject(o, args); if(callback && callback.success){ if(!callback.scope){ callback.success(responseObject); } else{ // If a scope property is defined, the callback will be fired from // the context of the object. callback.success.apply(callback.scope, [responseObject]); } } // Fire global custom event -- successEvent this.successEvent.fire(responseObject); if(o.successEvent){ // Fire transaction custom event -- successEvent o.successEvent.fire(responseObject); } } else{ switch(httpStatus){ // The following cases are wininet.dll error codes that may be encountered. case 12002: // Server timeout case 12029: // 12029 to 12031 correspond to dropped connections. case 12030: case 12031: case 12152: // Connection closed by server. case 13030: // See above comments for variable status. responseObject = this.createExceptionObject(o.tId, args, (isAbort?isAbort:false)); if(callback && callback.failure){ if(!callback.scope){ callback.failure(responseObject); } else{ callback.failure.apply(callback.scope, [responseObject]); } } break; default: responseObject = this.createResponseObject(o, args); if(callback && callback.failure){ if(!callback.scope){ callback.failure(responseObject); } else{ callback.failure.apply(callback.scope, [responseObject]); } } } // Fire global custom event -- failureEvent this.failureEvent.fire(responseObject); if(o.failureEvent){ // Fire transaction custom event -- failureEvent o.failureEvent.fire(responseObject); } } this.releaseObject(o); responseObject = null; }, /** * @description This method evaluates the server response, creates and returns the results via * its properties. Success and failure cases will differ in the response * object's property values. * @method createResponseObject * @private * @static * @param {object} o The connection object * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback * @return {object} */ createResponseObject:function(o, callbackArg) { var obj = {}; var headerObj = {}; try { var headerStr = o.conn.getAllResponseHeaders(); var header = headerStr.split('\n'); for(var i=0; i'); // IE will throw a security exception in an SSL environment if the // iframe source is undefined. if(typeof secureUri == 'boolean'){ io.src = 'javascript:false'; } } else{ 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); }, /** * @description Parses the POST data and creates hidden form elements * for each key-value, and appends them to the HTML form object. * @method appendPostData * @private * @static * @param {string} postData The HTTP POST data * @return {array} formElements Collection of hidden fields. */ appendPostData:function(postData) { var formElements = []; var postMessage = postData.split('&'); for(var i=0; i < postMessage.length; i++){ var delimitPos = postMessage[i].indexOf('='); 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, inclusive of files/attachments, using the * iframe created in createFrame to facilitate the transaction. * @method uploadFile * @private * @static * @param {int} id The transaction id. * @param {object} callback User-defined callback object. * @param {string} uri Fully qualified path of resource. * @param {string} postData POST data to be submitted in addition to HTML form. * @return {void} */ uploadFile:function(o, callback, uri, postData){ // Each iframe has an id prefix of "yuiIO" followed // by the unique transaction id. var oConn = this; var frameId = 'yuiIO' + o.tId; var uploadEncoding = 'multipart/form-data'; var io = document.getElementById(frameId); var args = (callback && callback.argument)?callback.argument:null; // Track original HTML form attribute values. var rawFormAttributes = { action:this._formNode.getAttribute('action'), method:this._formNode.getAttribute('method'), target:this._formNode.getAttribute('target') }; // Initialize the HTML form properties in case they are // not defined in the HTML form. this._formNode.setAttribute('action', uri); this._formNode.setAttribute('method', 'POST'); this._formNode.setAttribute('target', frameId); if(this._formNode.encoding){ // IE does not respect property enctype for HTML forms. // Instead it uses the property - "encoding". this._formNode.setAttribute('encoding', uploadEncoding); } else{ this._formNode.setAttribute('enctype', uploadEncoding); } if(postData){ var oElements = this.appendPostData(postData); } // Start file upload. this._formNode.submit(); // Fire global custom event -- startEvent this.startEvent.fire(o, args); if(o.startEvent){ // Fire transaction custom event -- startEvent o.startEvent.fire(o, args); } // Start polling if a callback is present and the timeout // property has been defined. if(callback && callback.timeout){ this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout); } // Remove HTML elements created by appendPostData if(oElements && oElements.length > 0){ for(var i=0; i < oElements.length; i++){ this._formNode.removeChild(oElements[i]); } } // Restore HTML form attributes to their original // values prior to file upload. for(var prop in rawFormAttributes){ if(YAHOO.lang.hasOwnProperty(rawFormAttributes, prop)){ if(rawFormAttributes[prop]){ this._formNode.setAttribute(prop, rawFormAttributes[prop]); } else{ this._formNode.removeAttribute(prop); } } } // Reset HTML form state properties. this.resetFormState(); // Create the upload callback handler that fires when the iframe // receives the load event. Subsequently, the event handler is detached // and the iframe removed from the document. var uploadCallback = function() { if(callback && callback.timeout){ window.clearTimeout(oConn._timeOut[o.tId]); delete oConn._timeOut[o.tId]; } // Fire global custom event -- completeEvent oConn.completeEvent.fire(o, args); if(o.completeEvent){ // Fire transaction custom event -- completeEvent o.completeEvent.fire(o, args); } var obj = {}; obj.tId = o.tId; obj.argument = callback.argument; try { // responseText and responseXML will be populated with the same data from the iframe. // Since the HTTP headers cannot be read from the iframe obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent; obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document; } catch(e){} if(callback && callback.upload){ if(!callback.scope){ callback.upload(obj); } else{ callback.upload.apply(callback.scope, [obj]); } } // Fire global custom event -- uploadEvent oConn.uploadEvent.fire(obj); if(o.uploadEvent){ // Fire transaction custom event -- uploadEvent o.uploadEvent.fire(obj); } YAHOO.util.Event.removeListener(io, "load", uploadCallback); setTimeout( function(){ document.body.removeChild(io); oConn.releaseObject(o); }, 100); }; // Bind the onload handler to the iframe to detect the file upload response. YAHOO.util.Event.addListener(io, "load", uploadCallback); }, /** * @description Method to terminate a transaction, if it has not reached readyState 4. * @method abort * @public * @static * @param {object} o The connection object returned by asyncRequest. * @param {object} callback User-defined callback object. * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout. * @return {boolean} */ abort:function(o, callback, isTimeout) { var abortStatus; var args = (callback && callback.argument)?callback.argument:null; if(o && o.conn){ if(this.isCallInProgress(o)){ // Issue abort request o.conn.abort(); window.clearInterval(this._poll[o.tId]); delete this._poll[o.tId]; if(isTimeout){ window.clearTimeout(this._timeOut[o.tId]); delete this._timeOut[o.tId]; } abortStatus = true; } } else if(o && o.isUpload === true){ var frameId = 'yuiIO' + o.tId; var io = document.getElementById(frameId); if(io){ // Remove all listeners on the iframe prior to // its destruction. YAHOO.util.Event.removeListener(io, "load"); // Destroy the iframe facilitating the transaction. document.body.removeChild(io); if(isTimeout){ window.clearTimeout(this._timeOut[o.tId]); delete this._timeOut[o.tId]; } abortStatus = true; } } else{ abortStatus = false; } if(abortStatus === true){ // Fire global custom event -- abortEvent this.abortEvent.fire(o, args); if(o.abortEvent){ // Fire transaction custom event -- abortEvent o.abortEvent.fire(o, args); } this.handleTransactionResponse(o, callback, true); } return abortStatus; }, /** * @description Determines if the transaction is still being processed. * @method isCallInProgress * @public * @static * @param {object} o The connection object returned by asyncRequest * @return {boolean} */ isCallInProgress:function(o) { // if the XHR object assigned to the transaction has not been dereferenced, // then check its readyState status. Otherwise, return false. if(o && o.conn){ return o.conn.readyState !== 4 && o.conn.readyState !== 0; } else if(o && o.isUpload === true){ var frameId = 'yuiIO' + o.tId; return document.getElementById(frameId)?true:false; } else{ return false; } }, /** * @description Dereference the XHR instance and the connection object after the transaction is completed. * @method releaseObject * @private * @static * @param {object} o The connection object * @return {void} */ releaseObject:function(o) { if(o && o.conn){ //dereference the XHR instance. o.conn = null; //dereference the connection object. o = null; } } }; YAHOO.register("connection", YAHOO.util.Connect, {version: "2.5.1", build: "984"}); /* Copyright (c) 2008, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.5.1 */ /** * Provides a mechanism to fetch remote resources and * insert them into a document * @module get * @requires yahoo */ /** * Fetches and inserts one or more script or link nodes into the document * @namespace YAHOO.util * @class YAHOO.util.Get */ YAHOO.util.Get = function() { /** * hash of queues to manage multiple requests * @property queues * @private */ var queues={}, /** * queue index used to generate transaction ids * @property qidx * @type int * @private */ qidx=0, /** * node index used to generate unique node ids * @property nidx * @type int * @private */ nidx=0, // ridx=0, // sandboxFrame=null, /** * interal property used to prevent multiple simultaneous purge * processes * @property purging * @type boolean * @private */ purging=false, ua=YAHOO.env.ua, lang=YAHOO.lang; /** * Generates an HTML element, this is not appended to a document * @method _node * @param type {string} the type of element * @param attr {string} the attributes * @param win {Window} optional window to create the element in * @return {HTMLElement} the generated node * @private */ var _node = function(type, attr, win) { var w = win || window, d=w.document, n=d.createElement(type); for (var i in attr) { if (attr[i] && YAHOO.lang.hasOwnProperty(attr, i)) { n.setAttribute(i, attr[i]); } } return n; }; /** * Generates a link node * @method _linkNode * @param url {string} the url for the css file * @param win {Window} optional window to create the node in * @return {HTMLElement} the generated node * @private */ var _linkNode = function(url, win, charset) { var c = charset || "utf-8"; return _node("link", { "id": "yui__dyn_" + (nidx++), "type": "text/css", "charset": c, "rel": "stylesheet", "href": url }, win); }; /** * Generates a script node * @method _scriptNode * @param url {string} the url for the script file * @param win {Window} optional window to create the node in * @return {HTMLElement} the generated node * @private */ var _scriptNode = function(url, win, charset) { var c = charset || "utf-8"; return _node("script", { "id": "yui__dyn_" + (nidx++), "type": "text/javascript", "charset": c, "src": url }, win); }; /** * Returns the data payload for callback functions * @method _returnData * @private */ var _returnData = function(q, msg) { return { tId: q.tId, win: q.win, data: q.data, nodes: q.nodes, msg: msg, purge: function() { _purge(this.tId); } }; }; var _get = function(nId, tId) { var q = queues[tId], n = (lang.isString(nId)) ? q.win.document.getElementById(nId) : nId; if (!n) { _fail(tId, "target node not found: " + nId); } return n; }; /* * The request failed, execute fail handler with whatever * was accomplished. There isn't a failure case at the * moment unless you count aborted transactions * @method _fail * @param id {string} the id of the request * @private */ var _fail = function(id, msg) { var q = queues[id]; // execute failure callback if (q.onFailure) { var sc=q.scope || q.win; q.onFailure.call(sc, _returnData(q, msg)); } }; /** * The request is complete, so executing the requester's callback * @method _finish * @param id {string} the id of the request * @private */ var _finish = function(id) { var q = queues[id]; q.finished = true; if (q.aborted) { var msg = "transaction " + id + " was aborted"; _fail(id, msg); return; } // execute success callback if (q.onSuccess) { var sc=q.scope || q.win; q.onSuccess.call(sc, _returnData(q)); } }; /** * Loads the next item for a given request * @method _next * @param id {string} the id of the request * @param loaded {string} the url that was just loaded, if any * @private */ var _next = function(id, loaded) { var q = queues[id]; if (q.aborted) { var msg = "transaction " + id + " was aborted"; _fail(id, msg); return; } if (loaded) { q.url.shift(); if (q.varName) { q.varName.shift(); } } else { // This is the first pass: make sure the url is an array q.url = (lang.isString(q.url)) ? [q.url] : q.url; if (q.varName) { q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName; } } var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n; if (q.url.length === 0) { // Safari 2.x workaround - There is no way to know when // a script is ready in versions of Safari prior to 3.x. // Adding an extra node reduces the problem, but doesn't // eliminate it completely because the browser executes // them asynchronously. if (q.type === "script" && ua.webkit && ua.webkit < 420 && !q.finalpass && !q.varName) { // Add another script node. This does not guarantee that the // scripts will execute in order, but it does appear to fix the // problem on fast connections more effectively than using an // arbitrary timeout. It is possible that the browser does // block subsequent script execution in this case for a limited // time. var extra = _scriptNode(null, q.win, q.charset); extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");'; q.nodes.push(extra); h.appendChild(extra); } else { _finish(id); } return; } var url = q.url[0]; if (q.type === "script") { n = _scriptNode(url, w, q.charset); } else { n = _linkNode(url, w, q.charset); } // track this node's load progress _track(q.type, n, id, url, w, q.url.length); // add the node to the queue so we can return it to the user supplied callback q.nodes.push(n); // add it to the head or insert it before 'insertBefore' if (q.insertBefore) { var s = _get(q.insertBefore, id); if (s) { s.parentNode.insertBefore(n, s); } } else { h.appendChild(n); } // FireFox does not support the onload event for link nodes, so there is // no way to make the css requests synchronous. This means that the css // rules in multiple files could be applied out of order in this browser // if a later request returns before an earlier one. Safari too. if ((ua.webkit || ua.gecko) && q.type === "css") { _next(id, url); } }; /** * Removes processed queues and corresponding nodes * @method _autoPurge * @private */ var _autoPurge = function() { if (purging) { return; } purging = true; for (var i in queues) { var q = queues[i]; if (q.autopurge && q.finished) { _purge(q.tId); delete queues[i]; } } purging = false; }; /** * Removes the nodes for the specified queue * @method _purge * @private */ var _purge = function(tId) { var q=queues[tId]; if (q) { var n=q.nodes, l=n.length, d=q.win.document, h=d.getElementsByTagName("head")[0]; if (q.insertBefore) { var s = _get(q.insertBefore, tId); if (s) { h = s.parentNode; } } for (var i=0; i= 420) { n.addEventListener("load", function() { f(id, url); }); // Nothing can be done with Safari < 3.x except to pause and hope // for the best, particularly after last script is inserted. The // scripts will always execute in the order they arrive, not // necessarily the order in which they were inserted. To support // script nodes with complete reliability in these browsers, script // nodes either need to invoke a function in the window once they // are loaded or the implementer needs to provide a well-known // property that the utility can poll for. } else { // Poll for the existence of the named variable, if it // was supplied. var q = queues[id]; if (q.varName) { var freq=YAHOO.util.Get.POLL_FREQ; q.maxattempts = YAHOO.util.Get.TIMEOUT/freq; q.attempts = 0; q._cache = q.varName[0].split("."); q.timer = lang.later(freq, q, function(o) { var a=this._cache, l=a.length, w=this.win, i; for (i=0; i this.maxattempts) { var msg = "Over retry limit, giving up"; q.timer.cancel(); _fail(id, msg); } else { } return; } } q.timer.cancel(); f(id, url); }, null, true); } else { lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]); } } } // FireFox and Opera support onload (but not DOM2 in FF) handlers for // script nodes. Opera, but not FF, supports the onload event for link // nodes. } else { n.onload = function() { f(id, url); }; } }; return { /** * The default poll freqency in ms, when needed * @property POLL_FREQ * @static * @type int * @default 10 */ POLL_FREQ: 10, /** * The number of request required before an automatic purge. * property PURGE_THRESH * @static * @type int * @default 20 */ PURGE_THRESH: 20, /** * The length time to poll for varName when loading a script in * Safari 2.x before the transaction fails. * property TIMEOUT * @static * @type int * @default 2000 */ TIMEOUT: 2000, /** * Called by the the helper for detecting script load in Safari * @method _finalize * @param id {string} the transaction id * @private */ _finalize: function(id) { lang.later(0, null, _finish, id); }, /** * Abort a transaction * @method abort * @param {string|object} either the tId or the object returned from * script() or css() */ abort: function(o) { var id = (lang.isString(o)) ? o : o.tId; var q = queues[id]; if (q) { q.aborted = true; } }, /** * Fetches and inserts one or more script nodes into the head * of the current document or the document in a specified window. * * @method script * @static * @param url {string|string[]} the url or urls to the script(s) * @param opts {object} Options: *
    *
    onSuccess
    *
    * callback to execute when the script(s) are finished loading * The callback receives an object back with the following * data: *
    *
    win
    *
    the window the script(s) were inserted into
    *
    data
    *
    the data object passed in when the request was made
    *
    nodes
    *
    An array containing references to the nodes that were * inserted
    *
    purge
    *
    A function that, when executed, will remove the nodes * that were inserted
    *
    *
    *
    *
    onFailure
    *
    * callback to execute when the script load operation fails * The callback receives an object back with the following * data: *
    *
    win
    *
    the window the script(s) were inserted into
    *
    data
    *
    the data object passed in when the request was made
    *
    nodes
    *
    An array containing references to the nodes that were * inserted successfully
    *
    purge
    *
    A function that, when executed, will remove any nodes * that were inserted
    *
    *
    *
    *
    scope
    *
    the execution context for the callbacks
    *
    win
    *
    a window other than the one the utility occupies
    *
    autopurge
    *
    * setting to true will let the utilities cleanup routine purge * the script once loaded *
    *
    data
    *
    * data that is supplied to the callback when the script(s) are * loaded. *
    *
    varName
    *
    * variable that should be available when a script is finished * loading. Used to help Safari 2.x and below with script load * detection. The type of this property should match what was * passed into the url parameter: if loading a single url, a * string can be supplied. If loading multiple scripts, you * must supply an array that contains the variable name for * each script. *
    *
    insertBefore
    *
    node or node id that will become the new node's nextSibling
    *
    *
    charset
    *
    Node charset, default utf-8
    *
             * // assumes yahoo, dom, and event are already on the page
             *   YAHOO.util.Get.script(
             *   ["http://yui.yahooapis.com/2.3.1/build/dragdrop/dragdrop-min.js",
             *    "http://yui.yahooapis.com/2.3.1/build/animation/animation-min.js"], {
             *     onSuccess: function(o) {
             *       new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
             *       this.log("won't cause error because YAHOO is the scope");
             *       this.log(o.nodes.length === 2) // true
             *       // o.purge(); // optionally remove the script nodes immediately
             *     },
             *     onFailure: function(o) {
             *     },
             *     data: "foo",
             *     scope: YAHOO,
             *     // win: otherframe // target another window/frame
             *     autopurge: true // allow the utility to choose when to remove the nodes
             *   });
             * 
    * @return {tId: string} an object containing info about the transaction */ script: function(url, opts) { return _queue("script", url, opts); }, /** * Fetches and inserts one or more css link nodes into the * head of the current document or the document in a specified * window. * @method css * @static * @param url {string} the url or urls to the css file(s) * @param opts Options: *
    *
    onSuccess
    *
    * callback to execute when the css file(s) are finished loading * The callback receives an object back with the following * data: *
    win
    *
    the window the link nodes(s) were inserted into
    *
    data
    *
    the data object passed in when the request was made
    *
    nodes
    *
    An array containing references to the nodes that were * inserted
    *
    purge
    *
    A function that, when executed, will remove the nodes * that were inserted
    *
    *
    * *
    scope
    *
    the execution context for the callbacks
    *
    win
    *
    a window other than the one the utility occupies
    *
    data
    *
    * data that is supplied to the callbacks when the nodes(s) are * loaded. *
    *
    insertBefore
    *
    node or node id that will become the new node's nextSibling
    *
    charset
    *
    Node charset, default utf-8
    * *
             *      YAHOO.util.Get.css("http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css");
             * 
    *
             *      YAHOO.util.Get.css(["http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css",
             * 
    * @return {tId: string} an object containing info about the transaction */ css: function(url, opts) { return _queue("css", url, opts); } }; }(); YAHOO.register("get", YAHOO.util.Get, {version: "2.5.1", build: "984"}); var Y=YAHOO;Y.U=Y.util,Y.D=Y.util.Dom,Y.E=Y.util.Event;var snag=1;function woe_location_obj(ID,title,sub_title,relevance,bbox,precision,lat,lon,place_url,place_disambiguate){this.id=ID,this.title=title,this.sub_title=sub_title,this.relevance=relevance,this.bbox=bbox,this.precision=precision,this.lat=lat,this.lon=lon,this.place_url=place_url,this.place_disambiguate=place_disambiguate}function Currency(){var self=this;this.currencies={ARS:"AR $%.2f",AUD:"AU $%.2f",BRL:"BR R$%.2f",CAD:"CAD $%.2f",CHF:"SFr. %.2f",CLP:"CL $%d",CNY:"%.2f元",COP:"CO $%.2f",DKK:"kr %.2f",EUR:"€ %.2f","EUR-at":"%.2f €","EUR-be":"%.2f €","EUR-de":"%.2f €","EUR-fr":"%.2f €","EUR-pt":"%.2f €","EUR-es":"%.2f €",GBP:"UK £%.2f",HKD:"HK $%.2f",INR:"Rs. %.2f",JPY:"%d 円",KRW:"₩ %d",MXN:"Mex $%.2f",MYR:"RM %.2f",NOK:"kr %.2f",NZD:"NZ $%.2f",PEN:"S/ %.2f",PHP:"P %.2f",SEK:"%.2f kr",SGD:"SGD $%.2f",USD:"US $%.2f",VEF:"BsF %.2f"},this.currencies_sans_prefix={ARS:"$%.2f",AUD:"$%.2f",BRL:"$%.2f",CAD:"$%.2f",CHF:"SFr. %.2f",CLP:"$%d",CNY:"%.2f元",COP:"$%.2f",DKK:"kr %.2f",EUR:"€ %.2f","EUR-at":"%.2f €","EUR-be":"%.2f €","EUR-de":"%.2f €","EUR-fr":"%.2f €","EUR-pt":"%.2f €","EUR-es":"%.2f €",GBP:"£ %.2f",HKD:"$%.2f",INR:"Rs. %.2f",JPY:"%d 円",KRW:"₩ %d",MXN:"$%.2f",MYR:"RM %.2f",NOK:"kr %.2f",NZD:"$%.2f",PEN:"S/ %.2f",PHP:"P %.2f",SEK:"%.2f kr",SGD:"$%.2f",USD:"$%.2f",VEF:"BsF %.2f"},this.default_currency_type="USD",this.default_show_currency_prefix=!0,this.decimal_replacements={FRA:",",DKK:",",NOK:",",SEK:",","EUR-at":",","EUR-be":",","EUR-de":",","EUR-es":",","EUR-fr":",","EUR-it":",","EUR-nl":",","EUR-pt":","},this.format_decimal=function(n_amount,s_currency,currency_subtype){currency_subtype=s_currency+(currency_subtype?"-"+currency_subtype:"");return self.decimal_replacements[s_currency]||self.decimal_replacements[currency_subtype]?n_amount.replace_global(".",self.decimal_replacements[currency_subtype]||self.decimal_replacements[s_currency]):n_amount},this.format_currency=function(n_amount_in_dollars,o_options){var currency_type=self.default_currency_type,currency_country=null,currency_map=self.currencies;if(o_options&&(currency_type=o_options.currency_type||self.default_currency_type,o_options.country&&(currency_country=currency_type+"-"+o_options.country),currency_map=void 0===o_options.show_prefix||o_options.show_prefix?self.currencies:self.currencies_sans_prefix),currency_string=currency_country&¤cy_map[currency_country]||currency_map[currency_type],currency_string){var c=F.output.sprintf(currency_string,n_amount_in_dollars);return self.format_decimal(c,currency_type,o_options.country)}writeDebug("Warn: No matching currency type");c=F.output.sprintf(currency_map[self.default_currency_type],n_amount_in_dollars);return self.format_decimal(c,self.default_currency_type)}}F._eb={eb_go_go_go:function(){this._eb_listeners=[],F._ebA.push(this)},eb_broadcast:function(){for(var new_args=[],i=0;i< Prev......";this.innerHTML=html,this.paginator_get_going()},paginator_place:function(){},paginator_get_going:function(first_page,ps){if(null!=first_page&&null!=ps)if(ps<2)this.paginator_hide();else{this.pages=ps,this.page=first_page,writeDebug("paginator_get_going pages:"+this.pages+" page:"+this.page),this.pagesA=[];var first_page=(this.total_slots-1)/2,first_page=this.page-first_page,last_page=(first_page=Math.max(1,first_page))+this.total_slots-1;last_page>this.pages&&(first_page-=last_page-this.pages),last_page=Math.min(this.pages,last_page),writeDebug("first_page:"+first_page+" page:"+this.page+" last_page:"+last_page);for(var i=first_page;i<=last_page;i++)this.pagesA.push(i);for(i=1;i<=this.side_slots;i++)0p+1&&this.paginator_show_break(1),k==this.total_slots-2&&this.pagesA[i+1]&&this.pagesA[i+1]>p+1&&this.paginator_show_break(2))}1==this.page?_ge("paginator_link_prev").className="AtStart":_ge("paginator_link_prev").className="Prev",this.page==this.pages?_ge("paginator_link_next").className="AtEnd":_ge("paginator_link_next").className="Next",this.paginator_show()},paginator_go_prev:function(){var p=this.page-1;this.paginator_go_page(p)},paginator_go_next:function(){var p=this.page+1;this.paginator_go_page(p)},paginator_go_page:function(p){(p=Math.min(this.pages,Math.max(1,p)))!=this.page&&(this.page=p,this.paginator_draw(),this.eb_broadcast("on_paginator_go_page",this.page))},paginator_hide:function(){this.style.display="none"},paginator_show:function(){"block"!=this.style.display&&(this.style.visibility="hidden"),this.style.display="block",this.paginator_place(),this.style.visibility="visible"},paginator_hide_link:function(l){_ge("paginator_link_"+l).style.display="none"},paginator_show_link:function(link,p){link=_ge("paginator_link_"+link);null!=p&&(link.page=p),link.innerHTML=link.page,link.className=link.page==this.page?"this-page":"",link.style.display="inline"},paginator_hide_break:function(b){_ge("paginator_break_"+b).style.display="none"},paginator_show_break:function(b){_ge("paginator_break_"+b).style.display="inline"}},F._carrot=new Object,F._carrot.carrot_go_go_go=function(direction,is_open,open_text,closed_text){var root_file_name=(this.childNodes&&this.childNodes[0]?this.childNodes[0]:this).src.split("/"),root_file_name=(root_file_name=root_file_name[root_file_name.length-1].split("."))[0].substr().replace_global("_closed","").replace_global("_open_down","").replace_global("_open_up","");this.carrot_open_img={},this.carrot_open_img.src="up"==direction?_images_root+"/"+root_file_name+"_open_up.gif":_images_root+"/"+root_file_name+"_open_down.gif",this.carrot_closed_img={},this.carrot_closed_img.src=_images_root+"/"+root_file_name+"_closed.gif",F.preload_images(this.carrot_open_img.src,this.carrot_closed_img.src),this.carrot_is_open=is_open?1:0,this.childNodes&&this.childNodes[1]&&(this.carrot_is_open?(this.carrot_open_text=open_text||this.childNodes[1].innerHTML,this.carrot_closed_text=closed_text||this.carrot_open_text):(this.carrot_closed_text=closed_text||this.childNodes[1].innerHTML,this.carrot_open_text=open_text||this.carrot_closed_text)),this.style.cursor=F.is_ie?"hand":"pointer",this.onclick_default=this.onclick||function(){},this.onclick=this.carrot_onclick,this.carrot_is_open?this.childNodes&&this.childNodes[0]?(this.childNodes[0].src=this.carrot_open_img.src,this.childNodes[1]&&(this.childNodes[1].innerHTML=this.carrot_open_text)):this.src=this.carrot_open_img.src:this.childNodes&&this.childNodes[0]?(this.childNodes[0].src=this.carrot_closed_img.src,this.childNodes[1]&&(this.childNodes[1].innerHTML=this.carrot_closed_text)):this.src=this.carrot_closed_img.src},F._carrot.carrot_onclick=function(e){this.carrot_is_open?this.carrot_close():this.carrot_open()},F._carrot.carrot_open=function(){this.onclick_default(),this.carrot_is_open=1,this.childNodes&&this.childNodes[0]?(this.childNodes[0].src=this.carrot_open_img.src,this.childNodes[1]&&(this.childNodes[1].innerHTML=this.carrot_open_text)):this.src=this.carrot_open_img.src},F._carrot.carrot_close=function(){this.onclick_default(),this.carrot_is_open=0,this.childNodes&&this.childNodes[0]?(this.childNodes[0].src=this.carrot_closed_img.src,this.childNodes[1]&&(this.childNodes[1].innerHTML=this.carrot_closed_text)):this.src=this.carrot_closed_img.src},F._shadow=new Object,F._shadow.shadow_go_go_go=function(for_id,html,parent){this.shadow_use_local_coords=parent!=document.body,this.shadow_for_id=for_id,this.style.zIndex=html,this.style.display="none",this.style.position="absolute",this.shadow_height_plus=-14,this.shadow_width_plus=-14,this.shadow_x_plus=-0,this.shadow_y_plus=-0,html=navigator.userAgent.match(/msie 5/i)||navigator.userAgent.match(/msie 6/i)?'
    ':'
    ',this.innerHTML=html},F._shadow.shadow_size_and_place=function(){var x,w,h=_ge(this.shadow_for_id);w=this.shadow_use_local_coords?(x=F.get_local_X(h),F.get_local_Y(h)):(x=Y.U.Dom.getX(h),Y.U.Dom.getY(h)),null!=x&&(x+=this.shadow_x_plus,w+=this.shadow_y_plus,this.style.left=x+"px",this.style.top=w+"px",(w=h.offsetWidth+this.shadow_width_plus)<0&&(w=0),(h=h.offsetHeight+this.shadow_height_plus)<0&&(h=0),_ge(this.id+"_width_controller").style.width=w+"px",_ge(this.id+"_height_controller").style.height=h+"px")},F._shadow.shadow_show=function(){this.style.display="block"},F._shadow.shadow_hide=function(){this.style.display="none"},F.eb_add({window_onload_dom:function(){var one=_ge("e_4563"),two=_ge("e_4564"),tre=_ge("e_4565"),f0r=_ge("e_4566"),fi5e=_ge("e_4567");(one||two||tre||f0r||fi5e)&&F.API.callMethod("flickr.people.getMagicEmail",{user_id:global_nsid},{flickr_people_getMagicEmail_onLoad:function(success,thing){success&&(thing=thing.documentElement.getElementsByTagName("user")[0].getAttribute("magic_email"),one&&(one.href="mailto:"+thing+"@photos.flickr.com",one.innerHTML=thing+"@photos.flickr.com"),two&&(two.href="mailto:"+thing+"2blog@photos.flickr.com",two.innerHTML=thing+"2blog@photos.flickr.com"),tre&&(tre.href="mailto:"+thing+"@photos.flickr.com",tre.innerHTML=thing+"@photos.flickr.com"),f0r&&(f0r.href="mailto:"+thing+"2blog@photos.flickr.com",f0r.innerHTML=thing+"2blog@photos.flickr.com"),fi5e&&(fi5e.href="mailto:"+thing+"2twitter@photos.flickr.com",fi5e.innerHTML=thing+"2twitter@photos.flickr.com"))}})}}),F.set_png_bg=function(oEl,sProp,sPropValue,sizingMethod){if(navigator.userAgent.match(/msie 6/i)){var sBGURL=null,sizingMethod=void 0===sizingMethod?"scale":sizingMethod,sBGURL=-1!=sPropValue.indexOf("url(")?(sBGURL=sPropValue.substr(sPropValue.indexOf("(")+1)).substr(0,sBGURL.lastIndexOf(")")):sPropValue;if(void 0!==oEl.setStyle)oEl.setStyle("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+sBGURL+"',sizingMethod='"+sizingMethod+"')");else try{oEl.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+sBGURL+"',sizingMethod='"+sizingMethod+"')"}catch(e){return YAHOO.util.Dom.setStyle(oEl,sProp,sPropValue),!1}}else void 0!==oEl.setStyle?oEl.setStyle(sProp,sPropValue):YAHOO.util.Dom.setStyle(oEl,sProp,sPropValue)},F.find_parent_node=function(oEl){if(!oEl||!oEl.parentNode)return!1;for(oEl=oEl.parentNode;oEl.parentNode&&1!=oEl.parentNode.nodeType;)oEl=oEl.parentNode;return 1==oEl.nodeType?oEl:null},F.find_parent_node_by_name=function(o,oParentNodeName){if(!o||!o.parentNode||!oParentNodeName)return!1;for(oParentNodeName=oParentNodeName.toLowerCase(),o=o.parentNode;o.nodeName.toLowerCase()!=oParentNodeName&&o.parentNode;)o=o.parentNode;return o.nodeName.toLowerCase()==oParentNodeName?o:null},F.find_parent_node_by_class_name=function(o,oParentClassName){if(!o||!o.parentNode||!oParentClassName)return!1;for(o=o.parentNode;!Y.D.hasClass(o,oParentClassName)&&o.parentNode;)o=o.parentNode;return Y.D.hasClass(o,oParentClassName)?o:null},F.is_child_of=function(oChild,oParent){if(!oChild||!oParent)return!1;for(;oChild.parentNode&&oChild!=oParent;)oChild=oChild.parentNode;return oChild==oParent},F.do_explore_location_search=function(){var div;_ge("explore_loc_search_div")||((div=document.createElement("div")).id="explore_loc_search_div",document.body.appendChild(div),F.decorate(div,F._loc_search_div).div_go_go_go("explore"));try{_ge("explore_loc_search_div").div_do_loc_search()}catch(err){writeDebug(err)}return!1},F.do_places_world_location_search=function(){var oSearch=_ge("txt_search_for"),oTaken=_ge("txt_taken_in"),div=!1;if(""==oSearch.value&&(div=!0,oSearch.focus(),oSearch.value=places.defaults.search_for,oSearch.select()),""!=oTaken.value&&oTaken.value!=places.defaults.taken_in||(div=!0,oTaken.focus(),oTaken.value=places.defaults.taken_in,oTaken.select()),div)return!1;_ge("explore_loc_search_div")||((div=document.createElement("div")).id="explore_loc_search_div",document.body.appendChild(div),F.decorate(div,F._loc_search_div).div_go_go_go("places_world"));try{_ge("explore_loc_search_div").div_do_loc_search()}catch(err){writeDebug(err)}return!1},F._loc_search_div={provider_name:_qs_args.provider_name||"woe"},F._loc_search_div.div_go_go_go=function(img){this.page_type=img,this.input_id="org"==this.page_type?"loc_search_input":"explore"==this.page_type?"exploreMapSearch":"places_world"==this.page_type?"txt_taken_in":"places_home"==this.page_type?"location-search-field":"header_search_q",this.logged_last=0,this.last_source_id=null,this.last_search_term=null,this.setLocation_geo_point=null,this.setLocation_source_id=null,this.setLocation_search_term=null;_ge(this.input_id);this.style.display="none",F.eb_add(this),this.locations=[],this.div_show_all=0,this.current_location_index=-1;var inner_div=document.createElement("div");inner_div.id="loc_search_inner_div",inner_div.style.width="300px",inner_div.style.border="0px solid black",this.appendChild(inner_div);img=document.createElement("div");img.id="loc_search_header_div",img.className="Pulser",img.style.position="absolute",img.style.top="10px",img.style.left="10px",img.style.height="20px",img.style.width="30px",inner_div.appendChild(img),(img=document.createElement("div")).id="loc_search_header_msg_div",img.style.margin="12px 15px 10px 38px",img.style.fontWeight="normal",img.style.fontFamily="arial",img.style.fontSize="12px",img.style.color="#434343",inner_div.appendChild(img),(img=document.createElement("div")).id="loc_search_results_div",img.style.margin="0 0 15px 38px",inner_div.appendChild(img),(img=document.createElement("div")).id="loc_search_msg_div",img.style.margin="0px 0 10px 30px",img.style.display="none",inner_div.appendChild(img);img=document.createElement("img");img.id="loc_search_close",img.style.border="0px",img.style.position="absolute",img.style.left="281px",img.style.top="4px",img.src=_images_root+"/simple_close_default.gif",img.width=img.height="15";var id=this.id;img.onclick=function(){_ge(id).div_fade()},this.appendChild(img),F.decorate(_ge("loc_search_close"),F._simple_button).button_go_go_go()},F._loc_search_div.window_onresize=function(){"none"!=this.style.display&&this.div_show()},F._loc_search_div.div_show=function(){"none"==this.style.display&&(this.style.visibility="hidden"),this.style.display="block";var oMain,x,offset,results_div=_ge("loc_search_results_div"),y=Y.U.Dom.getY(_ge(this.input_id));"org"==this.page_type?(x=_find_screen_width()-this.offsetWidth-3,y+=25):"else"==this.page_type||"world_map"==this.page_type?((x=_find_screen_width()-this.offsetWidth-60)>Y.U.Dom.getX(_ge(this.input_id))&&(x=Y.U.Dom.getX(_ge(this.input_id))),y+=23):"explore"==this.page_type?(x=Y.U.Dom.getX(_ge(this.input_id)),y+=23):"places_world"==this.page_type?(x=Y.U.Dom.getX(_ge(this.input_id)),y+=31):(x=(oMain=_ge("Main"))?Y.U.Dom.getX(oMain)+oMain.offsetWidth-this.offsetWidth:Y.U.Dom.getX(_ge("header_search_q"))-56,y+=24),results_div.style.height="",results_div.style.overflow="",this.div_show_all&&("explore"==this.page_type?this.offsetHeight+(offset=88)>_find_screen_height()&&(results_div.style.height=_find_screen_height()-offset+"px",results_div.style.overflow="auto"):(offset=58,this.offsetHeight+y>_find_screen_height()+document.body.scrollTop&&(results_div.style.height=_find_screen_height()-y-offset+document.body.scrollTop+"px",results_div.style.overflow="auto")),this.reset_scrollTop&&(this.reset_scrollTop=0,results_div.scrollTop=0));this.style.opacity=1,this.style.filter="alpha(opacity=100)",this.style.left=x+"px",this.style.top=y+"px",this.style.visibility="visible","explore"==this.page_type&&F.scroll_this_el_into_view(this.id),_ge("geo_bookmarks_div")&&(_ge("geo_bookmarks_div").hide,1)&&_ge("geo_bookmarks_div").hide()},F._loc_search_div.div_hide=function(){this.style.display="none"},F._loc_search_div.div_loading=function(){_ge("loc_search_results_div").style.display="none",_ge("loc_search_close").style.display="none",_ge("loc_search_header_div").className="Pulser_gray",_ge("loc_search_header_msg_div").innerHTML="   "+F.output.get("searching"),this.reset_scrollTop=1,this.div_show_all=0,this.div_show()},F._loc_search_div.div_fade_if_open=function(){"block"==this.style.display&&this.div_fade(),this.div_log(0)},F._loc_search_div.div_fade=function(){var div=this;anim_do_opacity_to(div,7,35,0,"easeInQuad",function(){div.div_hide()})},F._loc_search_div.div_update_results=function(msg){_ge("f_div_photo_ribbon_holder")&&(this.page_type="world_map"),msg&&(this.div_show_all=1);msg=this.locations.length;if(_ge("loc_search_close").style.display="block",0==this.locations.length)_ge("loc_search_header_div").className="Problem_small",_ge("loc_search_header_msg_div").innerHTML=F.output.get("loc_results_no_matches"),_ge("loc_search_results_div").style.display="none";else{1==this.locations.length&&("site"!=this.page_type&&"explore"!=this.page_type&&"places_home"!=this.page_type||_ge("div_force_header_location_search"))&&("places_world"==this.page_type||setTimeout("_ge('"+this.id+"').div_fade()",2e3)),_ge("loc_search_header_div").className="Confirm_small",msg=1==msg?F.output.get("loc_results_one_match"):F.output.get("loc_results_matches",msg,this.last_search_term.escape_for_display()),_ge("loc_search_header_msg_div").innerHTML=msg,_ge("loc_search_results_div").style.display="block";var htmlA=[];max_abs=20,max_to_show=8,max_to_show_if_more_than_that=5;var show_num=!(this.current_location_index>max_to_show_if_more_than_that||this.div_show_all)&&this.locations.length>max_to_show?max_to_show_if_more_than_that:this.locations.length;for(i=0;i',this.locations[i].title&&(html+=''+this.locations[i].title+", ")):(this.locations[i].title&&(html+=''+this.locations[i].title+", "),html+=''),html+=" "+this.locations[i].sub_title+"",""!=this.locations[i].place_disambiguate&&(html+=" ("+this.locations[i].place_disambiguate+")"),html+="",htmlA.push(html)}this.locations.length>show_num&&htmlA.push('
    "+F.output.get("loc_results_more")+""),_ge("loc_search_results_div").innerHTML=htmlA.join("")}this.div_show()},F._loc_search_div.div_go_to_map=function(i,msg){var url;msg=!msg||msg<1?(url=this.locations[i].id,url="GeocodedBuilding"==this.locations[i].precision||"POI"==this.locations[i].precision?"/map?fLat="+this.locations[i].lat+"&fLon="+this.locations[i].lon+"&zl=2&place_id="+url+"&woe_sub_title="+escape(this.locations[i].sub_title):"/map?place_id="+url,document.location=url,F.output.get("loc_results_take_you_there")):(setTimeout("_ge('"+this.id+"').div_go_to_map("+i+", "+(msg-1e3)+")",msg),0==msg?F.output.get("loc_results_zero_second"):1==_pi(msg/1e3)?F.output.get("loc_results_one_second"):F.output.get("loc_results_x_second",_pi(msg/1e3))),writeDebug(msg),_ge("loc_search_msg_div")&&(_ge("loc_search_msg_div").style.display="block",_ge("loc_search_msg_div").innerHTML=msg)},F._loc_search_div.div_go_to_place=function(i,msg){var url;msg=!msg||msg<1?(url=this.locations[i].id,url=_ge("world_map")?_ge("user_places_is_go")?"/photos/"+_ge("user_places_is_go").innerHTML+"/places"+this.locations[i].place_url:"/places"+this.locations[i].place_url:"GeocodedBuilding"==this.locations[i].precision||"POI"==this.locations[i].precision?"/map?fLat="+this.locations[i].lat+"&fLon="+this.locations[i].lon+"&zl=2&place_id="+url+"&woe_sub_title="+escape(this.locations[i].sub_title):"/map?place_id="+url,document.location=url,F.output.get("loc_results_take_you_there")):(setTimeout("_ge('"+this.id+"').div_go_to_place("+i+", "+(msg-1e3)+")",msg),0==msg?F.output.get("loc_results_zero_second"):1==_pi(msg/1e3)?F.output.get("loc_results_one_second"):F.output.get("loc_results_x_second",_pi(msg/1e3))),writeDebug(msg),_ge("loc_search_msg_div")&&(_ge("loc_search_msg_div").style.display="block",_ge("loc_search_msg_div").innerHTML=msg)},F._loc_search_div.div_on_result_click=function(i){("site"!=this.page_type&&"explore"!=this.page_type&&"places_home"!=this.page_type||_ge("div_force_header_location_search"))&&(this.current_location_index=i,this.focus_on_location(),this.div_update_results(),this.div_fade())},F._loc_search_div.div_do_loc_search=function(){var page_map_type=window.page_map_type,lat_lng_matches=_ge(this.input_id).value.trim();lat_lng_matches&&this.last_search_term!=lat_lng_matches&&(this.last_search_term&&(this.div_log(0),this.logged_last&&(this.logged_last=0)),this.last_search_term=lat_lng_matches,lat_lng_matches=/^([-\.\d]+),\s*([-\.\d]+)$/i.exec(lat_lng_matches),"org"==page_map_type&&lat_lng_matches&&lat_lng_matches.length?(this.locations=[new woe_location_obj(null,null,null,null,[lat_lng_matches[2],lat_lng_matches[1],lat_lng_matches[2],lat_lng_matches[1]].join(","),null,lat_lng_matches[1],lat_lng_matches[2],null,null)],this.current_location_index=0,_ge(this.id).focus_on_location(),F.API.callMethod("flickr.people.geo.setLocation",{lat:lat_lng_matches[1],lon:lat_lng_matches[2],accuracy:16,context:"last"},this,null,null,0)):(this.div_loading(),F.API.callMethod("flickr.geocode.translate",{location:this.last_search_term,provider_name:this.provider_name},this,null,null,null,0)))},F._loc_search_div.div_add_source_params=function(params){return null!=this.setLocation_geo_point&&_ge("map_controller").is_this_point_on_the_map(this.setLocation_geo_point)&&(writeDebug("adding source!"),params.source=this.setLocation_source_id,params.query=this.setLocation_search_term),params},F._loc_search_div.flickr_geocode_translate_onLoad=function(ResultSet,responseXML,responseText,params){if(ResultSet){var id,ResultSet=responseXML.documentElement.getElementsByTagName("ResultSet")[0],results=responseXML.documentElement.getElementsByTagName("Result");if(this.last_source_id=ResultSet.getAttribute("fl:source_id"),this.locations=[],0!=results.length){for(i=0;i',el.tip_div=tip_div,el.parentNode.appendChild(tip_div),el.fragment_onLoad=function(success,responseText,params){el.fragment_loaded=1,el.tip_div.innerHTML=responseText,F.scroll_this_el_into_view(el.tip_div)}),"none"==el.tip_div.style.display?(_ge("html_info_caret")&&(_ge("html_info_caret").src=_images_root+"/caret_open_down.gif"),el.tip_div.style.display="block",_ge("div_invite_loader")&&(_ge("div_invite_loader").style.display="none"),el.fragment_loaded?F.scroll_this_el_into_view(el.tip_div):F.fragment_getter.get(el.href+"&only_fragment=1",{},el,"fragment_onLoad")):(_ge("html_info_caret")&&(_ge("html_info_caret").src=_images_root+"/caret_closed.gif"),el.tip_div.style.display="none",_ge("div_invite_loader")&&(_ge("div_invite_loader").style.display="block")))},showZeus:function(el){var tip_div;el&&(el.tip_div||((tip_div=document.createElement("div")).style.padding="10 0",tip_div.style.display="none",tip_div.innerHTML='',el.tip_div=tip_div,el.parentNode.appendChild(tip_div),el.fragment_onLoad=function(success,responseText,params){el.fragment_loaded=1,el.tip_div.innerHTML=responseText,F.scroll_this_el_into_view(el.tip_div)}),"none"==el.tip_div.style.display?(_ge("html-info-caret")&&(_ge("html-info-caret").innerHTML="▾"),el.tip_div.style.display="block",_ge("div_invite_loader")&&(_ge("div_invite_loader").style.display="none"),el.fragment_loaded?F.scroll_this_el_into_view(el.tip_div):F.fragment_getter.get(el.href+"&only_fragment=1",{},el,"fragment_onLoad")):(_ge("html-info-caret")&&(_ge("html-info-caret").innerHTML="▸"),el.tip_div.style.display="none",_ge("div_invite_loader")&&(_ge("div_invite_loader").style.display="block")))}},F.osming={osming:!1,check_map:function(map_obj,parent_node){var lat_lon=map_obj.getCenterLatLon(),zl=map_obj.getZoomLevel(),map_type=map_obj.getCurrentMapType();if("undefined"!=typeof _use_osm&&1==_use_osm){var yr,tileReg=!1,cache_buster="",bm=0,years_we_have_burningman_tiles_for=[2008,2009];if("undefined"!=typeof photo_taken_year)for(var n=0,len=years_we_have_burningman_tiles_for.length;nm;r[i]+=s.slice(0,j)+((s=s.slice(j)).length?b:""))j=2==c||(j=s.slice(0,m+1).match(/\S*(\s)?$/))[1]?m:j.input.length-j[0].length||1==c&&m||j.input.length+(j=s.slice(m).match(/^\S*/)).input.length;return r.join("\n")},F.get_elm_size=function(h){var offscreen=_ge("OffScreenElm");offscreen||((offscreen=document.createElement("div")).id="OffScreenElm",offscreen.style.position="absolute",offscreen.style.top="-9999px",offscreen.style.left="-9999px",document.getElementsByTagName("body")[0].appendChild(offscreen)),offscreen.innerHTML=h.innerHTML;var w=offscreen.offsetWidth,h=offscreen.offsetHeight;return offscreen.innerHTML="",[w,h]},F.GlobalDialog=function(){writeDebug("F.GlobalDialog()");var self=this,position_fixed_hack=navigator.userAgent.match(/msie/i),cn=Y.D.getElementsByClassName,isOldIE=navigator.userAgent.match(/msie 6/i);this.spinner=null,this.is_modal=!1,this.events_on=!1,this.o_shadows=null,this.is_showing=!1,this.style="default",this.last_style=null,this.on_escape_handler=null,this.o=null,this.o_container=null,this.o_cover=null,this.get_elements=function(){return self.o_cover||(self.o_cover=_ge("global-dialog-background")),!(!self.o||!self.o_container)||(self.o=document.getElementById("global_dialog"),self.o?(writeDebug("F.GlobalDialog().get_elements"),self.o_container=cn("global_dialog_container","div",self.o)[0],self.o?(self.o_shadows={left:cn("shadow_l","div",self.o)[0],right:cn("shadow_r","div",self.o)[0]},!0):void 0):(writeDebug("F.GlobalDialog(): Warn: o_dialog is null/undefined"),!1))},this.reposition=function(){if(!self.get_elements())return writeDebug("GlobalDialog.reposition: o is null?"),!1;var bgY=parseInt(self.o_container.offsetHeight);self.o_shadows&&self.o_shadows.left&&self.o_shadows.right&&(self.o_shadows.left.style.height=self.o_shadows.right.style.height=bgY+"px"),self.o.style.marginLeft=-parseInt(self.o.offsetWidth)/2+"px",self.o.style.marginTop=-parseInt(self.o.offsetHeight)/2+"px",self.o.style.left="50%",self.o.style.top="50%",position_fixed_hack&&(bgY=window.innerWidth?(window.pageXOffset,window.pageYOffset):(document.body.scrollLeft,document.body.scrollTop),self.o.style.top=bgY+parseInt(document.body.clientHeight/2)+"px")},this.show=function(params){if(writeDebug("F.global_dialog.show()"),void 0!==params&&void 0!==params.loading&&self.set_loading(!!params.loading),!self.get_elements())return!1;void 0!==params?(void 0===params.modal||void 0!==params.modal&&0!=params.modal?self.set_modal(!0):self.set_modal(!1),void 0!==params.style&&self.set_style(params.style),void 0!==params.width&&self.set_width(params.width)):self.set_modal(!0),self.is_showing||(params&&void 0!==params.left?(self.o.style.left=params.left,self.o.style.top=params.top,self.o.style.display="block"):(self.o.style.left="-9999px",self.o.style.top="-9999px",self.o.style.display="block",self.reposition()),self.is_showing=!0)},this.hide=function(o_options){if(writeDebug("F.global_dialog.hide()"),self.set_modal(),position_fixed_hack&&self.detach_events(),self.detach_key_events(),o_options&&o_options.loading?self.set_loading(!0):self.set_loading(!1),!self.get_elements())return!1;self.is_showing&&(self.o.style.display="none",self.is_showing=!1),self.on_escape_handler=null},this.set_width=function(n_width){if(!self.get_elements())return writeDebug("F.GlobalDialog.set_width: no element"),!1;n_width?(writeDebug("setting container width: "+n_width),self.o.style.width="auto",self.o_container.style.width=n_width+"px"):(writeDebug("setting default width"),self.o.style.width="auto",self.o_container.style.width=isOldIE?"334px":"320px"),self.reposition()},this.set_style=function(s_style){if(!self.get_elements())return writeDebug("F.GlobalDialog.set_style: no element"),!1;writeDebug("F.globalDialog.set_style()"),self.last_style&&Y.D.removeClass(self.o,self.last_style),s_style&&Y.D.addClass(self.o,s_style),self.last_style=s_style,self.reposition()},this.set_spinner=function(b_modal){b_modal?(self.spinner||(self.spinner=document.createElement("div"),self.spinner.className="global_dialog_spinner",document.body.appendChild(self.spinner),position_fixed_hack&&self.position_cover(self.spinner)),self.spinner.style.display="block"):self.spinner&&(self.spinner.style.display="none")},this.set_modal=function(b_modal){if(self.is_modal=b_modal,!self.o_cover)return!1;b_modal?(position_fixed_hack?(self.o_cover.style.position="absolute",self.position_cover(),self.attach_events()):self.o_cover.style.position="fixed",self.attach_key_events(),self.o_cover.style.backgroundColor="#000",self.o_cover.style.opacity=.35,self.o_cover.style.MozOpacity=.35,self.o_cover.style.filter="alpha(opacity=35)",self.o_cover.style.display="block"):(self.o_cover.style.position="absolute",self.o_cover.style.display="none",self.detach_events(),self.detach_key_events())},this.set_loading=function(b_loading){if(!self.o_cover)return writeDebug("setLoading: no cover"),!1;writeDebug("F.global_dialog.set_loading(): "+b_loading),b_loading?(self.set_spinner(b_loading),Y.D.removeClass(self.o_cover,"loaded"),Y.D.addClass(self.o_cover,"loading"),self.is_modal||self.set_modal(!0)):(self.set_spinner(b_loading),Y.D.removeClass(self.o_cover,"loading"),Y.D.addClass(self.o_cover,"loaded"),self.is_modal&&self.set_modal(!1))},this.remove_existing_dialog=function(){if(self.o){writeDebug("remove_existing_dialog: removing node");try{return self.o.parentNode.removeChild(self.o),self.o=null,writeDebug("remove OK"),!0}catch(e){return writeDebug("WARN: could not remove node"),!1}}},this.create_dialog=function(innerHTML,o_options){self.o&&(self.remove_existing_dialog(),self.o=null),self.last_style=null,self.is_showing=!1;var o=document.createElement("div");return o.id="global_dialog",o.className="global_dialog",document.body.appendChild(o),self.o=o,self.o.innerHTML='
    '+innerHTML+"
    ",self.o_container=null,self.get_elements(),o_options&&o_options.style&&self.set_style(o_options.style),o_options&&o_options.width?self.set_width(o_options.width):self.set_width(),self},this.position_cover=function(o_element){var bgX,bgY;if(o_element=o_element||self.o_cover,!self.get_elements())return!1;bgY=window.innerWidth?(bgX=window.pageXOffset,window.pageYOffset):(bgX=document.body.scrollLeft,document.body.scrollTop),o_element.style.top=bgY+"px",o_element.style.left=bgX+"px"},this.legacy_resize_handler=function(){writeDebug("GlobalDialog.legacy_resize_handler()"),self.reposition(),self.position_cover()},this.legacy_scroll_handler=function(){writeDebug("GlobalDialog.legacy_scroll_handler()"),self.reposition(),self.position_cover()},this.key_handler=function(e){writeDebug("key_handler()"),27==(e.which||e.keyCode)&&self.hide()},this.attach_events=function(){if(self.events_on)return!1;self.events_on=!0,Y.U.Event.addListener(window,"resize",self.legacy_resize_handler,self,!0),Y.U.Event.addListener(window,"scroll",self.legacy_scroll_handler,self,!0)},this.attach_key_events=function(){Y.U.Event.addListener(window,"keyup",self.key_handler,self,!0)},this.detach_events=function(){if(!self.events_on)return!1;self.events_on=!1,Y.U.Event.removeListener(window,"resize",self.legacy_resize_handler),Y.U.Event.removeListener(window,"scroll",self.legacy_scroll_handler)},this.detach_key_events=function(){Y.U.Event.removeListener(window,"keyup",self.key_handler)},F.preload_images(_images_root+"/progress/balls-24x12-white.gif"),this.get_elements()},F.global_dialog=null,Y.E.onDOMReady(function(){F.global_dialog=new F.GlobalDialog}),"undefined"!=typeof page_printing_use_printcart&&(F.Printing=function(){var self=this,enable_printcart="undefined"!=typeof page_printing_use_printcart,snapfish_unavailable="undefined"!=typeof page_printing_snapfish_unavailable?page_printing_snapfish_unavailable:null;this.cart_urls={},this.addtocart_cart_url=page_printing_snapfish_cart_url,this.authed_partners={snapfish:null},this.user_data={user_country:"undefined"!=typeof page_printing_country_user?page_printing_country_user:null},this.size_units=null,this.options={print_partner:"snapfish",photo_ids:null,product_name:"print",product:null,show_other_products:!1,user_currency:null,style:null},this.composites_allowing_single_photo={prod6:!0,prod7:!0,prod8:!0,prod9:!0};var special_country_exceptions={snapfish:{cn:"exception-china",dk:"exception-generic",hk:"exception-china",no:"exception-generic",se:"exception-generic",va:"exception-italy"}};this.printcart_config={queue:[],max_ids_per_api_call:20,api_responses:0,api_responses_expected:0},this.global_photos_data={queue:[],api_queue:[],max_ids_per_api_call:16,max_items_to_check:256,api_responses:0,api_responses_expected:0},this.reset_exclusions=function(){self.excluded_videos={ids:[]},self.excluded_photos={ids:[],non_jpeg:[]}},this.reset_exclusions(),this.check_global_photo_exceptions=function(){writeDebug("check_global_photo_exceptions()");for(var ok_photo_ids=[],i=self.options.photo_ids.length;i--;)do_exclude=0,window.global_photos[self.options.photo_ids[i]]&&("video"==window.global_photos[self.options.photo_ids[i]].media&&(self.excluded_videos.ids.push(self.options.photo_ids[i]),do_exclude=1),"photo"==window.global_photos[self.options.photo_ids[i]].media&&window.global_photos[self.options.photo_ids[i]].originalformat&&window.global_photos[self.options.photo_ids[i]].originalformat.match(/gif|bmp|tif|tiff|png/i)&&(do_exclude=1,self.excluded_photos.ids.push(self.options.photo_ids[i]),self.excluded_photos.non_jpeg.push(self.options.photo_ids[i]))),do_exclude||ok_photo_ids.push(self.options.photo_ids[i]);return ok_photo_ids},this.is_showing_products=!1;var photo_id=null,is_multiple_photoids=null,print_item_count=0,use_simple_confirm_dialog=null,supported_countries=null,last_location_class=null,which="print",ref_str_base="PrintDialog",ref_str=ref_str_base+"Div",what_key="print";this.fetched_product_list=!1,this.check_is_authed=function(partner_id,f_onload){if(writeDebug("F.printing.check_is_authed()"),!partner_id)return writeDebug("check_is_authed: need partner id"),!1;var auth_params;f_onload||writeDebug("check_is_authed: need onload handler"),void 0!==self.authed_partners[partner_id]&&null!=self.authed_partners[partner_id]?f_onload(self.authed_partners[partner_id]):(auth_params={partner:partner_id,user_id:global_nsid},F.API.callMethod("flickr.auth.userHasPartnerToken",auth_params,{flickr_auth_userHasPartnerToken_onLoad:function(success,token_element,responseText,params){token_element=token_element.documentElement.getElementsByTagName("auth")[0];self.authed_partners[partner_id]=!!token_element&&"1"==token_element.getAttribute("has_token"),f_onload(self.authed_partners[partner_id])}}))},this.reset=function(){writeDebug("reset(): starting over - will re-fetch fragment, products"),self.fetched_product_list=!1,self.productsO=void 0,self.is_showing_products=!1},this.auth_prompt=function(o_params){if(!o_params)return writeDebug("auth_prompt: {partner:} param missing?"),!1;var params={partner:o_params.partner,magic_cookie:global_auth_hash};self.do_auth_ok_handler=o_params.onsuccess||null,self.do_auth_fail_handler=o_params.onfail||null,F.global_dialog.hide(),F.global_dialog.set_loading(!0),window.page_always_post_fragment_requests=!0,F.fragment_getter.get("/photo_auth_inline_fragment.gne",params,this,"auth_prompt_onload")},this.print_location_update=function(){_ge("print_country_snapfish").value;if(!supported_countries){var o=_ge("print-supported-countries").getElementsByTagName("option");supported_countries=[];for(var i=o.length;i--;)supported_countries[o[i].value]=!0}void 0!==special_country_exceptions.snapfish[this.value]?(Y.D.removeClass("print-location-container",last_location_class),last_location_class=special_country_exceptions.snapfish[this.value],Y.D.addClass("print-location-container",last_location_class)):supported_countries[this.value]?Y.D.removeClass("print-location-container",last_location_class):(Y.D.removeClass("print-location-container",last_location_class),Y.D.addClass("print-location-container","exception"),last_location_class="exception")},this.auth_prompt_onload=function(success,responseText,params){writeDebug("auth_account_onload()"),F.global_dialog.remove_existing_dialog();var content=document.createElement("div");content.innerHTML=responseText,document.body.appendChild(content),F.global_dialog.set_width(525),F.global_dialog.show({loading:!1}),"snapfish"==self.options.print_partner&&_ge("print-location")&&(_ge("print-location").onchange=_ge("print-location").onkeypress=self.print_location_update,_ge("print-location").onchange.apply(_ge("print-location"))),!success&&o_params&&o_params.onfail&&o_params.onfail()},this.set_print_prefs_and_auth=function(print_privacy,o_auth_params){if(writeDebug("set_print_prefs_and_auth()"),!print_privacy)return writeDebug("need print_prefs object"),!1;var print_country=print_privacy.print_country||null,print_privacy=print_privacy.print_privacy||null,api_responses_expected=0,api_responses_done_handler=null;function generic_api_handler(){writeDebug("set_print_prefs_generic_api_onload()"),api_responses_expected--,writeDebug("responses remaining: "+api_responses_expected),0==api_responses_expected&&(writeDebug("calling done handler"),api_responses_done_handler())}print_country&&(api_responses_expected++,null!=print_privacy?F.API.callMethod("flickr.printing.setPrefs",{country_code:print_country,print_privacy:print_privacy},{generic_api_onLoad:generic_api_handler}):F.API.callMethod("flickr.printing.setPrefs",{country_code:print_country},{generic_api_onLoad:generic_api_handler})),0=self.global_photos_data.api_responses_expected&&f_api_onload_handler&&f_api_onload_handler()}});self.global_photos_data.queue=[]},this.order_products=function(params){if(void 0!==window.use_yui3_printing)return writeDebug("F.printing.order_products(): YUI 3 printing active, exiting"),!1;if(params?(params.print_partner&&(self.options.print_partner=params.print_partner),params.photo_ids?(params.photo_ids instanceof Array?writeDebug("photo_ids is an array, "+params.photo_ids.length+" items"):params.photo_ids=params.photo_ids.toString().replace(/\s/g,"").split(","),writeDebug("setting photo id(s): "+params.photo_ids.join(",")),self.options.photo_ids=params.photo_ids instanceof Array?params.photo_ids:[params.photo_ids]):"undefined"!=typeof page_photo_id&&page_photo_id&&(writeDebug("order_products: using page_photo_id"),self.options.photo_ids=[page_photo_id]),params.show_other_products&&(writeDebug("setting show_other_products"),self.options.show_other_products=params.show_other_products),params.product&&(writeDebug("setting product filter - results will be limited to matching API endpoint"),self.reset(),self.options.product_name=params.product,self.options.product=params.product),params.style&&(self.options.style=params.style)):writeDebug("order_products: WARN: No partner/photo ID params - using defaults"),!self.options.print_partner)return writeDebug("order_products: Need print_partner"),!1;if(!self.options.photo_ids){if("undefined"==typeof page_photo_id||!page_photo_id)return writeDebug("order_products: Need photo_ids"),!1;writeDebug("using page_photo_id"),self.options.photo_ids=[page_photo_id]}if(print_item_count=self.options.photo_ids.length,is_multiple_photoids=1'+self.get_print_options_html()+'
    '+self.get_footer_checkout_note()+"
    ",{style:self.options.style}):F.global_dialog.create_dialog('
    '+self.get_print_options_html()+"
    ",{style:self.options.style}),writeDebug("printDialogListDiv: "+_ge("PrintDialogListDiv")),_ge("PrintDialogListDiv").innerHTML=responseText,writeDebug("print_form: "+_ge("print_form")),_ge("PrintDialogHeaderDiv").style.display="none",_ge("PrintDialogListWrapperDiv").style.display="block",_ge("print_form").style.display="block",self.assign_other_product_links(),self.show_printing_products()},this.get_product_name=function(partner_id,name,product_endpoint,size_label,size_units){name=partner_id+"_product"+name;if(writeDebug("get_product_name()"),size_label&&size_units){if(writeDebug("dimensions && type"),"print"==product_endpoint)return name=partner_id+"_prints",writeDebug("F.printing.get_product_name: "+name),F.output.get(name,size_label.replace_global("x","×"));if("poster"==product_endpoint)return name=partner_id+"_poster",writeDebug("F.printing.get_product_name: "+name),F.output.get(name,size_label.replace_global("x","×"))}return writeDebug("F.printing.get_product_name: "+name),F.output.get(name)},this.get_print_options_html=function(){writeDebug("get_print_options_html");F.output.get("photo_what_print"),F.output.get("photo_what_print_plural");var start_html='",start_html+='",writeDebug("get_print_options_html: OK"),start_html},this.get_click_a_text=function(){writeDebug("get_click_a_text");var txt="";return"sendToSet"==which?user_can_create_sets?txt+=F.output.get("photo_choose_a_set_or","_ge('"+ref_str+"').show_new_set_form();return false;"):txt+=F.output.get("photo_choose_a_set"):"addToGallery"==which?txt+=F.output.get("photo_choose_a_gallery_or","_ge('"+ref_str+"').show_new_gallery_form(); return false;"):"print"==which?txt=is_multiple_photoids?""+F.output.get("print_x_photos_with_snapfish",print_item_count)+"":F.output.get("photo_snapfish_choose_a_size"):("set"==what_key&&(txt=F.output.get("photo_choose_a_what_set")),"group"==what_key&&(txt=F.output.get("photo_choose_a_what_group")),"blog"==what_key&&(txt=F.output.get("photo_choose_a_what_blog")),"print"==what_key&&(txt=F.output.get("photo_choose_a_what_print")),"gallery"==what_key&&(txt=F.output.get("photo_choose_a_what_gallery"))),txt},this.flickr_printcart_getProductList_onLoad=function(success,was_multiple_photoids,allowed_photo_ids,params){writeDebug("flickr_printcart_getProductList_onLoad"),success||alert(F.output.get("api_err_generic")+" "+allowed_photo_ids),self.fetched_product_list=!0,writeDebug("checking photo IDs"),self.options.photo_ids instanceof Array||!self.options.photo_ids.length||-1!=self.options.photo_ids.indexOf(",")||(writeDebug("making array"),self.options.photo_ids=self.options.photo_ids.join(","));for(var i=0;i=product_minresx&&p.o_h>=product_minresy||p.o_h>=product_minresx&&p.o_w>=product_minresy):1,do_show||do_exclude||hidden_count++,self.productsO["prod"+product_id+"_printcart"]={id:product_id,api_product_name:product_name,name:self.get_product_name(self.options.print_partner,product_id,product_endpoint,size_label,size_units),description:product_description,price:product_price,recommended:product_rec,minresx:product_minresx,minresy:product_minresy,product_type:product_type,exclude:do_exclude,show:do_show,provider_host:provider_host,product_endpoint:product_endpoint,size_label:size_label,size_units:size_units},page_print_prices["prod"+product_id+"_printcart"]=product_price}hidden_count&&_ge("more_print_options")&&(writeDebug(hidden_count+" items hidden, showing more print options"),_ge("more_print_options").style.display="inline");was_multiple_photoids=1

    '+F.output.get("nothing_to_print")+'

    '+F.output.get("ok")+"

    "),F.global_dialog.show(),!1}else;self.excluded_videos.ids.length&&writeDebug(self.excluded_videos.ids.length+" videos were excluded"),self.excluded_photos.ids.length?(writeDebug(self.excluded_photos.ids.length+" photos were excluded"),is_multiple_photoids&&_ge("multiple_unsupported_message")&&(_ge("multiple_unsupported_message").innerHTML=F.output.get("snapfish_unsupported").replace_global("{$js_count}",self.excluded_photos.ids.length).replace_global("{$js_photocount}",self.options.photo_ids.length+self.excluded_photos.ids.length)),_ge(is_multiple_photoids?"print_multiple_unsupported_tr":"print_single_unsupported_tr").style.display=F.is_ie?"block":"table-row"):_ge(is_multiple_photoids?"print_multiple_unsupported_tr":"print_single_unsupported_tr").style.display="none"},this.assign_other_product_links=function(){if(writeDebug("assign_other_product_links()"),!(links=_ge("sf-product-links")))return!1;for(var links=links.getElementsByTagName("a"),product_ids=self.options.photo_ids instanceof Array?self.options.photo_ids.join(","):self.options.photo_ids,link_types={product_photobook:{product_name:"book"},product_calendar:{product_name:"calendar"},product_card:{product_name:"card"},product_collage:{product_name:"collage"},product_canvas:{product_name:"canvas"}},i=0;i"+ft+"",print_form.last_total!=t&&anim_do_blink_pink(ppt_td)):ppt_td.style.color="rgb(0, 0, 0)",writeDebug("update_print_prices: done"),ppt_td.innerHTML=ft,print_form.last_total=t,_ge("print_add")&&(_ge("print_add").className=0==t?"DisabledButt":"Butt")},this.increment_print_dropdown=function(e){var target_el=Y.E.getTarget(e),el=null;if(!(el=target_el?F.find_parent_node_by_name(target_el,"tr").getElementsByTagName(is_multiple_photoids?"input":"select")[0]:el))return!0;if(is_multiple_photoids)try{el.checked="checked",F.printing.update_print_prices()}catch(e){}else try{el.selectedIndex',params+='

    '+F.output.get("snapfish_off_you_go")+"

    ",params+="

    "+F.output.get("snapfish_handing_off")+"

    ",params+='",params+="

    "+F.output.get("have_fun")+"

    ",params+='',params+="",F.global_dialog.create_dialog(params,{style:self.options.style}),_ge("print_ok_button").onclick=function(){self.send_to_action()},_ge("print_cancel_button").onclick=function(){F.global_dialog.hide(),F.global_dialog.set_loading(!1)},_ge("prints-in-shopping-cart")?F.API.callMethod("flickr.printcart.getAllQueued",null,{flickr_printcart_getAllQueued_onLoad:function(success,responseXML,responseText,params){responseXML.getElementsByTagName("photo").length&&_ge("prints-in-shopping-cart")&&(_ge("prints-in-shopping-cart").style.display="block"),F.global_dialog.show()}}):F.global_dialog.show()):(F.global_dialog.show({loading:!1}),F.global_dialog.reposition(),self.update_print_prices())):(F.global_dialog.show({loading:!1}),F.global_dialog.reposition(),self.update_print_prices()),self.is_showing_products=!0}else if(enable_printcart){if(writeDebug("show_printing_products: new cart"),self.global_photos_data.api_responses',"
    "+F.output.get("prints_during_checkout")+"
    ",'
     
    ',""].join("")},this.find_products_by_name=function(product_name){var results=[];if(!self.productsO)return results;var item=null;for(item in self.productsO)self.productsO[item].product_endpoint==product_name&&results.push(self.productsO[item]);return results},this.send_to_action=function(){F.output.get("photo_adding_prints_to_cart");F.global_dialog.hide(),F.global_dialog.set_loading(!0),writeDebug("send_to_action: print case"),self.addToCart_responses_expected=page_print_orderA.length,self.addToCart_responses=0,self.addToCart_error_count=0,self.addToCart_problem_product_ids=[],self.addToCart_last_error="",self.send_another_printing_product()},this.send_another_printing_product=function(){if(writeDebug("send_another_printing_product()"),!page_print_orderA[self.addToCart_responses])return writeDebug("send_another_printing_product: page_print_orderA["+self.addToCart_responses+"] null/undefined"),!1;var A=page_print_orderA[self.addToCart_responses].split(":");writeDebug("A split: "+A.join("/")),writeDebug("A[0]: "+A[0]),writeDebug("A[1]: "+A[1]);var params=null;enable_printcart?"composite"!=self.productsO[A[0]].product_type&&"other"!=self.options.product_name?(F.printing.options.product_name=self.productsO[A[0]].product_endpoint,params={provider_id:self.options.print_partner,photo_ids:self.options.photo_ids,product_id:A[0].match(/[0-9]+/),quantity:is_multiple_photoids?1:A[1]},self.add_product("flickr.printcart.addPrint",params,self)):(F.printing.options.product_name=self.productsO[A[0]].product_endpoint,params={provider_id:self.options.print_partner,photo_ids:self.options.photo_ids,product_id:A[0].match(/[0-9]+/),quantity:is_multiple_photoids?1:A[1]},self.add_product("flickr.printcart.addComposite",params,self)):(params={provider_id:page_printing_provider,photo_ids:photo_id,product_id:A[0].replace_global("prod",""),quantity:A[1]},F.API.callMethod("flickr.printing.addToCart",params,self))},this.add_product=function(api_method_name,params,scope){var photo_ids=params.photo_ids;if(!photo_ids.length)return writeDebug("add_product: queue is empty."),!1;var handler=scope,max_ids=self.printcart_config.max_ids_per_api_call;if(params.photo_ids.length<=max_ids)writeDebug("adding "+params.photo_ids.length+" items at once"),F.API.callMethod(api_method_name,params,scope);else{for(var this_ids=[],queued_ids=[],i=0;i

    '+F.output.get("snapfish_unavailable")+'

    '+F.output.get("ok")+"

    "),F.global_dialog.show(),!1},this.post_to_url=function(url,o_params){if(writeDebug("post_to_url()"),snapfish_unavailable)return self.show_snapfish_unavailable();var f=document.createElement("form");f.id="print-form",f.action=url,f.method="post",f.style.position="absolute",f.style.left="-999px",f.style.top="-999px";var formHTML="",item=null;for(item in writeDebug("going into item loop"),o_params)formHTML+='\n';writeDebug("item loop OK"),f.innerHTML=formHTML,writeDebug("innerHTML OK"),document.body.appendChild(f),writeDebug("appendChild OK"),f.submit()},this.check_and_go_to_cart=function(){writeDebug("check_and_go_to_cart()"),F.global_dialog.hide({loading:!0}),F.API.callMethod("flickr.printcart.getAllQueued",null,{flickr_printcart_getAllQueued_onLoad:function(success,responseXML,responseText,params){var items=responseXML.getElementsByTagName("photo");self.check_is_authed(self.options.print_partner,function(is_authed){if(!items.length&&!is_authed)return F.global_dialog.create_dialog('

    '+F.output.get("print_cart_empty")+'

    '+F.output.get("ok")+"

    "),F.global_dialog.show({modal:!0}),!1;writeDebug(items.length+" items in cart"),self.go_to_cart()})}})},this.go_to_cart=function(product_name,function_ok){writeDebug("go_to_cart()"),F.global_dialog.hide({loading:!0});var product=product_name||self.options.product_name;self.check_is_authed(self.options.print_partner,function(is_authed){var ok;is_authed?(writeDebug("auth OK"),self.post_to_url(self.addtocart_cart_url,{product_name:product})):(ok=ok=ok||self.snapfish_auth_ok,writeDebug("doing auth prompt"),self.auth_prompt({partner:self.options.print_partner,onsuccess:ok,onfail:function(){writeDebug("User canceled, or auth failed"),F.global_dialog.hide()}}))})},this.flickr_printing_addToCart_onLoad=this.flickr_printcart_addPrint_onLoad=this.flickr_printcart_addComposite_onLoad=function(success,responseXML,responseText,params){writeDebug("flickr_printing_addToCart_onLoad()"),self.addToCart_responses++;try{var cart_url;if(writeDebug("addToCart_onLoad()"),success?(cart_url=F.printing.cart_urls["product"+params.product_id],writeDebug("cart URL: "+cart_url),self.addtocart_cart_url=cart_url):(self.addToCart_error_count++,self.addToCart_problem_product_ids.push(params.product_id),self.addToCart_last_error=responseText||F.output.get("unknown_err")),writeDebug("addToCart_responses / self.addToCart_responses_expected: "+self.addToCart_responses+" "+self.addToCart_responses_expected),self.addToCart_responsesself.addToCart_error_count){var confirm_html="";if(use_simple_confirm_dialog)return self.go_to_cart(),!1;enable_printcart?confirm_html+='
    ':confirm_html='
    ',0")):confirm_html+=use_simple_confirm_dialog?'

    '+F.output.get("photo_added_prints_to_order")+"

    ":'
    '+F.output.get("photo_added_prints_to_order")+"
    ",confirm_html+='
      ';for(var i=0;i":"undefined"!=typeof page_printing_use_printcart?confirm_html+="
    • ("+A[1]+") "+self.productsO[A[0]].name+" — "+F.currency.format_currency(A[1]*self.productsO[A[0]].price,{currency_type:self.options.user_currency,country:self.user_data.user_country})+"*
    • ":confirm_html+="
    • ("+A[1]+") "+self.productsO[A[0]].name+" ("+self.format_price(A[1]*self.productsO[A[0]].price.replace_global(".",""))+") total*
    • "}confirm_html+="
    ","undefined"!=typeof page_printing_use_printcart&&("USD"!=self.options.user_currency?confirm_html+='

    '+F.output.get("snapfish_estimated_price")+"

    ":confirm_html+='

    '+F.output.get("snapfish_estimated_price_usd")+"

    "),confirm_html+='
    ',confirm_html+='
    ",confirm_html+="
    ",enable_printcart?(photo_notes&&photo_notes.stop_comming(),F.global_dialog.hide(),F.global_dialog.set_loading(!0),F.global_dialog.create_dialog(confirm_html,{style:self.options.style}),F.global_dialog.show()):photo_notes&&photo_notes.start_comming(confirm_html,1,0,F.output.get("photo_go_to_cart"),1,null,null);var print_ok_button=_ge("print_ok_button");-1==navigator.userAgent.indexOf("KHTML")&&print_ok_button.focus(),print_ok_button.onclick=function(){enable_printcart?(F.global_dialog.hide(),F.global_dialog.set_loading(!1)):(photo_notes.stop_comming(),this.blur())},_ge("print_cart_button").onclick=function(){self.go_to_cart()},F.global_dialog.set_loading(!1),F.global_dialog.show()}else alert(F.output.get("photo_errors_adding_prints")+" "+self.addToCart_last_error),photo_notes&&photo_notes.stop_comming&&photo_notes.stop_comming(1)}catch(e){writeDebug("ERROR: "+e.toString()+e.line||e.lineNumber)}}},F.printing=new F.Printing),F.currency=new Currency,F.photo_guestpassnotice_hide={action_element_id:"candy_hide_guestpass",message_container_id:"guestPassNotice",animation:null,hide:function(){this.animation.animate()},init:function(){var action_element=_ge(this.action_element_id),container_element=_ge(this.message_container_id);if(!action_element)return!1;F.decorate(action_element,F._simple_button).button_go_go_go(),this.animation=new YAHOO.util.Anim(container_element,{height:{to:0},padding:{to:0}},1,YAHOO.util.Easing.easeOut),this.animation.onComplete.subscribe(function(event){_ge(this.message_container_id).style.display="none",_set_cookie("flgp_d",1,0)},null,this),Y.E.on(action_element,"click",this.hide,null,this)}},Y.E.onDOMReady(function(){F.photo_guestpassnotice_hide.init()}),function(){function pollCookie(){document.cookie.match(/cookie_session=[^;]+/gi)?(authInProgress=!1,checkAuth()):window.setTimeout(pollCookie,20)}function handleSignInLink(e){Y.E.stopEvent(e),upload=!(authInProgress=!0),webCirca1999("/signin")}function handleClick(e){var targ=Y.E.getTarget(e);targ.id&&"head-signin-link"===targ.id||"head-sign-up"===targ.id?handleSignInLink(e):"head-upload-link"===targ.id?(Y.E.stopEvent(e),upload=authInProgress=!0,webCirca1999("/signin")):Y.D.hasClass(targ,"signin-popup")&&handleSignInLink(e)}var POST_LOGIN,hasBlurred,authInProgress,upload,redir,checkAuth,webCirca1999;_enable_popup_login&&!global_nsid&&(redir=upload=authInProgress=hasBlurred=!(POST_LOGIN="/photo_grease_postlogin.gne"),checkAuth=function(){Y.U.Connect.asyncRequest("GET","/fragment.gne?name=social-auth-fragment",{success:function(o){"1,0"==o.responseText?upload?window.location="/photos/upload":redir?window.location=redir:window.location.reload():"1,1"==o.responseText&&(window.location="/")}},null)},webCirca1999=function(fullUrl){pollCookie();fullUrl=fullUrl+"?popup=1&redir="+POST_LOGIN+"?d="+window.location;try{web1999Window=window.open(fullUrl,"newWindow","width=650,height=650,resizable=1,scrollbars=1,location=yes")}catch(e){return!0}try{web1999Window.focus&&web1999Window.focus()}catch(ee){}return window.setTimeout(function(){web1999Window&&!web1999Window.closed&&void 0!==web1999Window.closed&&hasBlurred||window.location},10),!1},Y.E.onDOMReady(function(){_ge("TopBar");var signin=_ge("head-signin-link"),list=_ge("head-sign-up"),upload=_ge("head-upload-link"),upgrade=document.getElementById("buynowlink"),list=[upload,signin,list];Y.E.addListener(list.concat(Y.D.getElementsByClassName("signin-popup")),"click",handleClick),upgrade&&Y.E.addListener(upgrade,"click",handleSignInLink)}),window.onfocus=function(){hasBlurred&&(authInProgress=!1,checkAuth())},window.onblur=function(){authInProgress&&(hasBlurred=!0)},document.onfocusout=function(){authInProgress&&(hasBlurred=!0)},document.onfocusin=function(){hasBlurred&&(authInProgress=!1,checkAuth())})}();F.output.sentencise=function(A,tag){for(var b_tag=tag||"",e_tag=tag?tag.replace_global("<","",i=0;i, ":str+=" and ";return str+=""},F.output.dateize=function(y,m,d){return F.output.date_strs.monthsA[m]+" "+d+", "+y},F.output.get_plural=function(){for(var new_args=[],i=0;iiPrecision&&(rs=rs.substring(0,iPrecision)),processFlags(flags,width,rs,0)},converters.a=function(flags,width,precision,arg){return arg instanceof Array?F.output.sentencise(arg,""):arg},farr=fstring.split("%"),retstr=farr[0],fpRE=/^([0-9]+\$)?([-+ #]*)(\d*)\.?(\d*)([acdieEfFgGosuxX])(.*)$/;for(var i=1;i\n');if(success?"1"!=_qs_args.no_api_debug&&writeAPIDebug(responseText):writeAPIDebug(responseText+"\r"+_uber_toString(params)),window.global_rper&&!success||"1"==_qs_args.rper){var code="",msg="",rsp_str="";if(responseXML&&responseXML.documentElement&&responseXML.documentElement.getElementsByTagName("err")){var err=responseXML.documentElement.getElementsByTagName("err")[0];err&&(code=err.getAttribute("code"),msg=err.getAttribute("msg"),rsp_str=responseText)}F.fragment_getter.get("/report_error.gne",{report:"api_err",json_str:JSON.stringify({req_params:params,success:success,code:code,rsp_str:rsp_str,user_nsid:window.global_nsid,user_name:window.global_name,agent:navigator.userAgent})},{rp:function(){}},"rp")}_page_timer.add("after api call "+params.method),_page_timer.dump(params.timer_index),listener=listener||this,"function"==typeof listener[this.getCallBackName(APIMethod)]?listener[this.getCallBackName(APIMethod)](success,responseXML,responseText,params):"function"==typeof listener.generic_api_onLoad&&listener.generic_api_onLoad(success,responseXML,responseText,params)},F.fragment_getter={},F.fragment_getter.get=function(url,params,listener,callback_name,attempts,server,sync,delayMS){"object"!=typeof params&&(params={});var async=sync?0:1,RESTURLROOT=url;if(server&&(RESTURLROOT=server+RESTURLROOT),url&&-1==url.indexOf("?"))var RESTURL="?src=js";else RESTURL="&src=js";for(var p in params)RESTURL+="&"+p+"="+escape_utf8(params[p]);RESTURL+="&cb="+(new Date).getTime(),params.RESTURL=RESTURLROOT+RESTURL;attempts=null==attempts?1:attempts;var req=new XHR;if(req){req.onreadystatechange=function(){4==req.readyState&&(""==req.responseText&&attempts<1?(attempts++,req.abort(),F.fragment_getter.get(url,params,listener,callback_name,attempts,server,sync,delayMS)):F.fragment_getter.handleResponse(callback_name,params,req.responseText,listener),this.onreadystatechange=null)};var POST=1e3>>18,bs[1]=128|(258048&c)>>>12,bs[2]=128|(4032&c)>>>6,bs[3]=128|63&c):2048>>12,bs[1]=128|(4032&c)>>>6,bs[2]=128|63&c):128>>6,bs[1]=128|63&c):bs[0]=c,1>>4)+nibble_to_hex(15&b))}else encodeURIComponent&&"function"==typeof encodeURIComponent?buffer+=encodeURIComponent(String.fromCharCode(bs[0])):buffer+=String.fromCharCode(bs[0])}return buffer},nibble_to_hex=function(nibble){return"0123456789ABCDEF".charAt(nibble)};var flashDescription,requiredVersion=6,useRedirect=!1,flashPage="movie.html",noFlashPage="noflash.html",upgradePage="upgrade.html",flash2Installed=!1,flash3Installed=!1,flash4Installed=!1,flash5Installed=!1,flash6Installed=!1,flash7Installed=!1,maxVersion=7,actualVersion=0,hasRightVersion=!1,jsVersion=1,isIE=-1!=navigator.appVersion.indexOf("MSIE"),isWin=-1!=navigator.appVersion.indexOf("Windows");function detectFlash(){if(navigator.plugins&&(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"])){var isVersion2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";flashDescription=navigator.plugins["Shockwave Flash"+isVersion2].description;var a=flashDescription.split(".")[0].split(" "),flashVersion=parseInt(a[a.length-1]);flash2Installed=2==flashVersion,flash3Installed=3==flashVersion,flash4Installed=4==flashVersion,flash5Installed=5==flashVersion,flash6Installed=6==flashVersion,flash7Installed=7<=flashVersion}for(var i=2;i<=maxVersion;i++)1==eval("flash"+i+"Installed")&&(actualVersion=i);-1!=navigator.userAgent.indexOf("WebTV")&&(actualVersion=3),requiredVersion<=actualVersion?(useRedirect&&(1 \n"),document.write("on error resume next \n"),document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n'),document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n'),document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n'),document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n'),document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n'),document.write("<\/SCRIPT> \n")),detectFlash();var md5_hex_chr="0123456789abcdef";function md5_rhex(num){for(str="",j=0;j<=3;j++)str+=md5_hex_chr.charAt(num>>8*j+4&15)+md5_hex_chr.charAt(num>>8*j&15);return str}function md5_str2blks_MD5(str){for(nblk=1+(str.length+8>>6),blks=new Array(16*nblk),i=0;i<16*nblk;i++)blks[i]=0;for(i=0;i>2]|=str.charCodeAt(i)<>2]|=128<>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function md5_rol(num,cnt){return num<>>32-cnt}function md5_cmn(q,a,b,x,s,t){return md5_add(md5_rol(md5_add(md5_add(a,q),md5_add(x,t)),s),b)}function md5_ff(a,b,c,d,x,s,t){return md5_cmn(b&c|~b&d,a,b,x,s,t)}function md5_gg(a,b,c,d,x,s,t){return md5_cmn(b&d|c&~d,a,b,x,s,t)}function md5_hh(a,b,c,d,x,s,t){return md5_cmn(b^c^d,a,b,x,s,t)}function md5_ii(a,b,c,d,x,s,t){return md5_cmn(c^(b|~d),a,b,x,s,t)}function md5_calcMD5(str){for(x=md5_str2blks_MD5(str),a=1732584193,b=-271733879,c=-1732584194,d=271733878,i=0;i'},!0)},insitu_init_page_app_description_div=function(app_id){if(!_ok_for_scrumjax())return!1;var div=insitu_init_generic_description_div(app_id,global_apps);return div.getInput=function(){return'"},div.getExtra=function(){return"
    "},!0},insitu_init_page_app_url_div=function(app_id){if(!_ok_for_scrumjax())return!1;var div=_ge("app_website_div"+app_id);return div.form_content=global_apps[app_id].website_url,div.emptyText=""+F.output.get("insitu_click_to_add_url")+" ",div.app_id=app_id,div.website_button=_ge("app_website_button"+app_id),div.website_form=_ge("app_website_form"+app_id),div.getInput=function(){return''},div.getExtra=function(){return""},div.saveChanges=function(form){deja_view_uh_huh(),global_apps[this.app_id].website_url=form.content.value,this._oldTitle=this.innerHTML,this.innerHTML=""+F.output.get("insitu_saving")+" ",this.endEditing(),req={app_id:app_id,website_url:global_apps[this.app_id].website_url},F.API.callMethod("flickr.applications.setUrls",req,div)},div.flickr_applications_setUrls_onLoad=function(success,responseXML,responseText){var url=global_apps[this.app_id].website_url;if(url.match(/\:\/\//)||(url=" "),success)F.API.callMethod("flickr.applications.getInfo",{app_id:this.app_id},div);else{var errArray=responseXML.documentElement.getElementsByTagName("err");if(errArray&&0'+F.output.get("spam_url_warning")+".

    ",this.parentNode.insertBefore(warnDiv,this),this.startEditing()}else global_apps[this.app_id].website_url=this.form_content,this.innerHTML=""==global_apps[this.app_id].website_url?" ":global_apps[this.app_id].website_url.trim().escape_for_display().nl2br()+" ",alert(F.output.get("insitu_url_error"))}},div.flickr_applications_getInfo_onLoad=function(success,responseXML,responseText){var new_url;if(success){if(responseXML.documentElement.getElementsByTagName("website_url")[0].firstChild)var title_raw=responseXML.documentElement.getElementsByTagName("website_url")[0].firstChild.nodeValue;else title_raw="";global_apps[this.app_id].title=div.form_content=title_raw,new_url=""==global_apps[this.app_id].title?" ":global_apps[this.app_id].title.escape_for_xml()}else div.form_content=global_apps[this.app_id].title,new_url=""==global_apps[this.app_id].title?" ":global_apps[this.app_id].title.escape_for_display();new_url.match(/\:\/\//)||(new_url=" "),30'+this.form_content.escape_for_xml()+""},!0)},insitu_init_page_set_title_div=function(set_id){if(!_ok_for_scrumjax())return!1;var div=insitu_init_generic_title_div(set_id,global_sets);return div.getInput=function(){return''},div.getExtra=function(){return"
    "},!0},insitu_init_page_collection_description_div=function(collection_id,after_func){if(!_ok_for_scrumjax())return!1;var div=insitu_init_generic_description_div(collection_id,global_collections);return div.getInput=function(){return'"},div.after_save_func=after_func,!0},insitu_init_page_collection_title_div=function(collection_id){if(!_ok_for_scrumjax())return!1;var div=insitu_init_generic_title_div(collection_id,global_collections);return div.getInput=function(){return''},div.getExtra=function(){return"
    "},!0},insitu_init_page_photo_description_div=function(photo_id){if(!_ok_for_scrumjax())return!1;var div=insitu_init_generic_description_div(photo_id,global_photos);return div.getInput=function(){return'"},div.getExtra=function(){return"
    "},!0},insitu_init_page_photo_title_div=function(photo_id){if(!_ok_for_scrumjax())return!1;var div=insitu_init_generic_title_div(photo_id,global_photos);return div.getInput=function(){return''},div.getExtra=function(){return"
    "},!0},insitu_init_group_blast_div=function(group_id,blast_date,buddy_icon){if(!_ok_for_scrumjax())return!1;var div=_ge("description_div"+group_id);return div.title=F.output.get("insitu_click_to_edit"),div.hash_id=group_id,div.show_some_html_is_ok=!0,div.blast_date=blast_date,div.buddy_icon=buddy_icon,_ge("div_boing_alert_"+this.hash_id)?div.emptyText=''+F.output.get("insitu_click_to_add_blast")+" ":div.emptyText=''+F.output.get("insitu_click_to_add_blast_spon")+" ",div.form_content=div.innerHTML==div.emptyText||" "==div.innerHTML?"":div.innerHTML,div.blast_date_format=''+blast_date+"",div.change_checker=!1,(div=insitu_init_editable_div(div)).getInput=function(){return'"},div.getExtra=function(){return"
    "},div.flickr_groups_getInfo_onLoad=function(success,responseXML){var this_date=new Date;if(div.blast_date=this_date.flickr_minidate()+" - ",div.blast_date_format=''+div.blast_date+" ",success){if(0'+F.output.get("page_groups_view_admin_says",global_name)+"
    "+div.blast_date_format+div.form_content.trim().nl2br()+"":div.form_content=div.form_content.trim().nl2br(),div.innerHTML=div.form_content,div.style.border="1px solid #e2e2e2",_ge("div_boing_alert_"+this.hash_id)&&personmenu_process_img(_ge("icon_"+global_nsid))):(_ge("description_simple_div"+div.hash_id).innerHTML=div.form_content,_ge("div_boing_alert_"+this.hash_id)?div.form_content=F.output.get("page_groups_view_add_ann"):div.form_content=F.output.get("insitu_click_to_add_blast_spon"),div.innerHTML=""+div.form_content+"",div.style.border="1px solid #f4f4f4",div.style.color="#a3a3a3")},div.flickr_groups_addBlast_onLoad=div.flickr_photosets_getInfo_onLoad=function(success,responseXML){if(success)F.API.callMethod("flickr.groups.getInfo",{group_id:this.hash_id},div);else{div.description=div.form_content=this.new_blast;var errArray=responseXML.documentElement.getElementsByTagName("err");if(errArray&&0'+F.output.get("spam_url_warning")+".

    ";var groupInfo=_ge("group-info");groupInfo&&groupInfo.insertBefore(warnDiv,groupInfo.firstChild),div.startEditing();var textarea=_ge("ta_content_"+global_group_nsid);textarea&&(textarea.innerHTML=this.new_blast)}if(0'+F.output.get("page_groups_view_admin_says",global_name)+"
    "+div.blast_date_format+" - "+div.form_content.trim().nl2br()+"":div.form_content=div.form_content.trim().nl2br(),div.innerHTML=div.form_content,div.style.border="1px solid #e2e2e2",_ge("div_boing_alert_"+this.hash_id)&&personmenu_process_img(_ge("icon_"+global_nsid))}else _ge("description_simple_div"+div.hash_id).innerHTML=div.form_content,div.form_content=F.output.get("page_groups_view_add_ann"),div.innerHTML=div.form_content,div.style.border="1px solid #f4f4f4"}},div.check_changes=function(start_stop){start_stop?(this.change_checker=!0,setTimeout("_ge('description_div"+this.hash_id+"').do_change_checker()",250)):this.change_checker=!1},div.do_change_checker=function(){this.change_checker&&_ge("div_boing_alert_"+this.hash_id)&&(500<_ge("ta_content_"+this.hash_id).value.length?(_ge("div_boing_alert_"+this.hash_id).style.display="block",_ge("blast_save_button")&&(_ge("blast_save_button").disabled=!0,Y.U.Dom.removeClass("blast_save_button",(this.useSmallButts?"Small":"")+"Butt"),Y.U.Dom.addClass("blast_save_button",(this.useSmallButts?"Small":"")+"DisabledButt"))):(_ge("div_boing_alert_"+this.hash_id).style.display="none",_ge("blast_save_button")&&(_ge("blast_save_button").disabled=!1),_ge("blast_save_button")&&(_ge("blast_save_button").disabled=!1,Y.U.Dom.removeClass("blast_save_button",(this.useSmallButts?"Small":"")+"DisabledButt"),Y.U.Dom.addClass("blast_save_button",(this.useSmallButts?"Small":"")+"Butt"))),setTimeout("_ge('description_div"+this.hash_id+"').do_change_checker()",250))},div.saveChanges=function(form){this.new_blast=form.content.value,this.innerHTML=""+F.output.get("insitu_saving")+" ",this.endEditing();var warnDiv=_ge("spam-url-warn-div");warnDiv&&warnDiv.parentNode.removeChild(warnDiv),F.API.callMethod("flickr.groups.addBlast",{group_id:this.hash_id,blast:this.new_blast,user_id:global_nsid},div)},!0},insitu_init_page_photos_user_description_div=function(photo_id,w){if(w=w||240,!_ok_for_scrumjax())return!1;var div=insitu_init_generic_description_div(photo_id,global_photos);return div.getInput=function(){return'"},div.useSmallButts=!0},insitu_init_page_photos_user_title_div=function(photo_id,w){if(w=w||240,!_ok_for_scrumjax())return!1;var div=insitu_init_generic_title_div(photo_id,global_photos);return div.getInput=function(){return''},div.useSmallButts=!0},insitu_init_page_gallery_note_div=function(photo_id){return insitu_init_generic_description_div(photo_id,global_photos).getInput=function(){return'"},!0},insitu_init_page_gallery_description_div=function(gallery_id){return insitu_init_generic_description_div(gallery_id,global_galleries).getInput=function(){return'"},!0},insitu_init_page_gallery_title_div=function(gallery_id){var div=insitu_init_generic_title_div(gallery_id,global_galleries);return div.getInput=function(){return''},div.getExtra=function(){return"
    "},!0},insitu_init_generic_description_div=function(hash_id,hash){if(!_ok_for_scrumjax())return!1;var div=_ge("description_div"+hash_id);return div.title=F.output.get("insitu_click_to_edit"),div.hash_id=hash_id,hash[div.hash_id]?(div.form_content=hash[div.hash_id].description,div.emptyText=""+F.output.get("insitu_click_to_add_description")+" ",div.getExtra=function(){return""},div.flickr_applications_getInfo_onLoad=div.flickr_photos_getInfo_onLoad=div.flickr_collections_getInfo_onLoad=div.flickr_photosets_getInfo_onLoad=div.flickr_galleries_getInfo_onLoad=function(success,responseXML){if(success){if(responseXML.documentElement.getElementsByTagName("description")&&responseXML.documentElement.getElementsByTagName("description")[0]&&responseXML.documentElement.getElementsByTagName("description")[0].firstChild)var description_raw=responseXML.documentElement.getElementsByTagName("description")[0].firstChild.nodeValue;else description_raw="";hash[div.hash_id].description=div.form_content=description_raw;var new_description=""==hash[div.hash_id].description?" ":hash[div.hash_id].description.trim().nl2br();new_description!=div.innerHTML&&(div.innerHTML=new_description+" ")}else div.form_content=hash[div.hash_id].description,div.innerHTML=""==hash[div.hash_id].description?" ":hash[div.hash_id].description.trim().nl2br()+" ";this.after_save_func&&this.after_save_func()},div.flickr_applications_setMeta_onLoad=div.flickr_photos_setMeta_onLoad=div.flickr_collections_editMeta_onLoad=div.flickr_photosets_editMeta_onLoad=div.flickr_galleries_editMeta_onLoad=div.flickr_galleries_editPhoto_onLoad=function(success,responseXML){if(success)if(_ok_for_scrumjax_xml())if(hash==global_sets)F.API.callMethod("flickr.photosets.getInfo",{photoset_id:this.hash_id},div);else if(hash==global_collections)F.API.callMethod("flickr.collections.getInfo",{collection_id:this.hash_id},div);else if(hash==global_apps)F.API.callMethod("flickr.applications.getInfo",{app_id:this.hash_id},div);else if(hash!=global_photos||window.global_galleries){if(window.global_galleries)if(responseXML.documentElement.getElementsByTagName("comment")[0]){if(responseXML.documentElement.getElementsByTagName("comment")[0].firstChild)var description_raw=responseXML.documentElement.getElementsByTagName("comment")[0].firstChild.nodeValue;else description_raw="";hash[div.hash_id].description=div.form_content=description_raw;var new_description=""==hash[div.hash_id].description?" ":hash[div.hash_id].description.trim().nl2br();""!=hash[div.hash_id].description?new_description!=div.innerHTML&&(div.innerHTML=_ge("gl-curator-says").innerHTML+new_description+" "):(writeDebug("Null description"),div.innerHTML=_ge("gl-curator-empty-blurb").innerHTML)}else F.API.callMethod("flickr.galleries.getInfo",{gallery_id:F.galleries.full_gallery_id},div)}else F.API.callMethod("flickr.photos.getInfo",{photo_id:this.hash_id},div);else div.form_content=hash[div.hash_id].description,div.innerHTML=""==hash[div.hash_id].description?" ":hash[div.hash_id].description.trim().nl2br()+" ";else{var errArray=responseXML.documentElement.getElementsByTagName("err");if(errArray&&0'+F.output.get("spam_url_warning")+".

    ";var about=_ge("About");if(about)about.insertBefore(warnDiv,about.firstChild);else{var thumb=Y.D.getElementsByClassName("vsThumbnail","p",div.parentNode);thumb&&0"+F.output.get("insitu_saving")+" ",this.endEditing();var warnDiv=_ge("spam-url-warn-div");if(warnDiv&&warnDiv.parentNode.removeChild(warnDiv),!hash[this.hash_id])return this.innerHTML=F.output.get("insitu_error_no_hash",this.hash_id),!1;hash==global_sets?F.API.callMethod("flickr.photosets.editMeta",{photoset_id:this.hash_id,title:hash[this.hash_id].title,description:hash[this.hash_id].description},div):hash==global_collections?F.API.callMethod("flickr.collections.editMeta",{collection_id:this.hash_id,title:hash[this.hash_id].title,description:hash[this.hash_id].description},div):hash==global_photos?window.global_galleries?F.API.callMethod("flickr.galleries.editPhoto",{gallery_id:F.galleries.full_gallery_id,photo_id:this.hash_id,comment:hash[this.hash_id].description},div):F.API.callMethod("flickr.photos.setMeta",{photo_id:this.hash_id,title:hash[this.hash_id].title,description:hash[this.hash_id].description},div):hash==window.global_galleries?F.API.callMethod("flickr.galleries.editMeta",{gallery_id:F.galleries.full_gallery_id,title:hash[this.hash_id].title,description:hash[this.hash_id].description},div):hash==global_apps?F.API.callMethod("flickr.applications.setMeta",{app_id:this.hash_id,name:hash[this.hash_id].title,description:hash[this.hash_id].description},div):writeDebug(F.output.get("insitu_unknown_hash"))},window.deja_view_should_refresh&&window.deja_view_should_empty_titles_and_descriptions&&(div.innerHTML="..."),insitu_init_editable_div(div)):(writeDebug(F.output.get("insitu_error_no_hash",div.hash_id)),!1)},insitu_init_generic_title_div=function(hash_id,hash){if(!_ok_for_scrumjax())return!1;var div=_ge("title_div"+hash_id);return div.title=F.output.get("insitu_click_to_edit"),div._oldTitle=null,div.hash_id=hash_id,hash[div.hash_id]?(div.form_content=hash[div.hash_id].title,div.emptyText=""+F.output.get("insitu_click_to_add_title")+" ",div.getExtra=function(){return""},div.flickr_applications_getInfo_onLoad=div.flickr_photos_getInfo_onLoad=div.flickr_collections_getInfo_onLoad=div.flickr_photosets_getInfo_onLoad=div.flickr_galleries_getInfo_onLoad=function(success,responseXML){var new_title,new_document_title;if(success){if(responseXML.documentElement.getElementsByTagName("title")[0].firstChild)var title_raw=responseXML.documentElement.getElementsByTagName("title")[0].firstChild.nodeValue;else title_raw="";hash[div.hash_id].title=div.form_content=title_raw,new_title=""==hash[div.hash_id].title?" ":hash[div.hash_id].title.escape_for_xml()}else div.form_content=hash[div.hash_id].title,new_title=""==hash[div.hash_id].title?" ":hash[div.hash_id].title.escape_for_display();new_title!=div.innerHTML&&(div.innerHTML=new_title),new_document_title=" "===new_title?"":new_title," "===div._oldTitle?document.title=new_document_title+document.title:document.title=document.title.replace_global(div._oldTitle,new_document_title)},div.flickr_applications_setMeta_onLoad=div.flickr_photos_setMeta_onLoad=div.flickr_collections_editMeta_onLoad=div.flickr_photosets_editMeta_onLoad=div.flickr_galleries_editMeta_onLoad=function(success,responseXML,responseText){success?_ok_for_scrumjax_xml()?hash==global_sets?F.API.callMethod("flickr.photosets.getInfo",{photoset_id:this.hash_id},div):hash==global_collections?F.API.callMethod("flickr.collections.getInfo",{collection_id:this.hash_id},div):hash==global_photos?F.API.callMethod("flickr.photos.getInfo",{photo_id:this.hash_id},div):hash==global_apps?F.API.callMethod("flickr.applications.getInfo",{app_id:this.hash_id},div):window.global_galleries&&F.API.callMethod("flickr.galleries.getInfo",{gallery_id:F.galleries.full_gallery_id},div):(div.form_content=hash[div.hash_id].title,div.innerHTML=""==hash[div.hash_id].title?" ":hash[div.hash_id].title.escape_for_display()):(hash[div.hash_id].title=div.form_content,div.innerHTML=""==hash[div.hash_id].title?" ":hash[div.hash_id].title.escape_for_display(),alert(F.output.get("insitu_error_title_not_saved",responseText)))},div.saveChanges=function(form){deja_view_uh_huh(),hash[this.hash_id].title=form.content.value,this._oldTitle=this.innerHTML,this.innerHTML=""+F.output.get("insitu_saving")+" ",this.endEditing();var warnDiv=_ge("spam-url-warn-div");if(warnDiv&&warnDiv.parentNode.removeChild(warnDiv),!hash[this.hash_id])return this.innerHTML=F.output.get("insitu_error_no_hash",this.hash_id),!1;hash==global_sets?F.API.callMethod("flickr.photosets.editMeta",{photoset_id:this.hash_id,title:hash[this.hash_id].title,description:hash[this.hash_id].description},div):hash==global_collections?F.API.callMethod("flickr.collections.editMeta",{collection_id:this.hash_id,title:hash[this.hash_id].title,description:hash[this.hash_id].description},div):hash==global_photos?F.API.callMethod("flickr.photos.setMeta",{photo_id:this.hash_id,title:hash[this.hash_id].title,description:hash[this.hash_id].description},div):hash==window.global_galleries?F.API.callMethod("flickr.galleries.editMeta",{gallery_id:F.galleries.full_gallery_id,title:hash[this.hash_id].title,description:hash[this.hash_id].description},div):hash==global_apps?F.API.callMethod("flickr.applications.setMeta",{app_id:this.hash_id,name:hash[this.hash_id].title,description:hash[this.hash_id].description},div):writeDebug(F.output.get("insitu_unknown_hash"))},window.deja_view_should_refresh&&window.deja_view_should_empty_titles_and_descriptions&&(div.innerHTML="..."),insitu_init_editable_div(div)):(writeDebug(F.output.get("insitu_unknown_hash")),!1)},insitu_init_editable_div=function(div){return div.startEditing=function(e){if(!window.should_I_ignore_stuff_because_note_editing&&!window.should_I_ignore_stuff_because_of_button_action){if(e||event){var t=Y.E.getTarget(e||event);if(t&&_el_is_in_a_link(t))return!0}window.should_I_ignore_stuff_because_of_editable_div_action=1;var photo_notes=_ge("photo_notes");photo_notes&&photo_notes.take_her_away&&photo_notes.take_her_away(),this.isEditing=!0,this.unhighlight(),this.style.display="none";var form_div=this.getForm_div();form_div.style.display="block";var form=form_div.firstChild;form.content.focus(),form.content.select(),"function"==typeof this.check_changes&&this.check_changes(!0)}},div.endEditing=function(){window.should_I_ignore_stuff_because_of_editable_div_action=0,this.isEditing=!1;var form_div=this.getForm_div();form_div.innerHTML="",form_div.style.display="none",this.style.display="block","function"==typeof this.check_changes&&(this.check_changes(!1),_ge("div_boing_alert_"+this.hash_id)&&(_ge("div_boing_alert_"+this.hash_id).style.display="none"))},div.onclick=div.startEditing,div.getForm_div=function(){this.form_div||(this.form_div=document.createElement("div"),this.parentNode.insertBefore(this.form_div,this),this.form_div.display_div=this);var formHTML='
    ';formHTML+=this.getInput(),div.show_some_html_is_ok&&(_ge("div_boing_alert_"+this.hash_id)?formHTML+='('+F.output.get("some_tiny_html")+".)":formHTML+='('+F.output.get("some_html")+".)"),formHTML+='
      '+F.output.get("or_up")+'  
    ',formHTML+=this.getExtra(),this.form_div.innerHTML=formHTML;var formInDOM=document.getElementById("insitu_form_"+this.hash_id);formInDOM&&formInDOM.addEventListener("submit",function(e){e.preventDefault(),formInDOM.parentNode.display_div.saveChanges(formInDOM)});var cancelButton=document.getElementById("insitu_cancel_"+this.hash_id);cancelButton&&cancelButton.addEventListener("click",function(e){cancelButton.form.parentNode.display_div.endEditing()});var plain=document.getElementById("insitu_plain_"+this.hash_id);return plain&&plain.addEventListener("click",function(e){e.preventDefault(),window.do_bbml?(_ge("div_boing_alert_"+this.hash_id),F.html_info.show(this)):_ge("div_boing_alert_"+this.hash_id)?window.open("/html.gne?tighten=1","html","status=yes,scrollbars=yes,resizable=yes,width=400,height=480"):window.open("/html.gne?","html","status=yes,scrollbars=yes,resizable=yes,width=400,height=480")}),tab_bumper+=10,this.form_div},div.onmouseover=function(){window.should_I_ignore_stuff_because_note_editing||window.should_I_ignore_stuff_because_of_button_action||this.highlight()},div.onmouseout=function(){this.hideTimer&&clearTimeout(this.hideTimer),this.hideTimer=setTimeout('var el = document.getElementById("'+this.id+'"); if (el) el.unhighlight()',1e3)},div.highlight=function(){this.hideTimer&&clearTimeout(this.hideTimer),div.style.backgroundColor="#ffffd3",!this.emptyText||" "!=div.innerHTML&&" "!=div.innerHTML&&160!=div.innerHTML.charCodeAt(0)||(div.style.color="#888",div.innerHTML=this.emptyText)},div.unhighlight=function(){this.hideTimer&&clearTimeout(this.hideTimer),"function"==typeof this.check_changes?div.style.backgroundColor="#efefef":div.style.backgroundColor="",this.emptyText&&div.innerHTML.toUpperCase()==this.emptyText.toUpperCase()&&(div.innerHTML=" ",div.style.color="#000")},div};function calculateFlashHeight(){var h=_find_screen_height()-Y.U.Dom.getY(_ge("swfdiv"));return h=h>se_min_h?h:se_min_h}function calculateFlashWidth(){var w=_find_screen_width();return w=w>se_min_w?w:se_min_w}function slide_makeItFit(){if(_ge("swfdiv")){"1"!=_qs_args.noresize&&(_ge("swfdiv").style.height=calculateFlashHeight()+"px"),_ge("swfdiv").style.width=calculateFlashWidth()+"px";_find_screen_width(),_find_screen_height()}}F.slideshow=function(params,w,h){var set_id=null==params.set_id?"":params.set_id,tags=null==params.tags?"":params.tags,text=null==params.text?"":params.text,user_id=null==params.user_id?"":params.user_id,favorites=null==params.favorites?"":params.favorites,tag_mode=null==params.tag_mode?"":params.tag_mode,group_id=null==params.group_id?"":params.group_id,contacts=1==params.contacts?"y":"",frifam=1==params.frifam?"y":"",single=1==params.single?"y":"",jump_to=null==params.start_id||"start_id"==params.start_id?"":params.start_id,start_index=null==params.start_index||"start_index"==params.start_index?"":params.start_index,look_for_start_id=null==params.look_for_start_id||"look_for_start_id"==params.look_for_start_id?"":params.look_for_start_id,sort=null==params.sort?"":params.sort,api_method=null==params.api_method?"":params.api_method,api_params_str=null==params.api_params_str?"":params.api_params_str,method_params=null==params.method_params?"":params.method_params,page_show_back_url=null==params.page_show_back_url?"":params.page_show_back_url,page_show_url=null==params.page_show_url?"":params.page_show_url;if(document.getElementById("swfdiv")){var se_fw="100%";w&&(se_fw=w);var se_fh="100%";"1"==_qs_args.noresize&&(se_fh="300"),h&&(se_fh=h),window.se_min_w=100,window.se_max_w=4e3,window.se_min_h=100;var swf_path="/apps/slideshow/show.swf.v"+global_slideShowVersionV3,so=new SWFObject(swf_path,"slideShowMovie",se_fw,se_fh,9,"#000000");so.addParam("allowFullScreen","true"),so.addParam("allowScriptAccess","always"),so.addParam("bgcolor","#000000"),so.addVariable("lang",global_intl_lang),so.addVariable("flickr_notracking","true"),so.addVariable("flickr_target","_self"),so.addVariable("nsid",global_nsid),so.addVariable("textV",global_slideShowTextVersion),so.addVariable("lang",global_intl_lang),so.addVariable("ispro",global_ispro),so.addVariable("magisterLudi",global_magisterLudi),so.addVariable("auth_hash",global_auth_hash),set_id&&so.addVariable("set_id",set_id),text&&so.addVariable("text",escape_utf8(text)),tags&&so.addVariable("tags",escape_utf8(tags)),tag_mode&&so.addVariable("tag_mode",escape(tag_mode)),user_id&&so.addVariable("user_id",user_id),favorites&&so.addVariable("favorites",favorites),group_id&&so.addVariable("group_id",group_id),contacts&&so.addVariable("contacts",contacts),frifam&&so.addVariable("frifam",frifam),single&&so.addVariable("single",single),jump_to&&so.addVariable("jump_to",jump_to),page_show_back_url&&so.addVariable("page_show_back_url",page_show_back_url),page_show_url&&so.addVariable("page_show_url",page_show_url),start_index&&so.addVariable("start_index",start_index),look_for_start_id&&so.addVariable("look_for_start_id",look_for_start_id),sort&&so.addVariable("sort",sort),se_min_h&&so.addVariable("minH",se_min_h),se_min_w&&so.addVariable("minW",se_min_w),api_method&&so.addVariable("method",api_method),api_params_str&&so.addVariable("api_params_str","&"+api_params_str),method_params&&so.addVariable("method_params",method_params),so.write("swfdiv"),document.slideShowMovie&&"function"==typeof document.slideShowMovie.focus&&document.slideShowMovie.focus()}},F.eb_add({window_onload_dom:function(){slide_makeItFit()}}),F.eb_add({window_onresize:function(){slide_makeItFit()}});var JSON=JSON;anim_eqA=["easeInOutBounce","easeOutBounce","easeInBounce","easeInOutBack","easeOutBack","easeInBack","easeInOutElastic","easeOutElastic","easeInElastic","easeOutCirc","easeInOutCirc","easeInCirc","easeInOutExpo","easeOutExpo","easeInExpo","easeInOutSine","easeOutSine","easeInSine","easeInOutQuint","easeOutQuint","easeInQuint","easeInOutQuart","easeOutQuart","easeInQuart","easeOutCubic","easeInCubic","easeInOutQuad","easeOutQuad","easeInQuad","linearTween"],anim_count=0,anim_animate=function(a,f_id){f_id=null==f_id?"anim_seq"+anim_count++:f_id;var t=0,i_id=f_id+"i";return this[f_id]=function(){return this[i_id]&&clearTimeout(this[i_id]),t==a.length?(this[f_id]=null,this[i_id]=null,this.length?(this[f_id]=null,this[i_id]=null):F.is_ie?(this.removeAttribute(f_id),this.removeAttribute(i_id)):(delete this[f_id],delete this[i_id]),void("function"==typeof list_properties&&list_properties(this))):(a[t].unshift(this[f_id]),this[i_id]=anim_step.apply(this,a[t]),t++,this[i_id])},this[f_id]()},anim_step=function(seq_func,d,ms,after_func,after_args,handler){anim_count++;for(var t=0,el=(d=d,this),property_objectsA=(handler=handler,[]),i=6;i'+show_text_className+'Play Video'),_ge("one_photo_img_div").innerHTML=show_text_className,_ge("one_photo_img_div").style.visibility="visible","video"==p.media&&p.video_ready&&F.decorate(_ge("stewart_swf_"+p.id+"one_photo_div"),F._stewart_swf_div).stewart_go_go_go(w,h,{flickr_forceControlSize:"medium",onsite:"true",photo_secret:p.secret,photo_id:p.id},1),_ge("one_photo_link").href=photos_url+p.id,p.date_taken.split(" ")[0].split("-")),taken_month=(+hide_text_className[1]).addZeros(2),show_text_className=(+hide_text_className[2]).addZeros(2),taken_year=+hide_text_className[0],w=taken_month+"/"+show_text_className+"/"+taken_year,h=p.date_taken.split(" ")[1],month_s=(_ge("one_photo_date_taken_exact").value=w,_ge("one_photo_time_taken_exact").value=h,_ge("one_photo_date_taken_approx_month"));if(6==p.date_taken_granularity)month_s.options[0].selected=1;else if(8==p.date_taken_granularity)month_s.options[1].selected=1;else for(i=month_s.options.length-1;-1'+set.title.truncate_with_ellipses(40).escape_for_display()+" ("+set.count.pretty_num()+")"},F._one_photo_edit_pop.pop_generate_group_HTML=function(group){var txt;return null!=group.count?(txt=1!=group.count?F.output.get("one_photo_edit_plural_photos",group.count.pretty_num()):F.output.get("one_photo_edit_single_photo"),_get_group_throttle_txt(group)&&(txt+=' | '+F.output.get("one_photo_edit_limit")+" "+_get_group_throttle_txt(group))):txt=F.output.get("one_photo_edit_no_longer_member"),'
    '+group.name.truncate_with_ellipses(40).escape_for_display()+"
    "+txt+"
    "},F._one_photo_edit_pop.pop_change_license_name=function(){for(var license_name="",license_r=_ge("one_photo_license_form").one_photo_license,i=0;iglobal_tag_limit?F.output.get("too_many_tags",global_tag_limit):err_msg)?(err_msg=""+F.output.get("cant_save")+" "+err_msg,this.pop_start_comming(err_msg,1,1)):(this.rsp_errs=[],this.pop_changed_dates=changed.dates,changed.dates&&exp_rsps++,changed.meta&&exp_rsps++,changed.tags&&exp_rsps++,changed.perms&&exp_rsps++,(changed.geo||changed.geoperms)&&exp_rsps++,changed.license&&exp_rsps++,changed.content_type&&exp_rsps++,changed.safety_level&&exp_rsps++,exp_rsps?(this.pop_start_comming(F.output.get("one_photo_edit_saving")),(err_msg={exp_rsps:exp_rsps,rec_rsps:0,tabl:this}).flickr_photos_setMeta_onLoad=err_msg.flickr_photos_geo_setPerms_onLoad=err_msg.flickr_photos_licenses_setLicense_onLoad=err_msg.flickr_photos_setContentType_onLoad=err_msg.flickr_photos_setSafetyLevel_onLoad=err_msg.flickr_photos_setDates_onLoad=function(success,responseXML,responseText){this.rec_rsps++,success||"116"==responseXML.documentElement.getElementsByTagName("err")[0].getAttribute("code")&&alert(F.output.get("spam_url_warning")+"."),this.rec_rsps==this.exp_rsps&&this.tabl.pop_done_saving(1)},err_msg.flickr_photos_setTags_onLoad=function(success,responseXML,responseText){this.rec_rsps++,success||(success=responseXML.documentElement.getElementsByTagName("err")[0])&&"2"==success.getAttribute("code")&&_ge("one_photo_edit_pop").rsp_errs.push(F.output.get("tags_not_saved",global_tag_limit)),this.rec_rsps==this.exp_rsps&&this.tabl.pop_done_saving(1)},err_msg.flickr_photos_setPerms_onLoad=function(success,responseXML,responseText,params){if(this.rec_rsps++,success){success=global_photos[params.photo_id];if(!success)return;success.is_public=params.is_public,success.is_friend=params.is_friend,success.is_family=params.is_family,success.perm_comment=params.perm_comment,success.perm_addmeta=params.perm_addmeta,F.handle_changed_secret(responseXML)}this.rec_rsps==this.exp_rsps&&this.tabl.pop_done_saving(1)},err_msg.flickr_photos_geo_setLocation_onLoad=function(success,responseXML,responseText,params){if(this.rec_rsps++,success){success=global_photos[params.photo_id];if(!success)return;success.latitude=params.lat,success.longitude=params.lon,success.accuracy=params.accuracy,_ge("map_controller")&&_ge("map_controller").search_and_open_this_photo(params.photo_id)}this.rec_rsps==this.exp_rsps&&this.tabl.pop_done_saving(1)},err_msg.flickr_photos_geo_removeLocation_onLoad=function(success,responseXML,responseText,params){if(this.rec_rsps++,success){success=global_photos[params.photo_id];if(!success)return;success.latitude="0",success.longitude="0",success.accuracy="0",_ge("map_controller")&&_ge("map_controller").search_and_open_this_photo(params.photo_id)}this.rec_rsps==this.exp_rsps&&this.tabl.pop_done_saving(1)},changed.tags&&F.API.callMethod("flickr.photos.setTags",{photo_id:this.pop_photo.id,tags:now.tags},err_msg),changed.meta&&F.API.callMethod("flickr.photos.setMeta",{photo_id:this.pop_photo.id,title:now.title,description:now.description},err_msg),changed.content_type&&global_eighteen&&F.API.callMethod("flickr.photos.setContentType",{photo_id:this.pop_photo.id,content_type:now.content_type+1},err_msg),changed.safety_level&&global_eighteen&&F.API.callMethod("flickr.photos.setSafetyLevel",{photo_id:this.pop_photo.id,safety_level:now.safety_level+1},err_msg),changed.dates&&F.API.callMethod("flickr.photos.setDates",{photo_id:this.pop_photo.id,date_posted:now.dates.date_posted,date_taken:now.dates.date_taken,date_taken_granularity:now.dates.date_taken_granularity},err_msg),changed.geo?now.lat||now.lon?((geo_params={photo_id:this.pop_photo.id,lat:now.lat.convert_geo_value(),lon:now.lon.convert_geo_value(),accuracy:16}).is_public=now.geo_is_public,geo_params.is_friend=now.geo_is_friend,geo_params.is_family=now.geo_is_family,geo_params.is_contact=now.geo_is_contact,F.API.callMethod("flickr.photos.geo.setLocation",geo_params,err_msg)):F.API.callMethod("flickr.photos.geo.removeLocation",{photo_id:this.pop_photo.id},err_msg):changed.geoperms&&F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:this.pop_photo.id,is_public:now.geo_is_public,is_friend:now.geo_is_friend,is_family:now.geo_is_family,is_contact:now.geo_is_contact},err_msg),changed.license&&F.API.callMethod("flickr.photos.licenses.setLicense",{photo_id:this.pop_photo.id,license_id:now.license_id},err_msg),changed.perms&&(geo_params={photo_id:this.pop_photo.id,is_public:now.is_public,is_friend:now.is_friend,is_family:now.is_family,perm_comment:now.perm_comment,perm_addmeta:now.perm_addmeta},F.API.callMethod("flickr.photos.setPerms",geo_params,err_msg))):(writeDebug(F.output.get("one_photo_edit_nothing_saved")),this.pop_done_saving()))},F._one_photo_edit_pop.pop_done_saving=function(really_saved){if(this.pop_were_changes_when_opened||F.changes_were_saved(),this.pop_stop_comming(),really_saved&&this.eb_broadcast("one_photo_on_save",this.pop_photo.id,this.pop_changed_dates),0",i=0;i
    "+this.rsp_errs[i];this.pop_start_comming(msg,1,1)}else _ge("one_photo_goto_next").checked&&this.pop_is_there_a_next?this.pop_go_to_next():this.pop_hide()},F._one_photo_edit_pop.pop_cancel=function(confirm){this.pop_has_changes()&&!confirm?_ge("tabl").tabl_start_comming(F.output.get("unsaved_msg"),1,1,F.output.get("yes_discard"),function(){_ge("one_photo_edit_pop").pop_cancel(1)},1,F.output.get("no_stay_here"),void 0,void 0,void 0,void 0,!0):(this.pop_were_changes_when_opened||F.changes_were_saved(),this.pop_hide())},F._one_photo_edit_pop.pop_revert=function(){this.pop_fill_form(),this.pop_were_changes_when_opened||F.changes_were_saved()},F._one_photo_edit_pop.pop_has_changes=function(){var changed;return!this.pop_loading&&((changed=this.pop_what_changed()).dates||changed.meta||changed.tags||changed.perms||changed.geo||changed.geoperms||changed.license||changed.content_type||changed.safety_level)?1:0},F._one_photo_edit_pop.pop_what_changed=function(){var ob={dates:0,meta:0,tags:0,perms:0,geo:0,geoperms:0,license_id:0,content_type:0,safety_level:0},then=this.pop_form_data_saved,now=this.pop_get_data_from_form();return(ob.now=now).title==then.title&&now.description==then.description||(ob.meta=1),now.content_type!=then.content_type&&(ob.content_type=1),now.safety_level!=then.safety_level&&(ob.safety_level=1),now.tags!=then.tags&&(ob.tags=1),now.dates.date_posted==then.dates.date_posted&&now.dates.date_taken==then.dates.date_taken&&now.dates.date_taken_granularity==then.dates.date_taken_granularity||(ob.dates=1),disable_geo||(now.lat==then.lat&&now.lon==then.lon||(ob.geo=1),now.geo_is_public==then.geo_is_public&&now.geo_is_friend==then.geo_is_friend&&now.geo_is_family==then.geo_is_family&&now.geo_is_contact==then.geo_is_contact)||(ob.geoperms=1),now.license_id!=then.license_id&&(ob.license=1),now.is_private==then.is_private&&now.is_friend==then.is_friend&&now.is_family==then.is_family&&now.perm_comment==then.perm_comment&&now.perm_addmeta==then.perm_addmeta||(ob.perms=1),ob};var test_JS_callback_NAME=function(pType,pItem){writeDebug("test_JS_callback_NAME pType:"+pType+" pItem:"+pItem)};F.stewart_event=function(div_id,pType,pItem){writeDebug("stewart_event div_id:"+div_id+" pType:"+pType+" pItem:"+pItem),_ge(div_id)&&_ge(div_id).stewart_swf_event(pType,pItem)},F.set_hd_cookie=function(likes_hd){1!=likes_hd&&0!=likes_hd||_set_cookie("likes_hd",likes_hd,1e3)},F.get_hd_cookie=function(uncache_random){return writeDebug("getting cookie"+_get_cookie("likes_hd")),_get_cookie("likes_hd")},F.stewart_likes_hd=function(likes_hd){if(1==likes_hd||0==likes_hd){F.set_hd_cookie(likes_hd);var url=document.location.href;url=url.replace(/[\?\&]likes_hd=[01]/,""),url+=-1'),so.write(this.id,extraHTML)&&(F.is_ie&&this.stewart_swap_img_in(),F.is_ie&&(window[this.swf_id]=_ge(this.swf_id)),writeAPIDebug(this.id+" "+_ge(this.id).innerHTML))},stewart_add_form:function(){var this_id=this.id;_ge(this.form_id+"_submit").style.display="none";function activity_func_timed(){var self=_ge(this_id);clearTimeout(self.activity_func_tim),self.activity_func_tim=setTimeout(function(){_ge(this_id).stewart_on_form_activity()},1e3)}function activity_func(){_ge(this_id).stewart_on_form_activity()}yui.Event.addListener(_ge(this.form_id+"_show_info_box_cb"),"click",activity_func),yui.Event.addListener(_ge(this.form_id+"_show_info_box_cb"),"change",activity_func),yui.Event.addListener(_ge(this.form_id+"_w_input"),"change",activity_func),yui.Event.addListener(_ge(this.form_id+"_w_input"),"keyup",activity_func_timed),yui.Event.addListener(_ge(this.form_id+"_w_input"),"keydown",activity_func_timed),yui.Event.addListener(_ge(this.form_id+"_h_input"),"change",activity_func),yui.Event.addListener(_ge(this.form_id+"_h_input"),"keyup",activity_func_timed),yui.Event.addListener(_ge(this.form_id+"_h_input"),"keydown",activity_func_timed),_ge(this.form_id+"_reset_to_suggested_a")&&yui.Event.addListener(_ge(this.form_id+"_reset_to_suggested_a"),"click",function(e){_ge(this_id).stewart_reset_to_suggested_dims(),YAHOO.util.Event.preventDefault(e||window.event)}),_ge(this.form_id+"_reset_to_original_a")&&yui.Event.addListener(_ge(this.form_id+"_reset_to_original_a"),"click",function(e){_ge(this_id).stewart_reset_to_original_dims(),YAHOO.util.Event.preventDefault(e||window.event)}),_ge(this.form_id+"_textarea")&&yui.Event.addListener(_ge(this.form_id+"_textarea"),"click",function(e){_get_event_src(e).select()})},stewart_on_form_activity:function(){clearTimeout(this.activity_func_tim);var w=_ge(this.form_id+"_w_input").value,h=_ge(this.form_id+"_h_input").value;isNaN(w)&&(w=this.w,_ge(this.form_id+"_w_input").value=w),isNaN(h)&&(h=this.h,_ge(this.form_id+"_h_input").value=h);var show_info_box=_ge(this.form_id+"_show_info_box_cb").checked?"true":void 0;w==this.w&&h==this.h&&show_info_box==this.init_ob.flickr_show_info_box||(writeDebug("w:"+w+" this.w:"+this.w),writeDebug("h:"+h+" this.h:"+this.h),h!=this.h?(writeDebug("h changed"),w=Math.round(this.w*(h/this.h)),_ge(this.form_id+"_w_input").value=w):w!=this.w&&(writeDebug("w changed"),h=Math.round(this.h*(w/this.w)),_ge(this.form_id+"_h_input").value=h),writeDebug("w:"+w+" this.w:"+this.w),writeDebug("h:"+h+" this.h:"+this.h),writeDebug("show_info_box:"+show_info_box+" this.init_ob.flickr_show_info_box:"+this.init_ob.flickr_show_info_box),this.w=w,this.h=h,this.init_ob.flickr_show_info_box=show_info_box,this.stewart_write(1),_ge(this.form_id+"_textarea")&&(_ge(this.form_id+"_textarea").value=F.output.get("loading"),this.stewart_load_markup({markup_only:1,id:this.init_ob.photo_id,w:w,h:h,show_info_box:"true"==show_info_box?1:0})))},stewart_load_markup:function(params){F.fragment_getter.get("/photo_embed.gne",params,this,"stewart_markup_loaded")},stewart_markup_loaded:function(success,responseText,params){_ge(this.form_id+"_textarea").value=responseText},stewart_reset_to_suggested_dims:function(){_ge(this.form_id+"_w_input").value=_ge(this.form_id+"_suggested_w").value,_ge(this.form_id+"_h_input").value=_ge(this.form_id+"_suggested_h").value,this.stewart_on_form_activity()},stewart_reset_to_original_dims:function(){_ge(this.form_id+"_w_input").value=_ge(this.form_id+"_original_w").value,_ge(this.form_id+"_h_input").value=_ge(this.form_id+"_original_h").value,this.stewart_on_form_activity()}},YAHOO.util.Event.on(window,"focus",function(){(new Date).getTime();window.video_has_had_focus=1}),F._stewart_poller={start_polling:function(p_id){p_id&&(this.p_id=p_id,this.poll())},poll:function(){setTimeout(function(){F.API.callMethod("flickr.photos.getInfo",{photo_id:F._stewart_poller.p_id},F._stewart_poller)},5e3)},flickr_photos_getInfo_onLoad:function(success,responseXML,responseText){if(success&&responseXML){var photo=responseXML.documentElement.getElementsByTagName("photo")[0],p=_upsert_photo(photo);if(writeAPIDebug(_uber_toString(p)),p.video_ready||p.video_failed)return void(document.location=page_current_url+"?processed=1&cb="+(new Date).getTime())}this.poll()}};var deconcept;void 0===(deconcept=void 0===deconcept?new Object:deconcept).util&&(deconcept.util=new Object),void 0===deconcept.SWFObjectUtil&&(deconcept.SWFObjectUtil=new Object),deconcept._playerVersion=null,deconcept.SWFObject=function(swf,id,w,h,ver,c,q,xir,redirectUrl,detectKey,_base){document.getElementById&&(this.DETECT_KEY=detectKey||"detectflash",this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY),this.params=new Object,this.variables=new Object,this.attributes=new Array,swf&&this.setAttribute("swf",swf),id&&this.setAttribute("id",id),w&&this.setAttribute("width",w),h&&this.setAttribute("height",h),this.setAttribute("base",_base||"."),ver&&this.setAttribute("version",new deconcept.PlayerVersion(ver.toString().split("."))),this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(),!window.opera&&document.all&&7"}else{for(key in this.getAttribute("doExpressInstall")&&(this.addVariable("MMplayerType","ActiveX"),this.setAttribute("swf",this.xiSWFPath)),swfNode='',swfNode+='',swfNode+='',params=this.getParams())swfNode+='';0<(pairs=this.getVariablePairs().join("&")).length&&(swfNode+=''),swfNode+=""}return swfNode=(void 0!==extraHTML?extraHTML:"")+swfNode},write:function(elementId,extraHTML){var expressInstallReqVer;return this.getAttribute("useExpressInstall")&&(expressInstallReqVer=new deconcept.PlayerVersion([6,0,65]),this.installedVer.versionIsValid(expressInstallReqVer)&&!this.installedVer.versionIsValid(this.getAttribute("version"))&&(this.setAttribute("doExpressInstall",!0),this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl"))),document.title=document.title.slice(0,47)+" - Flash Player Installation",this.addVariable("MMdoctitle",document.title))),this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))?(("string"==typeof elementId?document.getElementById(elementId):elementId).innerHTML=this.getSWFHTML(extraHTML),!0):(""!=this.getAttribute("redirectUrl")&&document.location.replace(this.getAttribute("redirectUrl")),!1)}},deconcept.SWFObjectUtil.getPlayerVersion=function(){if(deconcept._playerVersion)return deconcept._playerVersion;var PlayerVersion=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var versionInfo,x=navigator.plugins["Shockwave Flash"];x&&x.description&&(x.description.match(/[a-zA-Z\s]([0-9]+)\.([0-9]+)\s*[rbd]([0-9]+)/),versionInfo=[RegExp.$1,RegExp.$2,RegExp.$3],navigator.platform.match(/win32/i)&&!versionInfo[0]&&(x.description.match(/[a-zA-Z\s]([0-9]+)\.([0-9]+|([0-9]+.[0-9]+.))\s*[rbd]([0-9]+)/),versionInfo=[RegExp.$1,RegExp.$2,RegExp.$3]),PlayerVersion=new deconcept.PlayerVersion(versionInfo))}else if(navigator.userAgent&&0<=navigator.userAgent.indexOf("Windows CE"))for(var axo=1,counter=3;axo;)try{counter++,axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+counter),PlayerVersion=new deconcept.PlayerVersion([counter,0,0])}catch(e){axo=null}else{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),PlayerVersion=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always"}catch(e){if(6==PlayerVersion.major)return PlayerVersion}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}axo&&axo.GetVariable&&(PlayerVersion=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")))}return deconcept._playerVersion=PlayerVersion},deconcept.PlayerVersion=function(arrVersion){this.major=null!=arrVersion[0]?parseInt(arrVersion[0]):0,this.minor=null!=arrVersion[1]?parseInt(arrVersion[1]):0,this.rev=null!=arrVersion[2]?parseInt(arrVersion[2]):0},deconcept.PlayerVersion.prototype.versionIsValid=function(fv){return!(this.majorfv.major||!(this.minorfv.minor||!(this.rev ',!0),fri=user_data.is_friend,fam=user_data.is_family,icon_url=user_data.icon_url;_ge("contactChangerCheckContactLabel").innerHTML=F.output.get("personmenu_contactChanger_addContact"),_ge("contactChangerCheckFriendLabel").innerHTML=F.output.get("personmenu_contactChanger_addFriend"),_ge("contactChangerCheckFamilyLabel").innerHTML=F.output.get("personmenu_contactChanger_addFamily"),contact?(_ge("contactChangerText1").innerHTML=F.output.get("personmenu_contactChangerText1_con",name_trunc),_ge("contactChangerButtonOk").value=F.output.get("ok"),_ge("contactChangerCheckContactLabel").innerHTML=F.output.get("personmenu_contactChanger_keepContact"),fri&&(_ge("contactChangerCheckFriendLabel").innerHTML=F.output.get("personmenu_contactChanger_keepFriend")),fam&&(_ge("contactChangerCheckFamilyLabel").innerHTML=F.output.get("personmenu_contactChanger_keepFamily"))):(_ge("contactChangerText1").innerHTML=F.output.get("personmenu_contactChangerText1_notcon",name_trunc),_ge("contactChangerButtonOk").value=F.output.get("personmenu_contactChangerButtonOk_add"),contact=!0),_ge("contactChangerIcon").src=icon_url,_ge("contactChangerCheckContact").checked=contact,_ge("contactChangerCheckFriend").checked=fri,_ge("contactChangerCheckFamily").checked=fam,_ge("contactChangerButtonOk").style.display="",_ge("contactChangerButtonRemove").style.display="";_ge("contactChangerButtonRemove").addEventListener("click",function(){icon_removeContact(nsid)},!1),_ge("person_hover").hover_go_away(),icon_ccdiv.style.display="block",icon_ccbgdiv.style.display="block",icon_isPopped=!0,icon_positionWindow(),Y.E.on(window,"resize",icon_positionWindow),Y.E.on(window,"scroll",icon_positionWindowOnScroll);var h=_pi(_ge("contactChangerContainer").offsetHeight);return Y.D.setStyle(["contactChangerShadowLeft","contactChangerShadowRight"],"height",h+"px"),F.is_safari||(F.is_ff2||F.is_ff3)&&F.is_mac||F.eb_broadcast("stewart_pause"),!1}function icon_setSubmitButton(el){var contact_checked=_ge("contactChangerCheckContact").checked,friend_checked=_ge("contactChangerCheckFriend").checked,family_checked=_ge("contactChangerCheckFamily").checked;return!(!user_data.is_contact&&!contact_checked)&&("contactChangerCheckContact"!==el.id||contact_checked||(_ge("contactChangerCheckFriend").checked=!1,_ge("contactChangerCheckFamily").checked=!1),("contactChangerCheckFriend"===el.id&&friend_checked||"contactChangerCheckFamily"===el.id&&family_checked)&&!contact_checked&&(contact_checked=_ge("contactChangerCheckContact").checked=!0),user_data.is_contact&&(contact_checked?(_ge("contactChangerButtonOk").style.display="",_ge("contactChangerButtonRemove").style.display=""):(_ge("contactChangerButtonOk").style.display="none",_ge("contactChangerButtonRemove").style.display="inline")),!0)}function icon_positionWindowOnScroll(doIt){0!=icon_doneit&&(icon_doneit=!1,clearTimeout(icon_scrollTim),icon_scrollTim=setTimeout("icon_positionWindowOnScroll(true)",50),doIt&&(icon_doneit=!0,icon_positionWindow()))}function icon_positionWindow(){if(icon_isPopped){if(window.innerWidth)var ww=window.innerWidth,wh=window.innerHeight,bgX=window.pageXOffset,bgY=window.pageYOffset;else ww=document.body.clientWidth,wh=document.body.clientHeight,bgX=document.body.scrollLeft,bgY=document.body.scrollTop;icon_ccdiv.style.left=bgX+(ww-icon_popup_w)/2+"px",icon_ccdiv.style.top=bgY+(wh-icon_popup_h)/2+"px",icon_ccbgdiv.style.left=bgX,icon_ccbgdiv.style.top=bgY}}function icon_windowCloseDone(){icon_ccdiv.style.display="none";user_data.nsid;var fri=_ge("contactChangerCheckFriend").checked,fam=_ge("contactChangerCheckFamily").checked,fri_same=fri==user_data.is_friend,fam_same=fam==user_data.is_family;if(fri_same&&fam_same&&user_data.is_contact)icon_windowClose();else{icon_showProgress(F.output.get("personmenu_working"));var callback={flickr_contacts_edit_onLoad:function(success,responseXML,responseText,params){if(success)user_data&&(user_data.is_contact=!0,user_data.is_friend=fri,user_data.is_family=fam),_ge("person_hover").hover_persons[params.user_id]=null,icon_updateContactTxt(),icon_afterContactChange(user_data),icon_showProgress(F.output.get("personmenu_success")),window.setTimeout("icon_hideProgress(); icon_windowClose();",300);else{var err_code;if(responseXML&&responseXML.documentElement){var err=responseXML.documentElement.getElementsByTagName("err")[0];err&&(err_code=err.getAttribute("code"))}"3"==err_code?(icon_showProgress(F.output.get("personmenu_success")),window.setTimeout("icon_hideProgress(); icon_windowClose();",500)):"4"==err_code?icon_showDialog(F.output.get("too_many_contacts",user_data.name,global_contact_limit)):"106"==err_code?icon_showDialog(F.output.get("too_many_contacts_today")):(icon_showProgress(F.output.get("personmenu_failure")),window.setTimeout("icon_hideProgress(); icon_windowClose();",500))}}};callback.flickr_contacts_add_onLoad=callback.flickr_contacts_edit_onLoad,user_data.is_contact?F.API.callMethod("flickr.contacts.edit",{user_id:user_data.nsid,friend:fri?1:0,family:fam?1:0},callback):F.API.callMethod("flickr.contacts.add",{user_id:user_data.nsid,friend:fri?1:0,family:fam?1:0},callback)}}function icon_updateContactTxt(){var el=_ge("span_user_contact_txt"+user_data.nsid);if(el){var uniqueId=getUniqueId();if(user_data.is_contact){var changeLink=''+F.output.get("personmenu_change")+"?";user_data.is_friend&&user_data.is_family?("M"==user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_ff_m",changeLink)),"F"==user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_ff_f",changeLink)),"M"!=user_data.gender&&"F"!=user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_ff_o",changeLink))):user_data.is_friend?("M"==user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_fri_m",changeLink)),"F"==user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_fri_f",changeLink)),"M"!=user_data.gender&&"F"!=user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_fri_o",changeLink))):user_data.is_family?("M"==user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_fam_m",changeLink)),"F"==user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_fam_f",changeLink)),"M"!=user_data.gender&&"F"!=user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_fam_o",changeLink))):("M"==user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_con_m",changeLink)),"F"==user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_con_f",changeLink)),"M"!=user_data.gender&&"F"!=user_data.gender&&(el.innerHTML=F.output.get("personmenu_updatecontact_con_o",changeLink)))}else"M"==user_data.gender&&(el.innerHTML=''+F.output.get("personmenu_updatecontact_notcon_m")+"?"),"F"==user_data.gender&&(el.innerHTML=''+F.output.get("personmenu_updatecontact_notcon_f")+"?"),"M"!=user_data.gender&&"F"!=user_data.gender&&(el.innerHTML=''+F.output.get("personmenu_updatecontact_notcon_o")+"?");(elem=document.getElementById("relationshipChange"+user_data.nsid+uniqueId))&&elem.addEventListener("click",function(e){e.preventDefault(),icon_windowOpenFromLink(user_data.nsid)},!1)}var el2=_ge("uber_contact_status_"+user_data.nsid);if(el2){Y.D.removeClass(el2,"contact-list-nothingyet"),user_data.is_contact?user_data.is_friend&&user_data.is_family?el2.innerHTML=F.output.get("uber_contact_list_friend_and_family")+(YAHOO.env.ua.ie?" ":""):user_data.is_friend?el2.innerHTML=F.output.get("uber_contact_list_friend")+(YAHOO.env.ua.ie?" ":""):user_data.is_family?el2.innerHTML=F.output.get("uber_contact_list_family")+(YAHOO.env.ua.ie?" ":""):el2.innerHTML=F.output.get("uber_contact_list_contact")+(YAHOO.env.ua.ie?" ":""):el2.innerHTML=''+F.output.get("uber_contact_list_removed")+""+(YAHOO.env.ua.ie?" ":"");var editLink=_ge("uber_contact_status_edit_"+user_data.nsid);editLink&&(editLink.style.display="",editLink.id="")}var el3=_ge("photo_navi_contact_span_"+user_data.nsid);if(el3){var txt,elem,shortName=user_data.name.truncate_with_ellipses(15).escape_for_display(),rel_link="/people/"+user_data.nsid+"/relationship/";uniqueId=getUniqueId();if(user_data.is_contact)txt=user_data.is_friend&&user_data.is_family?F.output.get("rel_link_friend_and_family",shortName):user_data.is_friend?F.output.get("rel_link_friend",shortName):user_data.is_family?F.output.get("rel_link_family",shortName):F.output.get("rel_link_contact",shortName),txt+=' ('+F.output.get("corrections_edit")+")",el3.innerHTML=txt;else el3.innerHTML=''+F.output.get("rel_link_add",shortName)+"";(elem=document.getElementById("editLink"+user_data.nsid+uniqueId))&&elem.addEventListener("click",function(e){e.preventDefault(),icon_windowOpenFromLink(user_data.nsid)},!1)}if(global_users&&global_users[user_data.nsid]){var u=global_users[user_data.nsid];u.friend=user_data.is_friend?"1":"0",u.family=user_data.is_family?"1":"0",user_data.is_contact||(u.removed="1")}}function icon_afterContactChange(user){for(var n=0,len=icon_after_contact_change_funcs.length;n'+F.output.get("personmenu_change")+"";switch(!0){case this.is_blocked:return F.output.get("personmenu_are_blocking",this.name);case this.is_friend&&this.is_family:return F.output.get("personmenu_is_ff",this.name,changeLink);case this.is_friend:return F.output.get("personmenu_is_fri",this.name,changeLink);case this.is_family:return F.output.get("personmenu_is_fam",this.name,changeLink);case this.is_contact:return F.output.get("personmenu_is_con",this.name,changeLink);default:return null}},getReverseRelationshipHTML:function(){switch(!0){case this.is_rev_friend&&this.isRefFamily:return F.output.get("personmenu_as_ff",this.name);case this.is_rev_friend:return F.output.get("personmenu_as_fri",this.name);case this.isRefFamily:return F.output.get("personmenu_as_fam",this.name);case this.is_rev_contact:return F.output.get("personmenu_as_con",this.name);default:return null}}},F._personmenu_button_bar={bar_go_go_go:function(){F.decorate(_ge("personmenu_down_button"),F._personmenu_button).button_go_go_go()}},F._personmenu_button={_decotype:F._simple_button,button_always_swap_img:0,button_img_root:"personmenu_down_",button_img_ext:"gif",button_go_go_go:function(){F.preload_images(_images_root+"/personmenu_down_default.gif",_images_root+"/personmenu_down_hover.gif",_images_root+"/personmenu_down_selected.gif");var menu=this.button_get_menu();this.iframe=iframeify(menu);for(var items=menu.getElementsByTagName("A"),i=0;i_find_screen_width()&&(x=_find_screen_width()-menu.offsetWidth),y+=this.height,menu.style.top=y+"px",menu.style.left=x+"px",this.iframe&&(this.iframe.style.width=menu.offsetWidth+"px",this.iframe.style.height=menu.offsetHeight+"px"),menu.style.visibility="visible"}};/* YUI 3.11.0 (build d549e5c) Copyright 2013 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)):h&&h.getElementById(o)&&!YUI.Env.cssStampEl&&(YUI.Env.cssStampEl=h.getElementById(o)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(){var e,t=this,n=[],r=YUI.Env.mods,i=t.config.core||[].concat(YUI.Env.core);for(e=0;e-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;ii&&i in t?t[i]:!0);return n},m.indexOf=p._isNative(d.indexOf)?function(e,t,n){return d.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n1?Array.prototype.join.call(arguments,y):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e-1},E.each=function(t,n,r,i){var s;for(s in t)(i||N(t,s))&&n.call(r||e,t[s],s,t);return e},E.some=function(t,n,r,i){var s;for(s in t)if(i||N(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},E.getValue=function(t,n){if(!p.isObject(t))return w;var r,i=e.Array(n),s=i.length;for(r=0;t!==w&&r=0){for(i=0;u!==w&&i0),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);oi)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],"attribute-events":["attribute-observable"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],axes:["axis-numeric","axis-category","axis-time","axis-stacked"],"axes-base":["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],charts:["charts-base"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],color:["color-base","color-hsl","color-harmony"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],template:["template-base","template-micro"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.11.0",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0||n.ie>=10,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18 ),preservesScriptOrder:!!(n.gecko||n.opera||n.ie&&n.ie>=10)}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._reqsWaiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout)),t._reqsWaiting=n.length;for(i=0,s=n.length;i=10?(o.onerror=function(){setTimeout(c,0)},o.onload=function(){setTimeout(h,0)}):(o.onerror=c,o.onload=h),!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._reqsWaiting-=1,this._next()}}},"3.11.0",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"json-parse-shim",test:function(e){function i(e,t){return e==="ok"?!0:t}var t=e.config.global.JSON,n=Object.prototype.toString.call(t)==="[object JSON]"&&t,r=e.config.useNativeJSONParse!==!1&&!!n;if(r)try{r=n.parse('{"ok":false}',i).ok}catch(s){r=!1}return!r},trigger:"json-parse"}),r("load","15",{name:"json-stringify-shim",test:function(e){var t=e.config.global.JSON,n=Object.prototype.toString.call(t)==="[object JSON]"&&t,r=e.config.useNativeJSONStringify!==!1&&!!n;if(r)try{r="0"===n.stringify(0)}catch(i){r=!1}return!r},trigger:"json-stringify"}),r("load","16",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","17",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","18",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"}),r("load","19",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),r("load","20",{name:"yql-jsonp",test:function(e){return!e.UA.nodejs&&!e.UA.winjs},trigger:"yql",when:"after"}),r("load","21",{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}),r("load","22",{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"})},"3.11.0",{requires:["yui-base"]}),YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.11.0",{requires:["yui-base"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:2,warn:4,error:8};n.log=function(e,t,o,u){var a,f,l,c,h,p,d=n,v=d.config,m=d.fire?d:YUI.Env.globalEvents;return v.debug&&(o=o||"",typeof o!="undefined"&&(f=v.logExclude,l=v.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1,d.config.logLevel=d.config.logLevel||"debug",p=s[d.config.logLevel.toLowerCase()],t in s&&s[t]-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n,r,i,s;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null,s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var e=this,t,n,r,i,s;for(s in e.moduleInfo)e.moduleInfo.hasOwnProperty(s)&&(t=e.moduleInfo[s],t.type&&t.type===u&&e.isCSSLoaded(t.name)&&(e.loaded[s]=!0));for(s in w)w.hasOwnProperty(s)&&(t=w[s],t.details&&(n=e.moduleInfo[t.name],r=t.details.requires,i=n&&n.requires,n?!n._inspected&&r&&i.length!==r.length&&delete n.expanded:n=e.addModule(t.details,s),n._inspected=!0))},_requires:function(e,t){var n,r,i,s,o=this.moduleInfo,a=o[e],f=o[t];if(!a||!f)return!1;r=a.expanded_map,i=a.after_map;if(i&&t in i)return!0;i=f.after_map;if(i&&e in i)return!1;s=o[t]&&o[t].supersedes;if(s)for(n=0;n-1&&(k=n);if(C&&(C[c]||k&&C[k])){L=c,C[k]&&(L=k);for(n=0;n-1},getModule:function(t){if(!t)return null;var n,r,i,s=this.moduleInfo[t],o=this.patterns;if(!s||s&&s.ext)for(i in o)if(o.hasOwnProperty(i)){n=o[i],n.test||(n.test=this._patternTest);if(n.test(t,i)){r=n;break}}return s?r&&s&&r.configFn&&!s.configFn&&(s.configFn=r.configFn,s.configFn(s)):r&&(n.action?n.action.call(this,t,i):(s=this.addModule(e.merge(r),t),r.configFn&&(s.configFn=r.configFn),s.temp=!0)),s},_rollup:function(){},_reduce:function(e){e=e||this.required;var t,n,r,i,s=this.loadType,o=this.ignore?v.hash(this.ignore):!1;for(t in e)if(e.hasOwnProperty(t)){i=this.getModule(t),((this.loaded[t]||w[t])&&!this.forceMap[t]&&!this.ignoreRegistered||s&&i&&i.type!==s)&&delete e[t],o&&o[t]&&delete e[t],r=i&&i.supersedes;if(r)for(n=0;n0&&(m.running=!0,m.next()())},insert:function(t,n,r){var i=this,s=e.merge(this);delete s.require,delete s.dirty,m.add(function(){i._insert(s,t,n,r)}),this._continue()},loadNext:function(){return},_filter:function(e,t,n){var r=this.filter,i=t&&t in this.filters,s=i&&this.filters[t],o=n||(this.moduleInfo[t]?this.moduleInfo[t].group:null);return o&&this.groups[o]&&this.groups[o].filter&&(s=this.groups[o].filter,i=!0),e&&(i&&(r=b.isString(s)?this.FILTER_DEFS[s.toUpperCase()]||null:s),r&&(e=e.replace(new RegExp(r.searchExp,"g"),r.replaceStr))),e},_url:function(e,t,n){return this._filter((n||this.base||"")+e,t)},resolve:function(e,t){var r,s,o,f,c,h,p,d,v,m,g,y,w,E,S=[],x,T,N={},C=this,k,A,O=C.ignoreRegistered?{}:C.inserted,M={js:[],jsMods:[],css:[],cssMods:[]},_=C.loadType||"js",D;(C.skin.overrides||C.skin.defaultSkin!==l||C.ignoreRegistered)&&C._resetModules(),e&&C.calculate(),t=t||C.sorted,D=function(e){if(e){c=e.group&&C.groups[e.group]||n,c.async===!1&&(e.async=c.async),f=e.fullpath?C._filter(e.fullpath,t[s]):C._url(e.path,t[s],c.base||e.base);if(e.attributes||e.async===!1)f={url:f,async:e.async},e.attributes&&(f.attributes=e.attributes);M[e.type].push(f),M[e.type+"Mods"].push(e)}},r=t.length,y=C.comboBase,f=y,m={};for(s=0;sA){S=[];for(t=0;tA&&(o=S.pop(),x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)),S=[],o&&S.push(o));S.length&&(x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)))}else M[_].push(C._filter(x,null,N[w].group));M[_+"Mods"]=M[_+"Mods"].concat(g)}}return N=null,M},load:function(e){if(!e)return;var t=this,n=t.resolve(!0);t.data=n,t.onEnd=function(){e.apply(t.context||t,arguments)},t.insert()}}},"3.11.0",{requires:["get","features"]}),YUI.add("loader-rollup",function(e,t){e.Loader.prototype._rollup=function(){var e,t,n,r,i=this.required,s,o=this.moduleInfo,u,a,f;if(this.dirty||!this.rollups){this.rollups={};for(e in o)o.hasOwnProperty(e)&&(n=this.getModule(e),n&&n.rollup&&(this.rollups[e]=n))}for(;;){u=!1;for(e in this.rollups)if(this.rollups.hasOwnProperty(e)&&!i[e]&&(!this.loaded[e]||this.forceMap[e])){n=this.getModule(e),r=n.supersedes||[],s=!1;if(!n.rollup)continue;a=0;for(t=0;t=n.rollup;if(s)break}}s&&(i[e]=!0,u=!0,this.getRequires(n))}if(!u)break}}},"3.11.0",{requires:["loader-base"]}),YUI.add("loader-yui3",function(e,t){YUI.Env[e.version].modules=YUI.Env[e.version].modules||{},e.mix(YUI.Env[e.version].modules,{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-observable","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{use:["attribute-observable"]},"attribute-extras":{requires:["oop"]},"attribute-observable":{requires:["event-custom"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters" :{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en","es","hu","it"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},axes:{use:["axis-numeric","axis-category","axis-time","axis-stacked"]},"axes-base":{use:["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"]},axis:{requires:["dom","widget","widget-position","widget-stack","graphics","axis-base"]},"axis-base":{requires:["classnamemanager","datatype-number","datatype-date","base","event-custom"]},"axis-category":{requires:["axis","axis-category-base"]},"axis-category-base":{requires:["axis-base"]},"axis-numeric":{requires:["axis","axis-numeric-base"]},"axis-numeric-base":{requires:["axis-base"]},"axis-stacked":{requires:["axis-numeric","axis-stacked-base"]},"axis-stacked-base":{requires:["axis-numeric-base"]},"axis-time":{requires:["axis","axis-time-base"]},"axis-time-base":{requires:["axis-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{requires:["attribute-base","base-core","base-observable"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-observable":{requires:["attribute-observable"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","es","es-AR","fr","hu","it","ja","nb-NO","nl","pt-BR","ru","zh-HANT-TW"],requires:["widget","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node"],skinnable:!0},charts:{use:["charts-base"]},"charts-base":{requires:["dom","event-mouseenter","event-touch","graphics-group","axes","series-pie","series-line","series-marker","series-area","series-spline","series-column","series-bar","series-areaspline","series-combo","series-combospline","series-line-stacked","series-marker-stacked","series-area-stacked","series-spline-stacked","series-column-stacked","series-bar-stacked","series-areaspline-stacked","series-combo-stacked","series-combospline-stacked"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},color:{use:["color-base","color-hsl","color-harmony"]},"color-base":{requires:["yui-base"]},"color-harmony":{requires:["color-hsl"]},"color-hsl":{requires:["color-base"]},"color-hsv":{requires:["color-base"]},console:{lang:["en","es","hu","it","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssnormalize"],type:"css"},"cssgrids-base":{optional:["cssnormalize"],type:"css"},"cssgrids-responsive":{optional:["cssnormalize"],requires:["cssgrids","cssgrids-responsive-base"],type:"css"},"cssgrids-units":{optional:["cssnormalize"],requires:["cssgrids-base"],type:"css"},cssnormalize:{type:"css"},"cssnormalize-context":{type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core" ,"datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-foot":{requires:["datatable-core","view"]},"datatable-formatters":{requires:["datatable-body","datatype-number-format","datatype-date-format","escape"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en","fr","es","hu","it"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-paginator":{lang:["en"],requires:["model","view","paginator-core","datatable-foot","datatable-paginator-templates"],skinnable:!0},"datatable-paginator-templates":{requires:["template"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-sort":{lang:["en","fr","es","hu"],requires:["datatable-base"],skinnable:!0},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","hu","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es","hu"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base","color-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter" :{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}},"graphics-group":{requires:["graphics"]},"graphics-svg":{condition:{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:[]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-parse-shim":{condition:{name:"json-parse-shim",test:function(e){function i(e,t){return e==="ok"?!0:t}var t=e.config.global.JSON,n=Object.prototype.toString.call(t)==="[object JSON]"&&t,r=e.config.useNativeJSONParse!==!1&&!!n;if(r)try{r=n.parse('{"ok":false}',i).ok}catch(s){r=!1}return!r},trigger:"json-parse"},requires:["json-parse"]},"json-stringify":{requires:["yui-base"]},"json-stringify-shim":{condition:{name:"json-stringify-shim",test:function(e){var t=e.config.global.JSON,n=Object.prototype.toString.call(t)==="[object JSON]"&&t,r=e.config.useNativeJSONStringify!==!1&&!!n;if(r)try{r="0"===n.stringify(0)}catch(i){r=!1}return!r},trigger:"json-stringify"},requires:["json-stringify"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core" ,"dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["array-extras","base-build","event-resize","node-pluginhost","plugin","selector"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},paginator:{requires:["paginator-core"]},"paginator-core":{requires:["base"]},"paginator-url":{requires:["paginator"]},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},promise:{requires:["timers"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"series-area":{requires:["series-cartesian","series-fill-util"]},"series-area-stacked":{requires:["series-stacked","series-area"]},"series-areaspline":{requires:["series-area","series-curve-util"]},"series-areaspline-stacked":{requires:["series-stacked","series-areaspline"]},"series-bar":{requires:["series-marker","series-histogram-base"]},"series-bar-stacked":{requires:["series-stacked","series-bar"]},"series-base":{requires:["graphics","axis-base"]},"series-candlestick":{requires:["series-range"]},"series-cartesian":{requires:["series-base"]},"series-column":{requires:["series-marker","series-histogram-base"]},"series-column-stacked":{requires:["series-stacked","series-column"]},"series-combo":{requires:["series-cartesian","series-line-util","series-plot-util","series-fill-util"]},"series-combo-stacked":{requires:["series-stacked","series-combo"]},"series-combospline":{requires:["series-combo","series-curve-util"]},"series-combospline-stacked":{requires:["series-combo-stacked","series-curve-util"]},"series-curve-util":{},"series-fill-util":{},"series-histogram-base":{requires:["series-cartesian","series-plot-util"]},"series-line":{requires:["series-cartesian","series-line-util"]},"series-line-stacked":{requires:["series-stacked","series-line"]},"series-line-util":{},"series-marker":{requires:["series-cartesian","series-plot-util"]},"series-marker-stacked":{requires:["series-stacked","series-marker"]},"series-ohlc":{requires:["series-range"]},"series-pie":{requires:["series-base","series-plot-util"]},"series-plot-util":{},"series-range":{requires:["series-cartesian"]},"series-spline":{requires:["series-line","series-curve-util"]},"series-spline-stacked":{requires:["series-stacked","series-spline"]},"series-stacked":{requires:["axis-stacked"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy" ]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager"]},"tabview-plugin":{requires:["tabview-base"]},template:{use:["template-base","template-micro"]},"template-base":{requires:["yui-base"]},"template-micro":{requires:["escape"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},timers:{requires:["yui-base"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"},requires:["transition"]},tree:{requires:["base-build","tree-node"]},"tree-labelable":{requires:["tree"]},"tree-lazy":{requires:["base-pluginhost","plugin","tree"]},"tree-node":{},"tree-openable":{requires:["tree"]},"tree-selectable":{requires:["tree"]},"tree-sortable":{requires:["tree"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-flash":{requires:["swf","widget","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["oop"]},"yql-jsonp":{condition:{name:"yql-jsonp",test:function(e){return!e.UA.nodejs&&!e.UA.winjs},trigger:"yql",when:"after"},requires:["jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"}},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}}),YUI.Env[e.version].md5="b48f48e0499b41d980deaefd4100d336"},"3.11.0",{requires:["loader-base"]}),YUI.add("yui",function(e,t){},"3.11.0",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]});