/*
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 <a href="YAHOO.env.html#getVersion">
 * YAHOO.env.getVersion</a> 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
 * <pre>
 * YAHOO.namespace("property.package");
 * YAHOO.namespace("YAHOO.property.package");
 * </pre>
 * 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:
 * <pre>
 * YAHOO.namespace("really.long.nested.namespace");
 * </pre>
 * This fails because "long" is a future reserved word in ECMAScript
 *
 * @method namespace
 * @static
 * @param  {String*} arguments 1-n namespaces to create 
 * @return {Object}  A reference to the last namespace object created
 */
YAHOO.namespace = function() {
    var a=arguments, o=null, i, j, d;
    for (i=0; i<a.length; i=i+1) {
        d=a[i].split(".");
        o=YAHOO;

        // YAHOO is implied, so it is ignored if it is included
        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; j=j+1) {
            o[d[j]]=o[d[j]] || {};
            o=o[d[j]];
        }
    }

    return o;
};

/**
 * Uses YAHOO.widget.Logger to output a log message, if the widget is
 * available.
 *
 * @method log
 * @static
 * @param  {String}  msg  The message to log.
 * @param  {String}  cat  The log category for the message.  Default
 *                        categories are "info", "warn", "error", time".
 *                        Custom categories can be used as well. (opt)
 * @param  {String}  src  The source of the the message (opt)
 * @return {Boolean}      True if the log operation was successful.
 */
YAHOO.log = function(msg, cat, src) {
    var l=YAHOO.widget.Logger;
    if(l && l.log) {
        return l.log(msg, cat, src);
    } else {
        return false;
    }
};

/**
 * Registers a module with the YAHOO object
 * @method register
 * @static
 * @param {String}   name    the name of the module (event, slider, etc)
 * @param {Function} mainClass a reference to class in the module.  This
 *                             class will be tagged with the version info
 *                             so that it will be possible to identify the
 *                             version that is in use when multiple versions
 *                             have loaded
 * @param {Object}   data      metadata object for the module.  Currently it
 *                             is expected to contain a "version" property
 *                             and a "build" property at minimum.
 */
YAHOO.register = function(name, mainClass, data) {
    var mods = YAHOO.env.modules;
    if (!mods[name]) {
        mods[name] = { versions:[], builds:[] };
    }
    var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;
    m.name = name;
    m.version = v;
    m.build = b;
    m.versions.push(v);
    m.builds.push(b);
    m.mainClass = mainClass;
    // fire the module load listeners
    for (var i=0;i<ls.length;i=i+1) {
        ls[i](m);
    }
    // label the main class
    if (mainClass) {
        mainClass.VERSION = v;
        mainClass.BUILD = b;
    } else {
        YAHOO.log("mainClass is undefined for module " + name, "warn");
    }
};

/**
 * YAHOO.env is used to keep track of what is known about the YUI library and
 * the browsing environment
 * @class YAHOO.env
 * @static
 */
YAHOO.env = YAHOO.env || {

    /**
     * Keeps the version info for all YUI modules that have reported themselves
     * @property modules
     * @type Object[]
     */
    modules: [],
    
    /**
     * List of functions that should be executed every time a YUI module
     * reports itself.
     * @property listeners
     * @type Function[]
     */
    listeners: []
};

/**
 * Returns the version data for the specified module:
 *      <dl>
 *      <dt>name:</dt>      <dd>The name of the module</dd>
 *      <dt>version:</dt>   <dd>The version in use</dd>
 *      <dt>build:</dt>     <dd>The build number in use</dd>
 *      <dt>versions:</dt>  <dd>All versions that were registered</dd>
 *      <dt>builds:</dt>    <dd>All builds that were registered.</dd>
 *      <dt>mainClass:</dt> <dd>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.</dd>
 *       </dl>
 *
 * @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
         * <pre>
         * 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
         * </pre>
         * @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
         * <pre>
         * 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.
         *                                   
         * </pre>
         * 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<ls.length;i=i+1) {
                if (ls[i]==l) {
                    unique=false;
                    break;
                }
            }
            if (unique) {
                ls.push(l);
            }
        }
    }
})();
/**
 * Provides the language utilites and extensions used by the library
 * @class YAHOO.lang
 */
YAHOO.lang = YAHOO.lang || {
    /**
     * Determines whether or not the provided object is an array.
     * Testing typeof/instanceof/constructor of arrays across frame 
     * boundaries isn't possible in Safari unless you have a reference
     * to the other frame to test against its Array prototype.  To
     * handle this case, we test well-known array properties instead.
     * properties.
     * @method isArray
     * @param {any} o The object being testing
     * @return {boolean} the result
     */
    isArray: function(o) { 
        if (o) {
           var l = YAHOO.lang;
           return l.isNumber(o.length) && l.isFunction(o.splice);
        }
        return false;
    },

    /**
     * Determines whether or not the provided object is a boolean
     * @method isBoolean
     * @param {any} o The object being testing
     * @return {boolean} the result
     */
    isBoolean: function(o) {
        return typeof o === 'boolean';
    },
    
    /**
     * Determines whether or not the provided object is a function
     * @method isFunction
     * @param {any} o The object being testing
     * @return {boolean} the result
     */
    isFunction: function(o) {
        return typeof o === 'function';
    },
        
    /**
     * Determines whether or not the provided object is null
     * @method isNull
     * @param {any} o The object being testing
     * @return {boolean} the result
     */
    isNull: function(o) {
        return o === null;
    },
        
    /**
     * Determines whether or not the provided object is a legal number
     * @method isNumber
     * @param {any} o The object being testing
     * @return {boolean} the result
     */
    isNumber: function(o) {
        return typeof o === 'number' && isFinite(o);
    },
      
    /**
     * Determines whether or not the provided object is of type object
     * or function
     * @method isObject
     * @param {any} o The object being testing
     * @return {boolean} the result
     */  
    isObject: function(o) {
return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
    },
        
    /**
     * Determines whether or not the provided object is a string
     * @method isString
     * @param {any} o The object being testing
     * @return {boolean} the result
     */
    isString: function(o) {
        return typeof o === 'string';
    },
        
    /**
     * Determines whether or not the provided object is undefined
     * @method isUndefined
     * @param {any} o The object being testing
     * @return {boolean} the result
     */
    isUndefined: function(o) {
        return typeof o === 'undefined';
    },
    
    /**
     * Determines whether or not the property was added
     * to the object instance.  Returns false if the property is not present
     * in the object, or was inherited from the prototype.
     * This abstraction is provided to enable hasOwnProperty for Safari 1.3.x.
     * There is a discrepancy between YAHOO.lang.hasOwnProperty and
     * Object.prototype.hasOwnProperty when the property is a primitive added to
     * both the instance AND prototype with the same value:
     * <pre>
     * var A = function() {};
     * A.prototype.foo = 'foo';
     * var a = new A();
     * a.foo = 'foo';
     * alert(a.hasOwnProperty('foo')); // true
     * alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
     * </pre>
     * @method hasOwnProperty
     * @param {any} o The object being testing
     * @return {boolean} 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<add.length;i=i+1) {
                var fname=add[i],f=s[fname];
                if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
                    r[fname]=f;
                }
            }
        }
    },
       
    /**
     * Utility to set up the prototype, constructor and superclass properties to
     * support an inheritance strategy that can chain constructors and methods.
     * Static members will not be inherited.
     *
     * @method extend
     * @static
     * @param {Function} subc   the object to modify
     * @param {Function} superc the object to inherit
     * @param {Object} overrides  additional properties/methods to add to the
     *                              subclass prototype.  These will override the
     *                              matching items obtained from the superclass 
     *                              if present.
     */
    extend: function(subc, superc, overrides) {
        if (!superc||!subc) {
            throw new Error("YAHOO.lang.extend failed, please check that " +
                            "all dependencies are included.");
        }
        var F = function() {};
        F.prototype=superc.prototype;
        subc.prototype=new F();
        subc.prototype.constructor=subc;
        subc.superclass=superc.prototype;
        if (superc.prototype.constructor == Object.prototype.constructor) {
            superc.prototype.constructor=superc;
        }
    
        if (overrides) {
            for (var i in overrides) {
                subc.prototype[i]=overrides[i];
            }

            YAHOO.lang._IEEnumFix(subc.prototype, overrides);
        }
    },
   
    /**
     * Applies all properties in the supplier to the receiver if the
     * receiver does not have these properties yet.  Optionally, one or 
     * more methods/properties can be specified (as additional 
     * parameters).  This option will overwrite the property if receiver 
     * has it already.  If true is passed as the third parameter, all 
     * properties will be applied and _will_ overwrite properties in 
     * the receiver.
     *
     * @method augmentObject
     * @static
     * @since 2.3.0
     * @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
     */
    augmentObject: function(r, s) {
        if (!s||!r) {
            throw new Error("Absorb failed, verify dependencies.");
        }
        var a=arguments, i, p, override=a[2];
        if (override && override!==true) { // only absorb the specified properties
            for (i=2; i<a.length; i=i+1) {
                r[a[i]] = s[a[i]];
            }
        } else { // take everything, overwriting only if the third parameter is true
            for (p in s) { 
                if (override || !r[p]) {
                    r[p] = s[p];
                }
            }
            
            YAHOO.lang._IEEnumFix(r, s);
        }
    },
 
    /**
     * Same as YAHOO.lang.augmentObject, except it only applies prototype properties
     * @see YAHOO.lang.augmentObject
     * @method augmentProto
     * @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
     */
    augmentProto: function(r, s) {
        if (!s||!r) {
            throw new Error("Augment failed, verify dependencies.");
        }
        //var a=[].concat(arguments);
        var a=[r.prototype,s.prototype];
        for (var i=2;i<arguments.length;i=i+1) {
            a.push(arguments[i]);
        }
        YAHOO.lang.augmentObject.apply(this, a);
    },

      
    /**
     * Returns a simple string representation of the object or array.
     * Other types of objects will be returned unprocessed.  Arrays
     * are expected to be indexed.  Use object notation for
     * associative arrays.
     * @method dump
     * @since 2.3.0
     * @param o {Object} The object to dump
     * @param d {int} How deep to recurse child objects, default 3
     * @return {String} the dump result
     */
    dump: function(o, d) {
        var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
            COMMA=', ', ARROW=' => ';

        // Cast non-objects to string
        // Skip dates because the std toString is what we want
        // Skip HTMLElement-like objects because trying to dump 
        // an element will cause an unhandled exception in FF 2.x
        if (!l.isObject(o)) {
            return o + "";
        } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
            return o;
        } else if  (l.isFunction(o)) {
            return FUN;
        }

        // dig into child objects the depth specifed. Default 3
        d = (l.isNumber(d)) ? d : 3;

        // arrays [1, 2, 3]
        if (l.isArray(o)) {
            s.push("[");
            for (i=0,len=o.length;i<len;i=i+1) {
                if (l.isObject(o[i])) {
                    s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
                } 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; i<l; i=i+1) {
            YAHOO.lang.augmentObject(o, a[i], true);
        }
        return o;
    },

    /**
     * Executes the supplied function in the context of the supplied 
     * object 'when' milliseconds later.  Executes the function a 
     * single time unless periodic is set to true.
     * @method later
     * @since 2.4.0
     * @param when {int} the number of milliseconds to wait until the fn 
     * is executed
     * @param o the context object
     * @param fn {Function|String} the function to execute or the name of 
     * the method in the 'o' object to execute
     * @param data [Array] data that is provided to the function.  This accepts
     * either a single item or an array.  If an array is provided, the
     * function is executed with one parameter for each array item.  If
     * you need to pass a single array parameter, it needs to be wrapped in
     * an array [myarray]
     * @param periodic {boolean} if true, executes continuously at supplied 
     * interval until canceled
     * @return a timer object. Call the cancel() method on this object to 
     * stop the timer.
     */
    later: function(when, o, fn, data, periodic) {
        when = when || 0; 
        o = o || {};
        var m=fn, d=data, f, r;

        if (YAHOO.lang.isString(fn)) {
            m = o[fn];
        }

        if (!m) {
            throw new TypeError("method undefined");
        }

        if (!YAHOO.lang.isArray(d)) {
            d = [data];
        }

        f = function() {
            m.apply(o, d);
        };

        r = (periodic) ? setInterval(f, when) : setTimeout(f, when);

        return {
            interval: periodic,
            cancel: function() {
                if (this.interval) {
                    clearInterval(r);
                } else {
                    clearTimeout(r);
                }
            }
        };
    },
    
    /**
     * A convenience method for detecting a legitimate non-null value.
     * Returns false for null/undefined/NaN, true for other values, 
     * including 0/false/''
     * @method isValue
     * @since 2.3.0
     * @param o {any} the item to test
     * @return {boolean} true if it is not null/undefined/NaN || false
     */
    isValue: function(o) {
        // return (o || o === false || o === 0 || o === ''); // Infinity fails
        var l = YAHOO.lang;
return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
    }

};

/*
 * An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
 * @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 <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
 * @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 <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
 * @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.  
     * <ul>
     * <li>YAHOO.util.CustomEvent.LIST: 
     *   <ul>
     *   <li>param1: event name</li>
     *   <li>param2: array of arguments sent to fire</li>
     *   <li>param3: <optional> a custom object supplied by the subscriber</li>
     *   </ul>
     * </li>
     * <li>YAHOO.util.CustomEvent.FLAT
     *   <ul>
     *   <li>param1: the first argument passed to fire.  If you need to
     *           pass multiple parameters, use and array or object literal</li>
     *   <li>param2: <optional> a custom object supplied by the subscriber</li>
     *   </ul>
     * </li>
     * </ul>
     *   @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<len; ++i) {
            var s = this.subscribers[i];
            if (s && s.contains(fn, obj)) {
                this._delete(i);
                found = true;
            }
        }

        return found;
    },

    /**
     * Notifies the subscribers.  The callback functions will be executed
     * from the scope specified when the event was created, and with the 
     * following parameters:
     *   <ul>
     *   <li>The type of event</li>
     *   <li>All of the arguments fire() was executed with as an array</li>
     *   <li>The custom object (if any) that was passed into the subscribe() 
     *       method</li>
     *   </ul>
     * @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<len; ++i) {
            var s = subs[i];
            if (!s) {
                rebuild=true;
            } else {
                if (!this.silent) {
                }

                var scope = s.getScope(this.scope);

                if (this.signature == YAHOO.util.CustomEvent.FLAT) {
                    var param = null;
                    if (args.length > 0) {
                        param = args[0];
                    }

                    try {
                        ret = s.fn.call(scope, param, s.obj);
                    } catch(e) {
                        this.lastError = e;
                    }
                } else {
                    try {
                        ret = s.fn.call(scope, this.type, args, s.obj);
                    } catch(ex) {
                        this.lastError = ex;
                    }
                }
                if (false === ret) {
                    if (!this.silent) {
                    }

                    //break;
                    return false;
                }
            }
        }

        
        // if (rebuild) {
        //     var newlist=this.,subs=this.subscribers;
        //     for (i=0,len=subs.length; i<len; i=i+1) {
        //         // this wasn't doing anything before
        //         newlist.push(subs[i]);
        //     }
        //     this.subscribers=newlist;
        // }

        return true;
    },

    /**
     * Removes all listeners
     * @method unsubscribeAll
     * @return {int} The number of listeners unsubscribed
     */
    unsubscribeAll: function() {
        for (var i=this.subscribers.length-1; 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.
             *
             * <p>The callback is executed with a single parameter:
             * the custom object parameter, if provided.</p>
             *
             * @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; i<a.length; i=i+1) {
                    onAvailStack.push({id:         a[i], 
                                       fn:         p_fn, 
                                       obj:        p_obj, 
                                       override:   p_override, 
                                       checkReady: checkContent });
                }

                retryCount = this.POLL_RETRYS;

                this.startInterval();
            },

            /**
             * Works the same way as onAvailable, but additionally checks the
             * state of sibling elements to determine if the content of the
             * available element is safe to modify.
             *
             * <p>The callback is executed with a single parameter:
             * the custom object parameter, if provided.</p>
             *
             * @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?
             *
             * <p>The callback is a CustomEvent, so the signature is:</p>
             * <p>type &lt;string&gt;, args &lt;array&gt;, customobject &lt;object&gt;</p>
             * <p>For DOMReady events, there are no fire argments, so the
             * signature is:</p>
             * <p>"DOMReady", [], obj</p>
             *
             *
             * @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<len; ++i) {
                        ok = this.on(el[i], 
                                       sType, 
                                       fn, 
                                       obj, 
                                       override) && ok;
                    }
                    return ok;

                } else if (YAHOO.lang.isString(el)) {
                    var oEl = this.getEl(el);
                    // If the el argument is a string, we assume it is 
                    // actually the id of the element.  If the page is loaded
                    // we convert el to the actual element, otherwise we 
                    // defer attaching the event until onload event fires

                    // check to see if we need to delay hooking up the event 
                    // until after the page loads.
                    if (oEl) {
                        el = oEl;
                    } else {
                        // defer adding the event until the element is available
                        this.onAvailable(el, function() {
                           YAHOO.util.Event.on(el, sType, fn, obj, override);
                        });

                        return true;
                    }
                }

                // Element should be an html element or an array if we get 
                // here.
                if (!el) {
                    return false;
                }

                // we need to make sure we fire registered unload events 
                // prior to automatically unhooking them.  So we hang on to 
                // these instead of attaching them to the window and fire the
                // handles explicitly during our one unload event.
                if ("unload" == sType && obj !== this) {
                    unloadListeners[unloadListeners.length] =
                            [el, sType, fn, obj, override];
                    return true;
                }


                // if the user chooses to override the scope, we use the custom
                // object passed in, otherwise the executing scope will be the
                // HTML element that the event is registered on
                var scope = el;
                if (override) {
                    if (override === true) {
                        scope = obj;
                    } else {
                        scope = override;
                    }
                }

                // wrap the function so we can return the obj object when
                // the event fires;
                var wrappedFn = function(e) {
                        return fn.call(scope, YAHOO.util.Event.getEvent(e, el), 
                                obj);
                    };

                var li = [el, sType, fn, wrappedFn, scope, obj, override];
                var index = listeners.length;
                // cache the listener so we can try to automatically unload
                listeners[index] = li;

                if (this.useLegacyEvent(el, sType)) {
                    var legacyIndex = this.getLegacyIndex(el, sType);

                    // Add a new dom0 wrapper if one is not detected for this
                    // element
                    if ( legacyIndex == -1 || 
                                el != legacyEvents[legacyIndex][0] ) {

                        legacyIndex = legacyEvents.length;
                        legacyMap[el.id + sType] = legacyIndex;

                        // cache the signature for the DOM0 event, and 
                        // include the existing handler for the event, if any
                        legacyEvents[legacyIndex] = 
                            [el, sType, el["on" + sType]];
                        legacyHandlers[legacyIndex] = [];

                        el["on" + sType] = 
                            function(e) {
                                YAHOO.util.Event.fireLegacyEvent(
                                    YAHOO.util.Event.getEvent(e), legacyIndex);
                            };
                    }

                    // add a reference to the wrapped listener to our custom
                    // stack of events
                    //legacyHandlers[legacyIndex].push(index);
                    legacyHandlers[legacyIndex].push(li);

                } else {
                    try {
                        this._simpleAdd(el, sType, wrappedFn, false);
                    } catch(ex) {
                        // handle an error trying to attach an event.  If it fails
                        // we need to clean up the cache
                        this.lastError = ex;
                        this.removeListener(el, sType, fn);
                        return false;
                    }
                }

                return true;
                
            },

            /**
             * When using legacy events, the handler is routed to this object
             * so we can fire our custom listener stack.
             * @method fireLegacyEvent
             * @static
             * @private
             */
            fireLegacyEvent: function(e, legacyIndex) {
                var ok=true, le, lh, li, scope, ret;
                
                lh = legacyHandlers[legacyIndex].slice();
                for (var i=0, len=lh.length; i<len; ++i) {
                // for (var i in lh.length) {
                    li = lh[i];
                    if ( li && li[this.WFN] ) {
                        scope = li[this.ADJ_SCOPE];
                        ret = li[this.WFN].call(scope, e);
                        ok = (ok && ret);
                    }
                }

                // Fire the original handler if we replaced one.  We fire this
                // after the other events to keep stopPropagation/preventDefault
                // that happened in the DOM0 handler from touching our DOM2
                // substitute
                le = legacyEvents[legacyIndex];
                if (le && le[2]) {
                    le[2](e);
                }
                
                return ok;
            },

            /**
             * Returns the legacy event index that matches the supplied 
             * signature
             * @method getLegacyIndex
             * @static
             * @private
             */
            getLegacyIndex: function(el, sType) {
                var key = this.generateId(el) + sType;
                if (typeof legacyMap[key] == "undefined") { 
                    return -1;
                } else {
                    return legacyMap[key];
                }
            },

            /**
             * Logic that determines when we should automatically use legacy
             * events instead of DOM2 events.  Currently this is limited to old
             * Safari browsers with a broken preventDefault
             * @method useLegacyEvent
             * @static
             * @private
             */
            useLegacyEvent: function(el, sType) {
                if (this.webkit && ("click"==sType || "dblclick"==sType)) {
                    var v = parseInt(this.webkit, 10);
                    if (!isNaN(v) && v<418) {
                        return true;
                    }
                }
                return false;
            },
                    
            /**
             * Removes an event listener
             *
             * @method removeListener
             *
             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
             *  reference, or a collection of ids and/or elements to remove
             *  the listener from.
             * @param {String} sType the type of event to remove.
             * @param {Function} fn the method the event invokes.  If fn is
             *  undefined, then all event handlers for the type of event are 
             *  removed.
             * @return {boolean} true if the unbind was successful, false 
             *  otherwise.
             * @static
             */
            removeListener: function(el, sType, fn) {
                var i, len, li;

                // The el argument can be a string
                if (typeof el == "string") {
                    el = this.getEl(el);
                // The el argument can be an array of elements or element ids.
                } else if ( this._isValidCollection(el)) {
                    var ok = true;
                    for (i=el.length-1; 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<len; ++i) {
                        // for (i in llist.length) {
                            li = llist[i];
                            if (li && 
                                li[this.EL] == el && 
                                li[this.TYPE] == sType && 
                                li[this.FN] == fn) {
                                    llist.splice(i, 1);
                                    // llist[i]=null;
                                    break;
                            }
                        }
                    }

                } else {
                    try {
                        this._simpleRemove(el, sType, cacheItem[this.WFN], false);
                    } catch(ex) {
                        this.lastError = ex;
                        return false;
                    }
                }

                // removed the wrapped handler
                delete listeners[index][this.WFN];
                delete listeners[index][this.FN];
                listeners.splice(index, 1);
                // listeners[index]=null;

                return true;

            },

            /**
             * Returns the event's target element.  Safari sometimes provides
             * a text node, and this is automatically resolved to the text
             * node's parent so that it behaves like other browsers.
             * @method getTarget
             * @param {Event} ev the event
             * @param {boolean} resolveTextNode when set to true the target's
             *                  parent will be returned if the target is a 
             *                  text node.  @deprecated, the text node is
             *                  now resolved automatically
             * @return {HTMLElement} the event's target
             * @static
             */
            getTarget: function(ev, resolveTextNode) {
                var t = ev.target || ev.srcElement;
                return this.resolveTextNode(t);
            },

            /**
             * In some cases, some browsers will return a text node inside
             * the actual element that was targeted.  This normalizes the
             * return value for getTarget and getRelatedTarget.
             * @method resolveTextNode
             * @param {HTMLElement} node node to resolve
             * @return {HTMLElement} the normized node
             * @static
             */
            resolveTextNode: function(n) {
                try {
                    if (n && 3 == n.nodeType) {
                        return n.parentNode;
                    }
                } catch(e) { }

                return n;
            },

            /**
             * Returns the event's pageX
             * @method getPageX
             * @param {Event} ev the event
             * @return {int} the event's pageX
             * @static
             */
            getPageX: function(ev) {
                var x = ev.pageX;
                if (!x && 0 !== x) {
                    x = ev.clientX || 0;

                    if ( this.isIE ) {
                        x += this._getScrollLeft();
                    }
                }

                return x;
            },

            /**
             * Returns the event's pageY
             * @method getPageY
             * @param {Event} ev the event
             * @return {int} the event's pageY
             * @static
             */
            getPageY: function(ev) {
                var y = ev.pageY;
                if (!y && 0 !== y) {
                    y = ev.clientY || 0;

                    if ( this.isIE ) {
                        y += this._getScrollTop();
                    }
                }


                return y;
            },

            /**
             * Returns the pageX and pageY properties as an indexed array.
             * @method getXY
             * @param {Event} ev the event
             * @return {[x, y]} the pageX and pageY properties of the event
             * @static
             */
            getXY: function(ev) {
                return [this.getPageX(ev), this.getPageY(ev)];
            },

            /**
             * Returns the event's related target 
             * @method getRelatedTarget
             * @param {Event} ev the event
             * @return {HTMLElement} the event's relatedTarget
             * @static
             */
            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 this.resolveTextNode(t);
            },

            /**
             * Returns the time of the event.  If the time is not included, the
             * event is modified using the current time.
             * @method getTime
             * @param {Event} ev the event
             * @return {Date} the time of the event
             * @static
             */
            getTime: function(ev) {
                if (!ev.time) {
                    var t = new Date().getTime();
                    try {
                        ev.time = t;
                    } catch(ex) { 
                        this.lastError = ex;
                        return t;
                    }
                }

                return ev.time;
            },

            /**
             * Convenience method for stopPropagation + preventDefault
             * @method stopEvent
             * @param {Event} ev the event
             * @static
             */
            stopEvent: function(ev) {
                this.stopPropagation(ev);
                this.preventDefault(ev);
            },

            /**
             * Stops event propagation
             * @method stopPropagation
             * @param {Event} ev the event
             * @static
             */
            stopPropagation: function(ev) {
                if (ev.stopPropagation) {
                    ev.stopPropagation();
                } else {
                    ev.cancelBubble = true;
                }
            },

            /**
             * Prevents the default behavior of the event
             * @method preventDefault
             * @param {Event} ev the event
             * @static
             */
            preventDefault: function(ev) {
                if (ev.preventDefault) {
                    ev.preventDefault();
                } else {
                    ev.returnValue = false;
                }
            },
             
            /**
             * Finds the event in the window object, the caller's arguments, or
             * in the arguments of another method in the callstack.  This is
             * executed automatically for events registered through the event
             * manager, so the implementer should not normally need to execute
             * this function at all.
             * @method getEvent
             * @param {Event} e the event parameter from the handler
             * @param {HTMLElement} boundEl the element the listener is attached to
             * @return {Event} the event 
             * @static
             */
            getEvent: function(e, boundEl) {
                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;
            },

            /**
             * Returns the charcode for an event
             * @method getCharCode
             * @param {Event} ev the event
             * @return {int} the event's charCode
             * @static
             */
            getCharCode: function(ev) {
                var code = ev.keyCode || ev.charCode || 0;

                // webkit key normalization
                if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
                    code = webkitKeymap[code];
                }
                return code;
            },

            /**
             * Locating the saved event handler data by function ref
             *
             * @method _getCacheIndex
             * @static
             * @private
             */
            _getCacheIndex: function(el, sType, fn) {
                for (var i=0, l=listeners.length; i<l; i=i+1) {
                    var li = listeners[i];
                    if ( li                 && 
                         li[this.FN] == fn  && 
                         li[this.EL] == el  && 
                         li[this.TYPE] == sType ) {
                        return i;
                    }
                }

                return -1;
            },

            /**
             * Generates an unique ID for the element if it does not already 
             * have one.
             * @method generateId
             * @param el the element to create the id for
             * @return {string} the resulting id of the element
             * @static
             */
            generateId: function(el) {
                var id = el.id;

                if (!id) {
                    id = "yuievtautoid-" + counter;
                    ++counter;
                    el.id = id;
                }

                return id;
            },


            /**
             * We want to be able to use getElementsByTagName as a collection
             * to attach a group of events to.  Unfortunately, different 
             * browsers return different types of collections.  This function
             * tests to determine if the object is array-like.  It will also 
             * fail if the object is an array, but is empty.
             * @method _isValidCollection
             * @param o the object to test
             * @return {boolean} true if the object is array-like and populated
             * @static
             * @private
             */
            _isValidCollection: function(o) {
                try {
                    return ( o                     && // o is something
                             typeof o !== "string" && // o is not a string
                             o.length              && // o is indexed
                             !o.tagName            && // o is not an HTML element
                             !o.alert              && // o is not a window
                             typeof o[0] !== "undefined" );
                } catch(ex) {
                    return false;
                }

            },

            /**
             * @private
             * @property elCache
             * DOM element cache
             * @static
             * @deprecated Elements are not cached due to issues that arise when
             * elements are removed and re-added
             */
            elCache: {},

            /**
             * We cache elements bound by id because when the unload event 
             * fires, we can no longer use document.getElementById
             * @method getEl
             * @static
             * @private
             * @deprecated Elements are not cached any longer
             */
            getEl: function(id) {
                return (typeof id === "string") ? document.getElementById(id) : id;
            },

            /**
             * Clears the element cache
             * @deprecated Elements are not cached any longer
             * @method clearCache
             * @static
             * @private
             */
            clearCache: function() { },

            /**
             * Custom event the fires when the dom is initially usable
             * @event DOMReadyEvent
             */
            DOMReadyEvent: new YAHOO.util.CustomEvent("DOMReady", this),

            /**
             * hook up any deferred listeners
             * @method _load
             * @static
             * @private
             */
            _load: function(e) {

                if (!loadComplete) {
                    loadComplete = true;
                    var EU = YAHOO.util.Event;

                    // Just in case DOMReady did not go off for some reason
                    EU._ready();

                    // Available elements may not have been detected before the
                    // window load event fires. Try to find them now so that the
                    // the user is more likely to get the onAvailable notifications
                    // before the window load notification
                    EU._tryPreloadAttach();

                }
            },

            /**
             * Fires the DOMReady event listeners the first time the document is
             * usable.
             * @method _ready
             * @static
             * @private
             */
            _ready: function(e) {
                var EU = YAHOO.util.Event;
                if (!EU.DOMReady) {
                    EU.DOMReady=true;

                    // Fire the content ready custom event
                    EU.DOMReadyEvent.fire();

                    // Remove the DOMContentLoaded (FF/Opera)
                    EU._simpleRemove(document, "DOMContentLoaded", EU._ready);
                }
            },

            /**
             * Polling function that runs before the onload event fires, 
             * attempting to attach to DOM Nodes as soon as they are 
             * available
             * @method _tryPreloadAttach
             * @static
             * @private
             */
            _tryPreloadAttach: function() {

                if (onAvailStack.length === 0) {
                    retryCount = 0;
                    clearInterval(this._interval);
                    this._interval = null;
                    return;
                }

                if (this.locked) {
                    return;
                }

                if (this.isIE) {
                    // Hold off if DOMReady has not fired and check current
                    // readyState to protect against the IE operation aborted
                    // issue.
                    if (!this.DOMReady) {
                        this.startInterval();
                        return;
                    }
                }

                this.locked = true;


                // keep trying until after the page is loaded.  We need to 
                // check the page load state prior to trying to bind the 
                // elements so that we can be certain all elements have been 
                // tested appropriately
                var tryAgain = !loadComplete;
                if (!tryAgain) {
                    tryAgain = (retryCount > 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<len; i=i+1) {
                    item = onAvailStack[i];
                    if (item) {
                        el = this.getEl(item.id);
                        if (el) {
                            if (item.checkReady) {
                                if (loadComplete || el.nextSibling || !tryAgain) {
                                    ready.push(item);
                                    onAvailStack[i] = null;
                                }
                            } else {
                                executeItem(el, item);
                                onAvailStack[i] = null;
                            }
                        } else {
                            notAvail.push(item);
                        }
                    }
                }
                
                // make sure onContentReady fires after onAvailable
                for (i=0, len=ready.length; i<len; i=i+1) {
                    item = ready[i];
                    executeItem(this.getEl(item.id), item);
                }


                retryCount--;

                if (tryAgain) {
                    for (i=onAvailStack.length-1; i>-1; i--) {
                        item = onAvailStack[i];
                        if (!item || !item.id) {
                            onAvailStack.splice(i, 1);
                        }
                    }

                    this.startInterval();
                } else {
                    clearInterval(this._interval);
                    this._interval = null;
                }

                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<len ; ++i) {
                        this.purgeElement(oEl.childNodes[i], recurse, sType);
                    }
                }
            },

            /**
             * Returns all listeners attached to the given element via addListener.
             * Optionally, you can specify a specific type of event to return.
             * @method getListeners
             * @param el {HTMLElement|string} the element or element id to inspect 
             * @param sType {string} optional type of listener to return. If
             * left out, all listeners will be returned
             * @return {Object} the listener. Contains the following fields:
             * &nbsp;&nbsp;type:   (string)   the type of event
             * &nbsp;&nbsp;fn:     (function) the callback supplied to addListener
             * &nbsp;&nbsp;obj:    (object)   the custom object supplied to addListener
             * &nbsp;&nbsp;adjust: (boolean|object)  whether or not to adjust the default scope
             * &nbsp;&nbsp;scope: (boolean)  the derived scope based on the adjust parameter
             * &nbsp;&nbsp;index:  (int)      its position in the Event util listener cache
             * @static
             */           
            getListeners: function(el, sType) {
                var results=[], searchLists;
                if (!sType) {
                    searchLists = [listeners, unloadListeners];
                } else if (sType === "unload") {
                    searchLists = [unloadListeners];
                } else {
                    searchLists = [listeners];
                }

                var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;

                for (var j=0;j<searchLists.length; j=j+1) {
                    var searchList = searchLists[j];
                    if (searchList) {
                        for (var i=0,len=searchList.length; i<len ; ++i) {
                            var l = searchList[i];
                            if ( l  && l[this.EL] === oEl && 
                                    (!sType || sType === l[this.TYPE]) ) {
                                results.push({
                                    type:   l[this.TYPE],
                                    fn:     l[this.FN],
                                    obj:    l[this.OBJ],
                                    adjust: l[this.OVERRIDE],
                                    scope:  l[this.ADJ_SCOPE],
                                    index:  i
                                });
                            }
                        }
                    }
                }

                return (results.length) ? results : null;
            },

            /**
             * Removes all listeners registered by pe.event.  Called 
             * automatically during the unload event.
             * @method _unload
             * @static
             * @private
             */
            _unload: function(e) {

                var EU = YAHOO.util.Event, i, j, l, len, index,
                         ul = unloadListeners.slice();

                // execute and clear stored unload listeners
                for (i=0,len=unloadListeners.length; i<len; ++i) {
                    l = ul[i];
                    if (l) {
                        var scope = window;
                        if (l[EU.ADJ_SCOPE]) {
                            if (l[EU.ADJ_SCOPE] === true) {
                                scope = l[EU.UNLOAD_OBJ];
                            } else {
                                scope = l[EU.ADJ_SCOPE];
                            }
                        }
                        l[EU.FN].call(scope, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
                        ul[i] = null;
                        l=null;
                        scope=null;
                    }
                }

                unloadListeners = null;

                // Remove listeners to handle IE memory leaks
                //if (YAHOO.env.ua.ie && listeners && listeners.length > 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:
     *
     *  <ul>
     *    <li>
     *      scope: defines the default execution scope.  If not defined
     *      the default scope will be this instance.
     *    </li>
     *    <li>
     *      silent: if true, the custom event will not generate log messages.
     *      This is false by default.
     *    </li>
     *    <li>
     *      onSubscribeCallback: specifies a callback to execute when the
     *      event has a new subscriber.  This will fire immediately for
     *      each queued subscriber if any exist prior to the creation of
     *      the event.
     *    </li>
     *  </ul>
     *
     *  @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<qs.length; ++i) {
                    ce.subscribe(qs[i].fn, qs[i].obj, qs[i].override);
                }
            }
        }

        return events[p_type];
    },


   /**
     * Fire a custom event by name.  The callback functions will be executed
     * from the scope specified when the event was created, and with the 
     * following parameters:
     *   <ul>
     *   <li>The first argument fire() was executed with</li>
     *   <li>The custom object (if any) that was passed into the subscribe() 
     *       method</li>
     *   </ul>
     * If the custom event has not been explicitly created, it will be
     * created now with the default config, scoped to the host object
     * @method fireEvent
     * @param p_type    {string}  the type, or name of the event
     * @param arguments {Object*} an arbitrary set of parameters to pass to 
     *                            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<arguments.length; ++i) {
            args.push(arguments[i]);
        }
        return ce.fire.apply(ce, args);
    },

    /**
     * Returns true if the custom event of the provided type has been created
     * with createEvent.
     * @method hasEvent
     * @param type {string} the type, or name of the event
     */
    hasEvent: function(type) {
        if (this.__yui_events) {
            if (this.__yui_events[type]) {
                return true;
            }
        }
        return false;
    }

};

/**
* KeyListener is a utility that provides an easy interface for listening for
* keydown/keyup events fired against DOM elements.
* @namespace YAHOO.util
* @class KeyListener
* @constructor
* @param {HTMLElement} attachTo The element or element ID to which the key 
*                               event should be attached
* @param {String}      attachTo The element or element ID to which the key
*                               event should be attached
* @param {Object}      keyData  The object literal representing the key(s) 
*                               to detect. Possible attributes are 
*                               shift(boolean), alt(boolean), ctrl(boolean) 
*                               and keys(either an int or an array of ints 
*                               representing keycodes).
* @param {Function}    handler  The CustomEvent handler to fire when the 
*                               key event is detected
* @param {Object}      handler  An object literal representing the handler. 
* @param {String}      event    Optional. The event (keydown or keyup) to 
*                               listen for. Defaults automatically to keydown.
*
* @knownissue the "keypress" event is completely broken in Safari 2.x and below.
*             the workaround is use "keydown" for key listening.  However, if
*             it is desired to prevent the default behavior of the keystroke,
*             that can only be done on the keypress event.  This makes key
*             handling quite ugly.
* @knownissue keydown is also broken in Safari 2.x and below for the ESC key.
*             There currently is no workaround other than choosing another
*             key to listen for.
*/
YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
    if (!attachTo) {
    } else if (!keyData) {
    } else if (!handler) {
    } 
    
    if (!event) {
        event = YAHOO.util.KeyListener.KEYDOWN;
    }

    /**
    * The CustomEvent fired internally when a key is pressed
    * @event keyEvent
    * @private
    * @param {Object} keyData The object literal representing the key(s) to 
    *                         detect. Possible attributes are shift(boolean), 
    *                         alt(boolean), ctrl(boolean) and keys(either an 
    *                         int or an array of ints representing keycodes).
    */
    var keyEvent = new YAHOO.util.CustomEvent("keyPressed");
    
    /**
    * The CustomEvent fired when the KeyListener is enabled via the enable() 
    * function
    * @event enabledEvent
    * @param {Object} keyData The object literal representing the key(s) to 
    *                         detect. Possible attributes are shift(boolean), 
    *                         alt(boolean), ctrl(boolean) and keys(either an 
    *                         int or an array of ints representing keycodes).
    */
    this.enabledEvent = new YAHOO.util.CustomEvent("enabled");

    /**
    * The CustomEvent fired when the KeyListener is disabled via the 
    * disable() function
    * @event disabledEvent
    * @param {Object} keyData The object literal representing the key(s) to 
    *                         detect. Possible attributes are shift(boolean), 
    *                         alt(boolean), ctrl(boolean) and keys(either an 
    *                         int or an array of ints representing keycodes).
    */
    this.disabledEvent = new YAHOO.util.CustomEvent("disabled");

    if (typeof attachTo == 'string') {
        attachTo = document.getElementById(attachTo);
    }

    if (typeof handler == 'function') {
        keyEvent.subscribe(handler);
    } else {
        keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
    }

    /**
    * Handles the key event when a key is pressed.
    * @method handleKeyPress
    * @param {DOMEvent} e   The keypress DOM event
    * @param {Object}   obj The DOM event scope object
    * @private
    */
    function handleKeyPress(e, obj) {
        if (! keyData.shift) {  
            keyData.shift = false; 
        }
        if (! keyData.alt) {    
            keyData.alt = false;
        }
        if (! keyData.ctrl) {
            keyData.ctrl = false;
        }

        // check held down modifying keys first
        if (e.shiftKey == keyData.shift && 
            e.altKey   == keyData.alt &&
            e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
            
            var dataItem;

            if (keyData.keys instanceof Array) {
                for (var i=0;i<keyData.keys.length;i++) {
                    dataItem = keyData.keys[i];

                    if (dataItem == e.charCode ) {
                        keyEvent.fire(e.charCode, e);
                        break;
                    } else if (dataItem == e.keyCode) {
                        keyEvent.fire(e.keyCode, e);
                        break;
                    }
                }
            } else {
                dataItem = keyData.keys;
                if (dataItem == e.charCode ) {
                    keyEvent.fire(e.charCode, e);
                } else if (dataItem == e.keyCode) {
                    keyEvent.fire(e.keyCode, e);
                }
            }
        }
    }

    /**
    * Enables the KeyListener by attaching the DOM event listeners to the 
    * target DOM element
    * @method enable
    */
    this.enable = function() {
        if (! this.enabled) {
            YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);
            this.enabledEvent.fire(keyData);
        }
        /**
        * Boolean indicating the enabled/disabled state of the Tooltip
        * @property enabled
        * @type Boolean
        */
        this.enabled = true;
    };

    /**
    * Disables the KeyListener by removing the DOM event listeners from the 
    * target DOM element
    * @method disable
    */
    this.disable = function() {
        if (this.enabled) {
            YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);
            this.disabledEvent.fire(keyData);
        }
        this.enabled = false;
    };

    /**
    * Returns a String representation of the object.
    * @method toString
    * @return {String}  The string representation of the KeyListener
    */ 
    this.toString = function() {
        return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + 
                (attachTo.id ? "[" + attachTo.id + "]" : "");
    };

};

/**
* Constant representing the DOM "keydown" event.
* @property YAHOO.util.KeyListener.KEYDOWN
* @static
* @final
* @type String
*/
YAHOO.util.KeyListener.KEYDOWN = "keydown";

/**
* Constant representing the DOM "keyup" event.
* @property YAHOO.util.KeyListener.KEYUP
* @static
* @final
* @type String
*/
YAHOO.util.KeyListener.KEYUP = "keyup";

/**
 * keycode constants for a subset of the special keys
 * @property KEY
 * @static
 * @final
 */
YAHOO.util.KeyListener.KEY = {
    ALT          : 18,
    BACK_SPACE   : 8,
    CAPS_LOCK    : 20,
    CONTROL      : 17,
    DELETE       : 46,
    DOWN         : 40,
    END          : 35,
    ENTER        : 13,
    ESCAPE       : 27,
    HOME         : 36,
    LEFT         : 37,
    META         : 224,
    NUM_LOCK     : 144,
    PAGE_DOWN    : 34,
    PAGE_UP      : 33, 
    PAUSE        : 19,
    PRINTSCREEN  : 44,
    RIGHT        : 39,
    SCROLL_LOCK  : 145,
    SHIFT        : 16,
    SPACE        : 32,
    TAB          : 9,
    UP           : 38
};
YAHOO.register("event", YAHOO.util.Event, {version: "2.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 dom module provides helper methods for manipulating Dom elements.
 * @module dom
 *
 */

(function() {
    var Y = YAHOO.util,     // internal shorthand
        getStyle,           // for load time browser branching
        setStyle,           // ditto
        propertyCache = {}, // for faster hyphen converts
        reClassNameCache = {},          // cache regexes for className
        document = window.document;     // cache for faster lookups

    YAHOO.env._id_counter = YAHOO.env._id_counter || 0;     // for use with generateId (global to save state if Dom is overwritten)

    // brower detection
    var isOpera = YAHOO.env.ua.opera,
        isSafari = YAHOO.env.ua.webkit,
        isGecko = YAHOO.env.ua.gecko,
        isIE = YAHOO.env.ua.ie;

    // regex cache
    var patterns = {
        HYPHEN: /(-[a-z])/i, // to normalize get/setStyle
        ROOT_TAG: /^body|html$/i, // body for quirks mode, html for standards,
        OP_SCROLL:/^(?:inline|table-row)$/i
    };

    var toCamel = function(property) {
        if ( !patterns.HYPHEN.test(property) ) {
            return property; // no hyphens
        }

        if (propertyCache[property]) { // already converted
            return propertyCache[property];
        }

        var converted = property;

        while( patterns.HYPHEN.exec(converted) ) {
            converted = converted.replace(RegExp.$1,
                    RegExp.$1.substr(1).toUpperCase());
        }

        propertyCache[property] = converted;
        return converted;
        //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug
    };

    var getClassRegEx = function(className) {
        var re = reClassNameCache[className];
        if (!re) {
            re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
            reClassNameCache[className] = re;
        }
        return re;
    };

    // branching at load instead of runtime
    if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method
        getStyle = function(el, property) {
            var value = null;

            if (property == 'float') { // fix reserved word
                property = 'cssFloat';
            }

            var computed = el.ownerDocument.defaultView.getComputedStyle(el, '');
            if (computed) { // test computed before touching for safari
                value = computed[toCamel(property)];
            }

            return el.style[property] || value;
        };
    } else if (document.documentElement.currentStyle && isIE) { // IE method
        getStyle = function(el, property) {
            switch( toCamel(property) ) {
                case 'opacity' :// IE opacity uses filter
                    var val = 100;
                    try { // will error if no DXImageTransform
                        val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;

                    } catch(e) {
                        try { // make sure its in the document
                            val = el.filters('alpha').opacity;
                        } catch(e) {
                        }
                    }
                    return val / 100;
                case 'float': // fix reserved word
                    property = 'styleFloat'; // fall through
                default:
                    // test currentStyle before touching
                    var value = el.currentStyle ? el.currentStyle[property] : null;
                    return ( el.style[property] || value );
            }
        };
    } else { // default to inline only
        getStyle = function(el, property) { return el.style[property]; };
    }

    if (isIE) {
        setStyle = function(el, property, val) {
            switch (property) {
                case 'opacity':
                    if ( YAHOO.lang.isString(el.style.filter) ) { // in case not appended
                        el.style.filter = 'alpha(opacity=' + val * 100 + ')';

                        if (!el.currentStyle || !el.currentStyle.hasLayout) {
                            el.style.zoom = 1; // when no layout or cant tell
                        }
                    }
                    break;
                case 'float':
                    property = 'styleFloat';
                default:
                el.style[property] = val;
            }
        };
    } else {
        setStyle = function(el, property, val) {
            if (property == 'float') {
                property = 'cssFloat';
            }
            el.style[property] = val;
        };
    }

    var testElement = function(node, method) {
        return node && node.nodeType == 1 && ( !method || method(node) );
    };

    /**
     * Provides helper methods for DOM elements.
     * @namespace YAHOO.util
     * @class Dom
     */
    YAHOO.util.Dom = {
        /**
         * Returns an HTMLElement reference.
         * @method get
         * @param {String | HTMLElement |Array} el Accepts a string to use as an ID for getting a DOM reference, an actual DOM reference, or an Array of IDs and/or HTMLElements.
         * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.
         */
        get: function(el) {
            if (el && (el.nodeType || el.item)) { // Node, or NodeList
                return el;
            }

            if (YAHOO.lang.isString(el) || !el) { // id or null
                return document.getElementById(el);
            }

            if (el.length !== undefined) { // array-like
                var c = [];
                for (var i = 0, len = el.length; i < len; ++i) {
                    c[c.length] = Y.Dom.get(el[i]);
                }

                return c;
            }

            return el; // some other object, just pass it back
        },

        /**
         * Normalizes currentStyle and ComputedStyle.
         * @method getStyle
         * @param {String | HTMLElement |Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
         * @param {String} property The style property whose value is returned.
         * @return {String | Array} The current value of the style property for the element(s).
         */
        getStyle: function(el, property) {
            property = toCamel(property);

            var f = function(element) {
                return getStyle(element, property);
            };

            return Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Wrapper for setting style properties of HTMLElements.  Normalizes "opacity" across modern browsers.
         * @method setStyle
         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
         * @param {String} property The style property to be set.
         * @param {String} val The value to apply to the given property.
         */
        setStyle: function(el, property, val) {
            property = toCamel(property);

            var f = function(element) {
                setStyle(element, property, val);

            };

            Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Gets the current position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
         * @method getXY
         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
         * @return {Array} The XY position of the element(s)
         */
        getXY: function(el) {
            var f = function(el) {
                // has to be part of document to have pageXY
                if ( (el.parentNode === null || el.offsetParent === null ||
                        this.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) {
                    return false;
                }

                return getXY(el);
            };

            return Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
         * @method getX
         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
         * @return {Number | Array} The X position of the element(s)
         */
        getX: function(el) {
            var f = function(el) {
                return Y.Dom.getXY(el)[0];
            };

            return Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Gets the current Y position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
         * @method getY
         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
         * @return {Number | Array} The Y position of the element(s)
         */
        getY: function(el) {
            var f = function(el) {
                return Y.Dom.getXY(el)[1];
            };

            return Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Set the position of an html element in page coordinates, regardless of how the element is positioned.
         * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
         * @method setXY
         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
         * @param {Array} pos Contains X & Y values for new position (coordinates are page-based)
         * @param {Boolean} noRetry By default we try and set the position a second time if the first fails
         */
        setXY: function(el, pos, noRetry) {
            var f = function(el) {
                var style_pos = this.getStyle(el, 'position');
                if (style_pos == 'static') { // default to relative
                    this.setStyle(el, 'position', 'relative');
                    style_pos = 'relative';
                }

                var pageXY = this.getXY(el);
                if (pageXY === false) { // has to be part of doc to have pageXY
                    return false;
                }

                var delta = [ // assuming pixels; if not we will have to retry
                    Math.round(parseFloat( this.getStyle(el, 'left'), 10 )),
                    Math.round(parseFloat( this.getStyle(el, 'top'), 10 ))
                ];

                if ( isNaN(delta[0]) ) {// in case of 'auto'
                    delta[0] = (style_pos == 'relative') ? 0 : el.offsetLeft;
                }
                if ( isNaN(delta[1]) ) { // in case of 'auto'
                    delta[1] = (style_pos == 'relative') ? 0 : el.offsetTop;
                }

                if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }
                if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }

                if (!noRetry) {
                    var newXY = this.getXY(el);

                    // if retry is true, try one more time if we miss
                   if ( (pos[0] !== null && newXY[0] != pos[0]) ||
                        (pos[1] !== null && newXY[1] != pos[1]) ) {
                       this.setXY(el, pos, true);
                   }
                }

            };

            Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Set the X position of an html element in page coordinates, regardless of how the element is positioned.
         * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
         * @method setX
         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
         * @param {Int} x The value to use as the X coordinate for the element(s).
         */
        setX: function(el, x) {
            Y.Dom.setXY(el, [x, null]);
        },

        /**
         * Set the Y position of an html element in page coordinates, regardless of how the element is positioned.
         * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
         * @method setY
         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
         * @param {Int} x To use as the Y coordinate for the element(s).
         */
        setY: function(el, y) {
            Y.Dom.setXY(el, [null, y]);
        },

        /**
         * Returns the region position of the given element.
         * The element must be part of the DOM tree to have a region (display:none or elements not appended return false).
         * @method getRegion
         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
         * @return {Region | Array} A Region or array of Region instances containing "top, left, bottom, right" member data.
         */
        getRegion: function(el) {
            var f = function(el) {
                if ( (el.parentNode === null || el.offsetParent === null ||
                        this.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) {
                    return false;
                }

                var region = Y.Region.getRegion(el);
                return region;
            };

            return Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Returns the width of the client (viewport).
         * @method getClientWidth
         * @deprecated Now using getViewportWidth.  This interface left intact for back compat.
         * @return {Int} The width of the viewable area of the page.
         */
        getClientWidth: function() {
            return Y.Dom.getViewportWidth();
        },

        /**
         * Returns the height of the client (viewport).
         * @method getClientHeight
         * @deprecated Now using getViewportHeight.  This interface left intact for back compat.
         * @return {Int} The height of the viewable area of the page.
         */
        getClientHeight: function() {
            return Y.Dom.getViewportHeight();
        },

        /**
         * Returns a array of HTMLElements with the given class.
         * For optimized performance, include a tag and/or root node when possible.
         * @method getElementsByClassName
         * @param {String} className The class name to match against
         * @param {String} tag (optional) The tag name of the elements being collected
         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point
         * @param {Function} apply (optional) A function to apply to each element when found
         * @return {Array} An array of elements that have the given class name
         */
        getElementsByClassName: function(className, tag, root, apply) {
            tag = tag || '*';
            root = (root) ? Y.Dom.get(root) : null || document;
            if (!root) {
                return [];
            }

            var nodes = [],
                elements = root.getElementsByTagName(tag),
                re = getClassRegEx(className);

            for (var i = 0, len = elements.length; i < len; ++i) {
                if ( re.test(elements[i].className) ) {
                    nodes[nodes.length] = elements[i];
                    if (apply) {
                        apply.call(elements[i], elements[i]);
                    }
                }
            }

            return nodes;
        },

        /**
         * Determines whether an HTMLElement has the given className.
         * @method hasClass
         * @param {String | HTMLElement | Array} el The element or collection to test
         * @param {String} className the class name to search for
         * @return {Boolean | Array} A boolean value or array of boolean values
         */
        hasClass: function(el, className) {
            var re = getClassRegEx(className);

            var f = function(el) {
                return re.test(el.className);
            };

            return Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Adds a class name to a given element or collection of elements.
         * @method addClass
         * @param {String | HTMLElement | Array} el The element or collection to add the class to
         * @param {String} className the class name to add to the class attribute
         * @return {Boolean | Array} A pass/fail boolean or array of booleans
         */
        addClass: function(el, className) {
            var f = function(el) {
                if (this.hasClass(el, className)) {
                    return false; // already present
                }


                el.className = YAHOO.lang.trim([el.className, className].join(' '));
                return true;
            };

            return Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Removes a class name from a given element or collection of elements.
         * @method removeClass
         * @param {String | HTMLElement | Array} el The element or collection to remove the class from
         * @param {String} className the class name to remove from the class attribute
         * @return {Boolean | Array} A pass/fail boolean or array of booleans
         */
        removeClass: function(el, className) {
            var re = getClassRegEx(className);

            var f = function(el) {
                if (!className || !this.hasClass(el, className)) {
                    return false; // not present
                }


                var c = el.className;
                el.className = c.replace(re, ' ');
                if ( this.hasClass(el, className) ) { // in case of multiple adjacent
                    this.removeClass(el, className);
                }

                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
                return true;
            };

            return Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Replace a class with another class for a given element or collection of elements.
         * If no oldClassName is present, the newClassName is simply added.
         * @method replaceClass
         * @param {String | HTMLElement | Array} el The element or collection to remove the class from
         * @param {String} oldClassName the class name to be replaced
         * @param {String} newClassName the class name that will be replacing the old class name
         * @return {Boolean | Array} A pass/fail boolean or array of booleans
         */
        replaceClass: function(el, oldClassName, newClassName) {
            if (!newClassName || oldClassName === newClassName) { // avoid infinite loop
                return false;
            }

            var re = getClassRegEx(oldClassName);

            var f = function(el) {

                if ( !this.hasClass(el, oldClassName) ) {
                    this.addClass(el, newClassName); // just add it if nothing to replace
                    return true; // NOTE: return
                }

                el.className = el.className.replace(re, ' ' + newClassName + ' ');

                if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent
                    this.replaceClass(el, oldClassName, newClassName);
                }

                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
                return true;
            };

            return Y.Dom.batch(el, f, Y.Dom, true);
        },

        /**
         * Returns an ID and applies it to the element "el", if provided.
         * @method generateId
         * @param {String | HTMLElement | Array} el (optional) An optional element array of elements to add an ID to (no ID is added if one is already present).
         * @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen").
         * @return {String | Array} The generated ID, or array of generated IDs (or original ID if already present on an element)
         */
        generateId: function(el, prefix) {
            prefix = prefix || 'yui-gen';

            var f = function(el) {
                if (el && el.id) { // do not override existing ID
                    return el.id;
                }

                var id = prefix + YAHOO.env._id_counter++;

                if (el) {
                    el.id = id;
                }

                return id;
            };

            // batch fails when no element, so just generate and return single ID
            return Y.Dom.batch(el, f, Y.Dom, true) || f.apply(Y.Dom, arguments);
        },

        /**
         * Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy.
         * @method isAncestor
         * @param {String | HTMLElement} haystack The possible ancestor
         * @param {String | HTMLElement} needle The possible descendent
         * @return {Boolean} Whether or not the haystack is an ancestor of needle
         */
        isAncestor: function(haystack, needle) {
            haystack = Y.Dom.get(haystack);
            needle = Y.Dom.get(needle);

            if (!haystack || !needle) {
                return false;
            }

            if (haystack.contains && needle.nodeType && !isSafari) { // safari contains is broken
                return haystack.contains(needle);
            }
            else if ( haystack.compareDocumentPosition && needle.nodeType ) {
                return !!(haystack.compareDocumentPosition(needle) & 16);
            } else if (needle.nodeType) {
                // fallback to crawling up (safari)
                return !!this.getAncestorBy(needle, function(el) {
                    return el == haystack;
                });
            }
            return false;
        },

        /**
         * Determines whether an HTMLElement is present in the current document.
         * @method inDocument
         * @param {String | HTMLElement} el The element to search for
         * @return {Boolean} Whether or not the element is present in the current document
         */
        inDocument: function(el) {
            return this.isAncestor(document.documentElement, el);
        },

        /**
         * Returns a array of HTMLElements that pass the test applied by supplied boolean method.
         * For optimized performance, include a tag and/or root node when possible.
         * @method getElementsBy
         * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
         * @param {String} tag (optional) The tag name of the elements being collected
         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point
         * @param {Function} apply (optional) A function to apply to each element when found
         * @return {Array} Array of HTMLElements
         */
        getElementsBy: function(method, tag, root, apply) {
            tag = tag || '*';
            root = (root) ? Y.Dom.get(root) : null || document;

            if (!root) {
                return [];
            }

            var nodes = [],
                elements = root.getElementsByTagName(tag);

            for (var i = 0, len = elements.length; i < len; ++i) {
                if ( method(elements[i]) ) {
                    nodes[nodes.length] = elements[i];
                    if (apply) {
                        apply(elements[i]);
                    }
                }
            }


            return nodes;
        },

        /**
         * Runs the supplied method against each item in the Collection/Array.
         * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).
         * @method batch
         * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to
         * @param {Function} method The method to apply to the element(s)
         * @param {Any} o (optional) An optional arg that is passed to the supplied method
         * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"
         * @return {Any | Array} The return value(s) from the supplied method
         */
        batch: function(el, method, o, override) {
            el = (el && (el.tagName || el.item)) ? el : Y.Dom.get(el); // skip get() when possible

            if (!el || !method) {
                return false;
            }
            var scope = (override) ? o : window;

            if (el.tagName || el.length === undefined) { // element or not array-like
                return method.call(scope, el, o);
            }

            var collection = [];

            for (var i = 0, len = el.length; i < len; ++i) {
                collection[collection.length] = method.call(scope, el[i], o);
            }

            return collection;
        },

        /**
         * Returns the height of the document.
         * @method getDocumentHeight
         * @return {Int} The height of the actual document (which includes the body and its margin).
         */
        getDocumentHeight: function() {
            var scrollHeight = (document.compatMode != 'CSS1Compat') ? document.body.scrollHeight : document.documentElement.scrollHeight;

            var h = Math.max(scrollHeight, Y.Dom.getViewportHeight());
            return h;
        },

        /**
         * Returns the width of the document.
         * @method getDocumentWidth
         * @return {Int} The width of the actual document (which includes the body and its margin).
         */
        getDocumentWidth: function() {
            var scrollWidth = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth;
            var w = Math.max(scrollWidth, Y.Dom.getViewportWidth());
            return w;
        },

        /**
         * Returns the current height of the viewport.
         * @method getViewportHeight
         * @return {Int} The height of the viewable area of the page (excludes scrollbars).
         */
        getViewportHeight: function() {
            var height = self.innerHeight; // Safari, Opera
            var mode = document.compatMode;

            if ( (mode || isIE) && !isOpera ) { // IE, Gecko
                height = (mode == 'CSS1Compat') ?
                        document.documentElement.clientHeight : // Standards
                        document.body.clientHeight; // Quirks
            }

            return height;
        },

        /**
         * Returns the current width of the viewport.
         * @method getViewportWidth
         * @return {Int} The width of the viewable area of the page (excludes scrollbars).
         */

        getViewportWidth: function() {
            var width = self.innerWidth;  // Safari
            var mode = document.compatMode;

            if (mode || isIE) { // IE, Gecko, Opera
                width = (mode == 'CSS1Compat') ?
                        document.documentElement.clientWidth : // Standards
                        document.body.clientWidth; // Quirks
            }
            return width;
        },

       /**
         * Returns the nearest ancestor that passes the test applied by supplied boolean method.
         * For performance reasons, IDs are not accepted and argument validation omitted.
         * @method getAncestorBy
         * @param {HTMLElement} node The HTMLElement to use as the starting point
         * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
         * @return {Object} HTMLElement or null if not found
         */
        getAncestorBy: function(node, method) {
            while (node = node.parentNode) { // NOTE: assignment
                if ( testElement(node, method) ) {
                    return node;
                }
            }

            return null;
        },

        /**
         * Returns the nearest ancestor with the given className.
         * @method getAncestorByClassName
         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
         * @param {String} className
         * @return {Object} HTMLElement
         */
        getAncestorByClassName: function(node, className) {
            node = Y.Dom.get(node);
            if (!node) {
                return null;
            }
            var method = function(el) { return Y.Dom.hasClass(el, className); };
            return Y.Dom.getAncestorBy(node, method);
        },

        /**
         * Returns the nearest ancestor with the given tagName.
         * @method getAncestorByTagName
         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
         * @param {String} tagName
         * @return {Object} HTMLElement
         */
        getAncestorByTagName: function(node, tagName) {
            node = Y.Dom.get(node);
            if (!node) {
                return null;
            }
            var method = function(el) {
                 return el.tagName && el.tagName.toUpperCase() == tagName.toUpperCase();
            };

            return Y.Dom.getAncestorBy(node, method);
        },

        /**
         * Returns the previous sibling that is an HTMLElement.
         * For performance reasons, IDs are not accepted and argument validation omitted.
         * Returns the nearest HTMLElement sibling if no method provided.
         * @method getPreviousSiblingBy
         * @param {HTMLElement} node The HTMLElement to use as the starting point
         * @param {Function} method A boolean function used to test siblings
         * that receives the sibling node being tested as its only argument
         * @return {Object} HTMLElement or null if not found
         */
        getPreviousSiblingBy: function(node, method) {
            while (node) {
                node = node.previousSibling;
                if ( testElement(node, method) ) {
                    return node;
                }
            }
            return null;
        },

        /**
         * Returns the previous sibling that is an HTMLElement
         * @method getPreviousSibling
         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
         * @return {Object} HTMLElement or null if not found
         */
        getPreviousSibling: function(node) {
            node = Y.Dom.get(node);
            if (!node) {
                return null;
            }

            return Y.Dom.getPreviousSiblingBy(node);
        },

        /**
         * Returns the next HTMLElement sibling that passes the boolean method.
         * For performance reasons, IDs are not accepted and argument validation omitted.
         * Returns the nearest HTMLElement sibling if no method provided.
         * @method getNextSiblingBy
         * @param {HTMLElement} node The HTMLElement to use as the starting point
         * @param {Function} method A boolean function used to test siblings
         * that receives the sibling node being tested as its only argument
         * @return {Object} HTMLElement or null if not found
         */
        getNextSiblingBy: function(node, method) {
            while (node) {
                node = node.nextSibling;
                if ( testElement(node, method) ) {
                    return node;
                }
            }
            return null;
        },

        /**
         * Returns the next sibling that is an HTMLElement
         * @method getNextSibling
         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
         * @return {Object} HTMLElement or null if not found
         */
        getNextSibling: function(node) {
            node = Y.Dom.get(node);
            if (!node) {
                return null;
            }

            return Y.Dom.getNextSiblingBy(node);
        },

        /**
         * Returns the first HTMLElement child that passes the test method.
         * @method getFirstChildBy
         * @param {HTMLElement} node The HTMLElement to use as the starting point
         * @param {Function} method A boolean function used to test children
         * that receives the node being tested as its only argument
         * @return {Object} HTMLElement or null if not found
         */
        getFirstChildBy: function(node, method) {
            var child = ( testElement(node.firstChild, method) ) ? node.firstChild : null;
            return child || Y.Dom.getNextSiblingBy(node.firstChild, method);
        },

        /**
         * Returns the first HTMLElement child.
         * @method getFirstChild
         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
         * @return {Object} HTMLElement or null if not found
         */
        getFirstChild: function(node, method) {
            node = Y.Dom.get(node);
            if (!node) {
                return null;
            }
            return Y.Dom.getFirstChildBy(node);
        },

        /**
         * Returns the last HTMLElement child that passes the test method.
         * @method getLastChildBy
         * @param {HTMLElement} node The HTMLElement to use as the starting point
         * @param {Function} method A boolean function used to test children
         * that receives the node being tested as its only argument
         * @return {Object} HTMLElement or null if not found
         */
        getLastChildBy: function(node, method) {
            if (!node) {
                return null;
            }
            var child = ( testElement(node.lastChild, method) ) ? node.lastChild : null;
            return child || Y.Dom.getPreviousSiblingBy(node.lastChild, method);
        },

        /**
         * Returns the last HTMLElement child.
         * @method getLastChild
         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
         * @return {Object} HTMLElement or null if not found
         */
        getLastChild: function(node) {
            node = Y.Dom.get(node);
            return Y.Dom.getLastChildBy(node);
        },

        /**
         * Returns an array of HTMLElement childNodes that pass the test method.
         * @method getChildrenBy
         * @param {HTMLElement} node The HTMLElement to start from
         * @param {Function} method A boolean function used to test children
         * that receives the node being tested as its only argument
         * @return {Array} A static array of HTMLElements
         */
        getChildrenBy: function(node, method) {
            var child = Y.Dom.getFirstChildBy(node, method);
            var children = child ? [child] : [];

            Y.Dom.getNextSiblingBy(child, function(node) {
                if ( !method || method(node) ) {
                    children[children.length] = node;
                }
                return false; // fail test to collect all children
            });

            return children;
        },

        /**
         * Returns an array of HTMLElement childNodes.
         * @method getChildren
         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
         * @return {Array} A static array of HTMLElements
         */
        getChildren: function(node) {
            node = Y.Dom.get(node);
            if (!node) {
            }

            return Y.Dom.getChildrenBy(node);
        },

        /**
         * Returns the left scroll value of the document
         * @method getDocumentScrollLeft
         * @param {HTMLDocument} document (optional) The document to get the scroll value of
         * @return {Int}  The amount that the document is scrolled to the left
         */
        getDocumentScrollLeft: function(doc) {
            doc = doc || document;
            return Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
        },

        /**
         * Returns the top scroll value of the document
         * @method getDocumentScrollTop
         * @param {HTMLDocument} document (optional) The document to get the scroll value of
         * @return {Int}  The amount that the document is scrolled to the top
         */
        getDocumentScrollTop: function(doc) {
            doc = doc || document;
            return Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
        },

        /**
         * Inserts the new node as the previous sibling of the reference node
         * @method insertBefore
         * @param {String | HTMLElement} newNode The node to be inserted
         * @param {String | HTMLElement} referenceNode The node to insert the new node before
         * @return {HTMLElement} The node that was inserted (or null if insert fails)
         */
        insertBefore: function(newNode, referenceNode) {
            newNode = Y.Dom.get(newNode);
            referenceNode = Y.Dom.get(referenceNode);

            if (!newNode || !referenceNode || !referenceNode.parentNode) {
                return null;
            }

            return referenceNode.parentNode.insertBefore(newNode, referenceNode);
        },

        /**
         * Inserts the new node as the next sibling of the reference node
         * @method insertAfter
         * @param {String | HTMLElement} newNode The node to be inserted
         * @param {String | HTMLElement} referenceNode The node to insert the new node after
         * @return {HTMLElement} The node that was inserted (or null if insert fails)
         */
        insertAfter: function(newNode, referenceNode) {
            newNode = Y.Dom.get(newNode);
            referenceNode = Y.Dom.get(referenceNode);

            if (!newNode || !referenceNode || !referenceNode.parentNode) {
                return null;
            }

            if (referenceNode.nextSibling) {
                return referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
            } else {
                return referenceNode.parentNode.appendChild(newNode);
            }
        },

        /**
         * Creates a Region based on the viewport relative to the document.
         * @method getClientRegion
         * @return {Region} A Region object representing the viewport which accounts for document scroll
         */
        getClientRegion: function() {
            var t = Y.Dom.getDocumentScrollTop(),
                l = Y.Dom.getDocumentScrollLeft(),
                r = Y.Dom.getViewportWidth() + l,
                b = Y.Dom.getViewportHeight() + t;

            return new Y.Region(t, r, b, l);
        }
    };

    var getXY = function() {
        if (document.documentElement.getBoundingClientRect) { // IE
            return function(el) {
                var box = el.getBoundingClientRect();

                var rootNode = el.ownerDocument;
                return [box.left + Y.Dom.getDocumentScrollLeft(rootNode), box.top +
                        Y.Dom.getDocumentScrollTop(rootNode)];
            };
        } else {
            return function(el) { // manually calculate by crawling up offsetParents
                var pos = [el.offsetLeft, el.offsetTop];
                var parentNode = el.offsetParent;

                // safari: subtract body offsets if el is abs (or any offsetParent), unless body is offsetParent
                var accountForBody = (isSafari &&
                        Y.Dom.getStyle(el, 'position') == 'absolute' &&
                        el.offsetParent == el.ownerDocument.body);

                if (parentNode != el) {
                    while (parentNode) {
                        pos[0] += parentNode.offsetLeft;
                        pos[1] += parentNode.offsetTop;
                        if (!accountForBody && isSafari &&
                                Y.Dom.getStyle(parentNode,'position') == 'absolute' ) {
                            accountForBody = true;
                        }
                        parentNode = parentNode.offsetParent;
                    }
                }

                if (accountForBody) { //safari doubles in this case
                    pos[0] -= el.ownerDocument.body.offsetLeft;
                    pos[1] -= el.ownerDocument.body.offsetTop;
                }
                parentNode = el.parentNode;

                // account for any scrolled ancestors
                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) )
                {
                    if (parentNode.scrollTop || parentNode.scrollLeft) {
                        // work around opera inline/table scrollLeft/Top bug (false reports offset as scroll)
                        if (!patterns.OP_SCROLL.test(Y.Dom.getStyle(parentNode, 'display'))) {
                            if (!isOpera || Y.Dom.getStyle(parentNode, 'overflow') !== 'visible') { // opera inline-block misreports when visible
                                pos[0] -= parentNode.scrollLeft;
                                pos[1] -= parentNode.scrollTop;
                            }
                        }
                    }

                    parentNode = parentNode.parentNode;
                }

                return pos;
            };
        }
    }() // NOTE: Executing for loadtime branching
})();
/**
 * A region is a representation of an object on a grid.  It is defined
 * by the top, right, bottom, left extents, so is rectangular by default.  If
 * other shapes are required, this class could be extended to support it.
 * @namespace YAHOO.util
 * @class Region
 * @param {Int} t the top extent
 * @param {Int} r the right extent
 * @param {Int} b the bottom extent
 * @param {Int} l the left extent
 * @constructor
 */
YAHOO.util.Region = function(t, r, b, l) {

    /**
     * The region's top extent
     * @property top
     * @type Int
     */
    this.top = t;

    /**
     * The region's top extent as index, for symmetry with set/getXY
     * @property 1
     * @type Int
     */
    this[1] = t;

    /**
     * The region's right extent
     * @property right
     * @type int
     */
    this.right = r;

    /**
     * The region's bottom extent
     * @property bottom
     * @type Int
     */
    this.bottom = b;

    /**
     * The region's left extent
     * @property left
     * @type Int
     */
    this.left = l;

    /**
     * The region's left extent as index, for symmetry with set/getXY
     * @property 0
     * @type Int
     */
    this[0] = l;
};

/**
 * Returns true if this region contains the region passed in
 * @method contains
 * @param  {Region}  region The region to evaluate
 * @return {Boolean}        True if the region is contained with this region,
 *                          else false
 */
YAHOO.util.Region.prototype.contains = function(region) {
    return ( region.left   >= 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<len;++i) {
                if (targets[i].id == oTargetDD.id) {
                    return true;
                }
            }

            return false;
        },

        /**
         * My goal is to be able to transparently determine if an object is
         * typeof DragDrop, and the exact subclass of DragDrop.  typeof 
         * returns "object", oDD.constructor.toString() always returns
         * "DragDrop" and not the name of the subclass.  So for now it just
         * evaluates a well-known variable in DragDrop.
         * @method isTypeOfDD
         * @param {Object} the object to evaluate
         * @return {boolean} true if typeof oDD = DragDrop
         * @static
         */
        isTypeOfDD: function (oDD) {
            return (oDD && oDD.__ygDragDrop);
        },

        /**
         * Utility function to determine if a given element has been 
         * registered as a drag drop handle for the given Drag Drop object.
         * @method isHandle
         * @param {String} id the element id to check
         * @return {boolean} true if this element is a DragDrop handle, false 
         * otherwise
         * @static
         */
        isHandle: function(sDDId, sHandleId) {
            return ( this.handleIds[sDDId] && 
                            this.handleIds[sDDId][sHandleId] );
        },

        /**
         * Returns the DragDrop instance for a given id
         * @method getDDById
         * @param {String} id the id of the DragDrop object
         * @return {DragDrop} the drag drop object, null if it is not found
         * @static
         */
        getDDById: function(id) {
            for (var i in this.ids) {
                if (this.ids[i][id]) {
                    return this.ids[i][id];
                }
            }
            return null;
        },

        /**
         * Fired after a registered DragDrop object gets the mousedown event.
         * Sets up the events required to track the object being dragged
         * @method handleMouseDown
         * @param {Event} e the event
         * @param oDD the DragDrop object being dragged
         * @private
         * @static
         */
        handleMouseDown: function(e, oDD) {

            this.currentTarget = YAHOO.util.Event.getTarget(e);

            this.dragCurrent = oDD;

            var el = oDD.getEl();

            // track start position
            this.startX = YAHOO.util.Event.getPageX(e);
            this.startY = YAHOO.util.Event.getPageY(e);

            this.deltaX = this.startX - el.offsetLeft;
            this.deltaY = this.startY - el.offsetTop;

            this.dragThreshMet = false;

            this.clickTimeout = setTimeout( 
                    function() { 
                        var DDM = YAHOO.util.DDM;
                        DDM.startDrag(DDM.startX, DDM.startY);
                        DDM.fromTimeout = true;
                    }, 
                    this.clickTimeThresh );
        },

        /**
         * Fired when either the drag pixel threshol or the mousedown hold 
         * time threshold has been met.
         * @method startDrag
         * @param x {int} the X position of the original mousedown
         * @param y {int} the Y position of the original mousedown
         * @static
         */
        startDrag: function(x, y) {
            clearTimeout(this.clickTimeout);
            var dc = this.dragCurrent;
            if (dc && dc.events.b4StartDrag) {
                dc.b4StartDrag(x, y);
                dc.fireEvent('b4StartDragEvent', { x: x, y: y });
            }
            if (dc && dc.events.startDrag) {
                dc.startDrag(x, y);
                dc.fireEvent('startDragEvent', { x: x, y: y });
            }
            this.dragThreshMet = true;
        },

        /**
         * Internal function to handle the mouseup event.  Will be invoked 
         * from the context of the document.
         * @method handleMouseUp
         * @param {Event} e the event
         * @private
         * @static
         */
        handleMouseUp: function(e) {
            if (this.dragCurrent) {
                clearTimeout(this.clickTimeout);

                if (this.dragThreshMet) {
                    if (this.fromTimeout) {
                        this.handleMouseMove(e);
                    }
                    this.fromTimeout = false;
                    this.fireEvents(e, true);
                } else {
                }

                this.stopDrag(e);

                this.stopEvent(e);
            }
        },

        /**
         * Utility to stop event propagation and event default, if these 
         * features are turned on.
         * @method stopEvent
         * @param {Event} e the event as returned by this.getEvent()
         * @static
         */
        stopEvent: function(e) {
            if (this.stopPropagation) {
                YAHOO.util.Event.stopPropagation(e);
            }

            if (this.preventDefault) {
                YAHOO.util.Event.preventDefault(e);
            }
        },

        /** 
         * Ends the current drag, cleans up the state, and fires the endDrag
         * and mouseUp events.  Called internally when a mouseup is detected
         * during the drag.  Can be fired manually during the drag by passing
         * either another event (such as the mousemove event received in onDrag)
         * or a fake event with pageX and pageY defined (so that endDrag and
         * onMouseUp have usable position data.).  Alternatively, pass true
         * for the silent parameter so that the endDrag and onMouseUp events
         * are skipped (so no event data is needed.)
         *
         * @method stopDrag
         * @param {Event} e the mouseup event, another event (or a fake event) 
         *                  with pageX and pageY defined, or nothing if the 
         *                  silent parameter is true
         * @param {boolean} silent skips the enddrag and mouseup events if true
         * @static
         */
        stopDrag: function(e, silent) {
            var dc = this.dragCurrent;
            // Fire the drag end event for the item that was dragged
            if (dc && !silent) {
                if (this.dragThreshMet) {
                    if (dc.events.b4EndDrag) {
                        dc.b4EndDrag(e);
                        dc.fireEvent('b4EndDragEvent', { e: e });
                    }
                    if (dc.events.endDrag) {
                        dc.endDrag(e);
                        dc.fireEvent('endDragEvent', { e: e });
                    }
                }
                if (dc.events.mouseUp) {
                    dc.onMouseUp(e);
                    dc.fireEvent('mouseUpEvent', { e: e });
                }
            }

            this.dragCurrent = null;
            this.dragOvers = {};
        },

        /** 
         * Internal function to handle the mousemove event.  Will be invoked 
         * from the context of the html element.
         *
         * @TODO figure out what we can do about mouse events lost when the 
         * user drags objects beyond the window boundary.  Currently we can 
         * detect this in internet explorer by verifying that the mouse is 
         * down during the mousemove event.  Firefox doesn't give us the 
         * button state on the mousemove event.
         * @method handleMouseMove
         * @param {Event} e the event
         * @private
         * @static
         */
        handleMouseMove: function(e) {
            
            var dc = this.dragCurrent;
            if (dc) {

                // var button = e.which || e.button;

                // check for IE mouseup outside of page boundary
                if (YAHOO.util.Event.isIE && YAHOO.util.Event.isIE < 9 && !e.button) {
                    this.stopEvent(e);
                    return this.handleMouseUp(e);
                } else {
                    if (e.clientX < 0 || e.clientY < 0) {
                        //This will stop the element from leaving the viewport in FF, Opera & Safari
                        //Not turned on yet
                        //this.stopEvent(e);
                        //return false;
                    }
                }

                if (!this.dragThreshMet) {
                    var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e));
                    var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e));
                    if (diffX > 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<len; ++i) {
                    var dd = dds[i];
                    // If the cursor is over the object, it wins.  If the 
                    // cursor is over multiple matches, the first one we come
                    // to wins.
                    if (this.mode == this.INTERSECT && dd.cursorIsOver) {
                        winner = dd;
                        break;
                    // Otherwise the object with the most overlap wins
                    } else {
                        if (!winner || !winner.overlap || (dd.overlap &&
                            winner.overlap.getArea() < dd.overlap.getArea())) {
                            winner = dd;
                        }
                    }
                }
            }

            return winner;
        },

        /**
         * Refreshes the cache of the top-left and bottom-right points of the 
         * drag and drop objects in the specified group(s).  This is in the
         * format that is stored in the drag and drop instance, so typical 
         * usage is:
         * <code>
         * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups);
         * </code>
         * Alternatively:
         * <code>
         * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true});
         * </code>
         * @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:
 * <ul>
 * <li>linked element: the element that is passed into the constructor.
 * This is the element which defines the boundaries for interaction with 
 * other DragDrop objects.</li>
 * <li>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.</li>
 * <li>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}
 * </li>
 * </ul>
 * 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:
 * <pre>
 *  dd = new YAHOO.util.DragDrop("div1", "group1");
 * </pre>
 * 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...
 * <pre>
 *  dd.onDragDrop = function(e, id) {
 *  &nbsp;&nbsp;alert("dd was dropped on " + id);
 *  }
 * </pre>
 * @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 <a href="YAHOO.util.EventProvider.html#subscribe">YAHOO.util.EventProvider.subscribe</a>
    */
    on: function() {
        this.subscribe.apply(this, arguments);
    },
    /**
     * The id of the element associated with this object.  This is what we 
     * refer to as the "linked element" because the size and position of 
     * this element is used to determine when the drag and drop objects have 
     * 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<len; ++i) {
            if (this.invalidHandleClasses[i] == cssClass) {
                delete this.invalidHandleClasses[i];
            }
        }
    },

    /**
     * Checks the tag exclusion list to see if this click should be ignored
     * @method isValidHandleChild
     * @param {HTMLElement} node the HTMLElement to evaluate
     * @return {boolean} true if this is a valid tag type, false if not
     */
    isValidHandleChild: function(node) {

        var valid = true;
        // var n = (node.nodeName == "#text") ? node.parentNode : node;
        var nodeName;
        try {
            nodeName = node.nodeName.toUpperCase();
        } catch(e) {
            nodeName = node.nodeName;
        }
        valid = valid && !this.invalidHandleTypes[nodeName];
        valid = valid && !this.invalidHandleIds[node.id];

        for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
            valid = !Dom.hasClass(node, this.invalidHandleClasses[i]);
        }


        return valid;

    },

    /**
     * Create the array of horizontal tick marks if an interval was specified
     * in setXConstraint().
     * @method setXTicks
     * @private
     */
    setXTicks: function(iStartX, iTickSize) {
        this.xTicks = [];
        this.xTickSize = iTickSize;
        
        var tickMap = {};

        for (var i = this.initPageX; 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<len; ++i) {
                var next = i + 1;
                if (tickArray[next] && tickArray[next] >= 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 <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event b4MouseDownEvent
* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event mouseUpEvent
* @description Fired from inside DragDropMgr when the drag operation is finished.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event b4StartDragEvent
* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event startDragEvent
* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event b4EndDragEvent
* @description Fires before the endDragEvent. Returning false will cancel.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event endDragEvent
* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event dragEvent
* @description Occurs every mousemove event while dragging.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragEvent
* @description Fires before the dragEvent.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event invalidDropEvent
* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragOutEvent
* @description Fires before the dragOutEvent
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragOutEvent
* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragEnterEvent
* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragOverEvent
* @description Fires before the dragOverEvent.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragOverEvent
* @description Fires every mousemove event while over a drag and drop object.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragDropEvent 
* @description Fires before the dragDropEvent
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragDropEvent
* @description Fires when the dragged objects is dropped on another.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
})();
/**
 * A DragDrop implementation where the linked element follows the 
 * 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 <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event b4MouseDownEvent
* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event mouseUpEvent
* @description Fired from inside DragDropMgr when the drag operation is finished.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event b4StartDragEvent
* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event startDragEvent
* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event b4EndDragEvent
* @description Fires before the endDragEvent. Returning false will cancel.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event endDragEvent
* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event dragEvent
* @description Occurs every mousemove event while dragging.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragEvent
* @description Fires before the dragEvent.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event invalidDropEvent
* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragOutEvent
* @description Fires before the dragOutEvent
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragOutEvent
* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragEnterEvent
* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragOverEvent
* @description Fires before the dragOverEvent.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragOverEvent
* @description Fires every mousemove event while over a drag and drop object.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragDropEvent 
* @description Fires before the dragDropEvent
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragDropEvent
* @description Fires when the dragged objects is dropped on another.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
});
/**
 * A DragDrop implementation that inserts an empty, bordered div into
 * 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 <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event b4MouseDownEvent
* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event mouseUpEvent
* @description Fired from inside DragDropMgr when the drag operation is finished.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event b4StartDragEvent
* @description Fires before the startDragEvent, returning false will cancel the startDrag Event.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event startDragEvent
* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. 
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event b4EndDragEvent
* @description Fires before the endDragEvent. Returning false will cancel.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event endDragEvent
* @description Fires on the mouseup event after a drag has been initiated (startDrag fired).
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

/**
* @event dragEvent
* @description Occurs every mousemove event while dragging.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragEvent
* @description Fires before the dragEvent.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event invalidDropEvent
* @description Fires when the dragged objects is dropped in a location that contains no drop targets.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragOutEvent
* @description Fires before the dragOutEvent
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragOutEvent
* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. 
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragEnterEvent
* @description Occurs when the dragged object first interacts with another targettable drag and drop object.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragOverEvent
* @description Fires before the dragOverEvent.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragOverEvent
* @description Fires every mousemove event while over a drag and drop object.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event b4DragDropEvent 
* @description Fires before the dragDropEvent
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/
/**
* @event dragDropEvent
* @description Fires when the dragged objects is dropped on another.
* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
*/

});
/**
 * A DragDrop implementation that does not move, but can be a drop 
 * 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.
 * <p>Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);</p>
 * @class Anim
 * @namespace YAHOO.util
 * @requires YAHOO.util.AnimMgr
 * @requires YAHOO.util.Easing
 * @requires YAHOO.util.Dom
 * @requires YAHOO.util.Event
 * @requires YAHOO.util.CustomEvent
 * @constructor
 * @param {String | 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.
 * <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code> Color values can be specified with either 112233, #112233, 
 * [255,255,255], or rgb(255,255,255)</p>
 * @class ColorAnim
 * @namespace YAHOO.util
 * @requires YAHOO.util.Anim
 * @requires YAHOO.util.AnimMgr
 * @requires YAHOO.util.Easing
 * @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.
 * <p>Usage: <code>var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>
 * @class Motion
 * @namespace YAHOO.util
 * @requires YAHOO.util.Anim
 * @requires YAHOO.util.AnimMgr
 * @requires YAHOO.util.Easing
 * @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.
 * <p>Usage: <code>var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>
 * @class Scroll
 * @namespace YAHOO.util
 * @requires YAHOO.util.Anim
 * @requires YAHOO.util.AnimMgr
 * @requires YAHOO.util.Easing
 * @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<this.subscribers.length;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_5)){this._delete(i);}}};yui.CustomEvent.prototype.fire=function(){for(var i=0;i<this.subscribers.length;++i){var s=this.subscribers[i];if(s){s.fn.call(this.scope,this.type,arguments,s.obj);}}};yui.CustomEvent.prototype.unsubscribeAll=function(){for(var i=0;i<this.subscribers.length;++i){this._delete(i);}};yui.CustomEvent.prototype._delete=function(_8){var s=this.subscribers[_8];if(s){delete s.fn;delete s.obj;}delete this.subscribers[_8];};yui.Subscriber=function(fn,_9){this.fn=fn;this.obj=_9||null;};yui.Subscriber.prototype.contains=function(fn,obj){return (this.fn==fn&&this.obj==obj);};yui=window.yui||{};yui.Event=new function(){var _11=this;this.loadComplete=false;this.listeners=[];this.delayedListeners=[];this.unloadListeners=[];this.customEvents=[];this.legacyEvents=[];this.legacyHandlers=[];this.EL=0;this.TYPE=1;this.FN=2;this.WFN=3;this.SCOPE=3;this.isSafari=(navigator.userAgent.match(/safari/gi));this.isIE=(!this.isSafari&&navigator.userAgent.match(/msie/gi));this.addListener=function(el,_13,fn,_14){if(this._isValidCollection(el)){for(var i=0;i<el.length;++i){this.on(el[i],_13,fn,_14);}return;}else{if(typeof el=="string"){if(this.loadComplete){el=this.getEl(el);}else{this.delayedListeners[this.delayedListeners.length]=[el,_13,fn,_14];return;}}}if(!el){return;}if("unload"==_13&&_14!==this){this.unloadListeners[this.unloadListeners.length]=[el,_13,fn,_14];return;}var _15=function(e){return fn.call(el,_11.getEvent(e),_14);};var li=[el,_13,fn,_15];var _18=this.listeners.length;this.listeners[_18]=li;if(this.useLegacyEvent(el,_13)){var _19=this.getLegacyIndex(el,_13);if(_19==-1){_19=this.legacyEvents.length;this.legacyEvents[_19]=[el,_13,el["on"+_13]];this.legacyHandlers[_19]=[];el["on"+_13]=function(e){_11.fireLegacyEvent(_11.getEvent(e),_19);};}this.legacyHandlers[_19].push(_18);}else{if(el.addEventListener){el.addEventListener(_13,_15,false);}else{if(el.attachEvent){el.attachEvent("on"+_13,_15);}}}};this.on=this.addListener;this.fireLegacyEvent=function(e,_20){var ok=true;var el=_11.legacyEvents[0];var le=_11.legacyHandlers[_20];for(i=0;i<le.length;++i){var _23=le[i];if(_23){var ret=_11.listeners[_23][_11.WFN].call(el,e);ok=(ok&&ret);}}return ok;};this.getLegacyIndex=function(el,_25){for(var i=0;i<this.legacyEvents.length;++i){var le=this.legacyEvents[i];if(le&&le[0]==el&&le[1]==_25){return i;}}return -1;};this.useLegacyEvent=function(el,_26){return ((!el.addEventListener&&!el.attachEvent)||(_26=="click"&&this.isSafari));};this.removeListener=function(el,_27,fn){if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){for(var i=0;i<el.length;++i){this.removeListener(el[i],_27,fn);}return;}}var _28=null;var _29=this._getCacheIndex(el,_27,fn);if(_29>=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;i<this.listeners.length;++i){var li=this.listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_36){return i;}}return -1;};this._isValidCollection=function(o){return (o&&o.length&&typeof o!="string"&&!o.alert&&!o.name&&!o.id&&typeof o[0]!="undefined");};this.elCache={};this.getEl=function(id){return document.getElementById(id);};this.clearCache=function(){for(i in this.elCache){delete this.elCache[i];}};this.regCE=function(ce){this.customEvents.push(ce);};this._load=function(e){_11.loadComplete=true;};this._tryPreloadAttach=function(){var _40=!this.loadComplete;for(var i=0;i<this.delayedListeners.length;++i){var d=this.delayedListeners[i];if(d){var el=this.getEl(d[this.EL]);if(el){this.on(el,d[this.TYPE],d[this.FN],d[this.SCOPE]);delete this.delayedListeners[i];}}}if(_40){setTimeout("yui.Event._tryPreloadAttach()",50);}};this._unload=function(e,me){for(var i=0;i<me.unloadListeners.length;++i){var l=me.unloadListeners[i];if(l){l[me.FN](me.getEvent(e),l[me.SCOPE]);}}if(me.listeners&&me.listeners.length>0){for(i=0;i<me.listeners.length;++i){l=me.listeners[i];if(l){me.removeListener(l[me.EL],l[me.TYPE],l[me.FN]);}}me.clearCache();}for(i=0;i<me.customEvents.length;++i){me.customEvents[i].unsubscribeAll();delete me.customEvents[i];}for(i=0;i<me.legacyEvents.length;++i){delete me.legacyEvents[i][0];delete me.legacyEvents[i];}};this._getScrollLeft=function(){return this._getScroll()[1];};this._getScrollTop=function(){return this._getScroll()[0];};this._getScroll=function(){var dd=document.documentElement;db=document.body;if(dd&&dd.scrollTop){return [dd.scrollTop,dd.scrollLeft];}else{if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}};};if(document&&document.body){yui.Event._load();}else{yui.Event.on(window,"load",yui.Event._load,yui.Event);}yui.Event.on(window,"unload",yui.Event._unload,yui.Event);yui.Event._tryPreloadAttach();/*
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 Connection Manager provides a simplified interface to the XMLHttpRequest
 * object.  It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
 * interactive states and server response, returning the results to a pre-defined
 * callback you create.
 *
 * @namespace YAHOO.util
 * @module connection
 * @requires yahoo
 * @requires event
 */

/**
 * The Connection Manager singleton provides methods for creating and managing
 * asynchronous transactions.
 *
 * @class Connect
 */

YAHOO.util.Connect =
{
  /**
   * @description Array of MSFT ActiveX ids for XMLHttpRequest.
   * @property _msxml_progid
   * @private
   * @static
   * @type array
   */
	_msxml_progid:[
		'Microsoft.XMLHTTP',
		'MSXML2.XMLHTTP.3.0',
		'MSXML2.XMLHTTP'
		],

  /**
   * @description Object literal of HTTP header(s)
   * @property _http_header
   * @private
   * @static
   * @type object
   */
	_http_headers:{},

  /**
   * @description Determines if HTTP headers are set.
   * @property _has_http_headers
   * @private
   * @static
   * @type boolean
   */
	_has_http_headers:false,

 /**
  * @description Determines if a default header of
  * Content-Type of 'application/x-www-form-urlencoded'
  * will be added to any client HTTP headers sent for POST
  * transactions.
  * @property _use_default_post_header
  * @private
  * @static
  * @type boolean
  */
    _use_default_post_header:true,

 /**
  * @description The default header used for POST transactions.
  * @property _default_post_header
  * @private
  * @static
  * @type boolean
  */
    _default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',

 /**
  * @description The default header used for transactions involving the
  * use of HTML forms.
  * @property _default_form_header
  * @private
  * @static
  * @type boolean
  */
    _default_form_header:'application/x-www-form-urlencoded',

 /**
  * @description Determines if a default header of
  * 'X-Requested-With: XMLHttpRequest'
  * will be added to each transaction.
  * @property _use_default_xhr_header
  * @private
  * @static
  * @type boolean
  */
    _use_default_xhr_header:true,

 /**
  * @description The default header value for the label
  * "X-Requested-With".  This is sent with each
  * transaction, by default, to identify the
  * request as being made by YUI Connection Manager.
  * @property _default_xhr_header
  * @private
  * @static
  * @type boolean
  */
    _default_xhr_header:'XMLHttpRequest',

 /**
  * @description Determines if custom, default headers
  * are set for each transaction.
  * @property _has_default_header
  * @private
  * @static
  * @type boolean
  */
    _has_default_headers:true,

 /**
  * @description Determines if custom, default headers
  * are set for each transaction.
  * @property _has_default_header
  * @private
  * @static
  * @type boolean
  */
    _default_headers:{},

 /**
  * @description Property modified by setForm() to determine if the data
  * should be submitted as an HTML form.
  * @property _isFormSubmit
  * @private
  * @static
  * @type boolean
  */
    _isFormSubmit:false,

 /**
  * @description Property modified by setForm() to determine if a file(s)
  * upload is expected.
  * @property _isFileUpload
  * @private
  * @static
  * @type boolean
  */
    _isFileUpload:false,

 /**
  * @description Property modified by setForm() to set a reference to the HTML
  * form node if the desired action is file upload.
  * @property _formNode
  * @private
  * @static
  * @type object
  */
    _formNode:null,

 /**
  * @description Property modified by setForm() to set the HTML form data
  * for each transaction.
  * @property _sFormData
  * @private
  * @static
  * @type string
  */
    _sFormData:null,

 /**
  * @description Collection of polling references to the polling mechanism in handleReadyState.
  * @property _poll
  * @private
  * @static
  * @type object
  */
    _poll:{},

 /**
  * @description Queue of timeout values for each transaction callback with a defined timeout value.
  * @property _timeOut
  * @private
  * @static
  * @type object
  */
    _timeOut:{},

  /**
   * @description The polling frequency, in milliseconds, for HandleReadyState.
   * when attempting to determine a transaction's XHR readyState.
   * The default is 50 milliseconds.
   * @property _polling_interval
   * @private
   * @static
   * @type int
   */
     _polling_interval:50,

  /**
   * @description A transaction counter that increments the transaction id for each transaction.
   * @property _transaction_id
   * @private
   * @static
   * @type int
   */
     _transaction_id:0,

  /**
   * @description Tracks the name-value pair of the "clicked" submit button if multiple submit
   * buttons are present in an HTML form; and, if YAHOO.util.Event is available.
   * @property _submitElementValue
   * @private
   * @static
   * @type string
   */
	 _submitElementValue:null,

  /**
   * @description Determines whether YAHOO.util.Event is available and returns true or false.
   * If true, an event listener is bound at the document level to trap click events that
   * resolve to a target type of "Submit".  This listener will enable setForm() to determine
   * the clicked "Submit" value in a multi-Submit button, HTML form.
   * @property _hasSubmitListener
   * @private
   * @static
   */
	 _hasSubmitListener:(function()
	 {
		if(YAHOO.util.Event){
			YAHOO.util.Event.addListener(
				document,
				'click',
				function(e){
					var obj = YAHOO.util.Event.getTarget(e);
					if(obj.nodeName.toLowerCase() == 'input' && (obj.type && obj.type.toLowerCase() == 'submit')){
						YAHOO.util.Connect._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
					}
				});
			return true;
	    }
	    return false;
	 })(),

  /**
   * @description Custom event that fires at the start of a transaction
   * @property startEvent
   * @private
   * @static
   * @type CustomEvent
   */
	startEvent: new YAHOO.util.CustomEvent('start'),

  /**
   * @description Custom event that fires when a transaction response has completed.
   * @property completeEvent
   * @private
   * @static
   * @type CustomEvent
   */
	completeEvent: new YAHOO.util.CustomEvent('complete'),

  /**
   * @description Custom event that fires when handleTransactionResponse() determines a
   * response in the HTTP 2xx range.
   * @property successEvent
   * @private
   * @static
   * @type CustomEvent
   */
	successEvent: new YAHOO.util.CustomEvent('success'),

  /**
   * @description Custom event that fires when handleTransactionResponse() determines a
   * response in the HTTP 4xx/5xx range.
   * @property failureEvent
   * @private
   * @static
   * @type CustomEvent
   */
	failureEvent: new YAHOO.util.CustomEvent('failure'),

  /**
   * @description Custom event that fires when handleTransactionResponse() determines a
   * response in the HTTP 4xx/5xx range.
   * @property failureEvent
   * @private
   * @static
   * @type CustomEvent
   */
	uploadEvent: new YAHOO.util.CustomEvent('upload'),

  /**
   * @description Custom event that fires when a transaction is successfully aborted.
   * @property abortEvent
   * @private
   * @static
   * @type CustomEvent
   */
	abortEvent: new YAHOO.util.CustomEvent('abort'),

  /**
   * @description A reference table that maps callback custom events members to its specific
   * event name.
   * @property _customEvents
   * @private
   * @static
   * @type object
   */
	_customEvents:
	{
		onStart:['startEvent', 'start'],
		onComplete:['completeEvent', 'complete'],
		onSuccess:['successEvent', 'success'],
		onFailure:['failureEvent', 'failure'],
		onUpload:['uploadEvent', 'upload'],
		onAbort:['abortEvent', 'abort']
	},

  /**
   * @description Member to add an ActiveX id to the existing xml_progid array.
   * In the event(unlikely) a new ActiveX id is introduced, it can be added
   * without internal code modifications.
   * @method setProgId
   * @public
   * @static
   * @param {string} id The ActiveX id to be added to initialize the XHR object.
   * @return void
   */
	setProgId:function(id)
	{
		this._msxml_progid.unshift(id);
	},

  /**
   * @description Member to override the default POST header.
   * @method setDefaultPostHeader
   * @public
   * @static
   * @param {boolean} b Set and use default header - true or false .
   * @return void
   */
	setDefaultPostHeader:function(b)
	{
		if(typeof b == 'string'){
			this._default_post_header = b;
		}
		else if(typeof b == 'boolean'){
			this._use_default_post_header = b;
		}
	},

  /**
   * @description Member to override the default transaction header..
   * @method setDefaultXhrHeader
   * @public
   * @static
   * @param {boolean} b Set and use default header - true or false .
   * @return void
   */
	setDefaultXhrHeader:function(b)
	{
		if(typeof b == 'string'){
			this._default_xhr_header = b;
		}
		else{
			this._use_default_xhr_header = b;
		}
	},

  /**
   * @description Member to modify the default polling interval.
   * @method setPollingInterval
   * @public
   * @static
   * @param {int} i The polling interval in milliseconds.
   * @return void
   */
	setPollingInterval:function(i)
	{
		if(typeof i == 'number' && isFinite(i)){
			this._polling_interval = i;
		}
	},

  /**
   * @description Instantiates a XMLHttpRequest object and returns an object with two properties:
   * the XMLHttpRequest instance and the transaction id.
   * @method createXhrObject
   * @private
   * @static
   * @param {int} transactionId Property containing the transaction id for this transaction.
   * @return object
   */
	createXhrObject:function(transactionId)
	{
		var obj,http;
		try
		{
			// Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
			http = new XMLHttpRequest();
			//  Object literal with http and tId properties
			obj = { conn:http, tId:transactionId };
		}
		catch(e)
		{
			for(var i=0; i<this._msxml_progid.length; ++i){
				try
				{
					// Instantiates XMLHttpRequest for IE and assign to http
					http = new ActiveXObject(this._msxml_progid[i]);
					//  Object literal with conn and tId properties
					obj = { conn:http, tId:transactionId };
					break;
				}
				catch(e){}
			}
		}
		finally
		{
			return obj;
		}
	},

  /**
   * @description This method is called by asyncRequest to create a
   * valid connection object for the transaction.  It also passes a
   * transaction id and increments the transaction id counter.
   * @method getConnectionObject
   * @private
   * @static
   * @return {object}
   */
	getConnectionObject:function(isFileUpload)
	{
		var o;
		var tId = this._transaction_id;

		try
		{
			if(!isFileUpload){
				o = this.createXhrObject(tId);
			}
			else{
				o = {};
				o.tId = tId;
				o.isUpload = true;
			}

			if(o){
				this._transaction_id++;
			}
		}
		catch(e){}
		finally
		{
			return o;
		}
	},

  /**
   * @description Method for initiating an asynchronous request via the XHR object.
   * @method asyncRequest
   * @public
   * @static
   * @param {string} method HTTP transaction method
   * @param {string} uri Fully qualified path of resource
   * @param {callback} callback User-defined callback function or object
   * @param {string} postData POST body
   * @return {object} Returns the connection object
   */
	asyncRequest:function(method, uri, callback, postData)
	{
		var o = (this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();
		var args = (callback && callback.argument)?callback.argument:null;

		if(!o){
			return null;
		}
		else{

			// Intialize any transaction-specific custom events, if provided.
			if(callback && callback.customevents){
				this.initCustomEvents(o, callback);
			}

			if(this._isFormSubmit){
				if(this._isFileUpload){
					this.uploadFile(o, callback, uri, postData);
					return o;
				}

				// If the specified HTTP method is GET, setForm() will return an
				// encoded string that is concatenated to the uri to
				// create a querystring.
				if(method.toUpperCase() == 'GET'){
					if(this._sFormData.length !== 0){
						// If the URI already contains a querystring, append an ampersand
						// and then concatenate _sFormData to the URI.
						uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
					}
				}
				else if(method.toUpperCase() == 'POST'){
					// If POST data exist in addition to the HTML form data,
					// it will be concatenated to the form data.
					postData = postData?this._sFormData + "&" + postData:this._sFormData;
				}
			}

			if(method.toUpperCase() == 'GET' && (callback && callback.cache === false)){
				// If callback.cache is defined and set to false, a
				// timestamp value will be added to the querystring.
				uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();
			}

			o.conn.open(method, uri, true);

			// Each transaction will automatically include a custom header of
			// "X-Requested-With: XMLHttpRequest" to identify the request as
			// having originated from Connection Manager.
			if(this._use_default_xhr_header){
				if(!this._default_headers['X-Requested-With']){
					this.initHeader('X-Requested-With', this._default_xhr_header, true);
				}
			}

			//If the transaction method is POST and the POST header value is set to true
			//or a custom value, initalize the Content-Type header to this value.
			if((method.toUpperCase() == 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
				this.initHeader('Content-Type', this._default_post_header);
			}

			//Initialize all default and custom HTTP headers,
			if(this._has_default_headers || this._has_http_headers){
				this.setHeader(o);
			}

			this.handleReadyState(o, callback);
			o.conn.send(postData || '');


			// Reset the HTML form data and state properties as
			// soon as the data are submitted.
			if(this._isFormSubmit === true){
				this.resetFormState();
			}

			// Fire global custom event -- startEvent
			this.startEvent.fire(o, args);

			if(o.startEvent){
				// Fire transaction custom event -- startEvent
				o.startEvent.fire(o, args);
			}

			return o;
		}
	},

  /**
   * @description This method creates and subscribes custom events,
   * specific to each transaction
   * @method initCustomEvents
   * @private
   * @static
   * @param {object} o The connection object
   * @param {callback} callback The user-defined callback object
   * @return {void}
   */
	initCustomEvents:function(o, callback)
	{
		// Enumerate through callback.customevents members and bind/subscribe
		// events that match in the _customEvents table.
		for(var prop in callback.customevents){
			if(this._customEvents[prop][0]){
				// Create the custom event
				o[this._customEvents[prop][0]] = new YAHOO.util.CustomEvent(this._customEvents[prop][1], (callback.scope)?callback.scope:null);

				// Subscribe the custom event
				o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);
			}
		}
	},

  /**
   * @description This method serves as a timer that polls the XHR object's readyState
   * property during a transaction, instead of binding a callback to the
   * onreadystatechange event.  Upon readyState 4, handleTransactionResponse
   * will process the response, and the timer will be cleared.
   * @method handleReadyState
   * @private
   * @static
   * @param {object} o The connection object
   * @param {callback} callback The user-defined callback object
   * @return {void}
   */

    handleReadyState:function(o, callback)

    {
		var oConn = this;
		var args = (callback && callback.argument)?callback.argument:null;

		if(callback && callback.timeout){
			this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
		}

		this._poll[o.tId] = window.setInterval(
			function(){
				if(o.conn && o.conn.readyState === 4){

					// Clear the polling interval for the transaction
					// and remove the reference from _poll.
					window.clearInterval(oConn._poll[o.tId]);
					delete oConn._poll[o.tId];

					if(callback && callback.timeout){
						window.clearTimeout(oConn._timeOut[o.tId]);
						delete oConn._timeOut[o.tId];
					}

					// Fire global custom event -- completeEvent
					oConn.completeEvent.fire(o, args);

					if(o.completeEvent){
						// Fire transaction custom event -- completeEvent
						o.completeEvent.fire(o, args);
					}

					oConn.handleTransactionResponse(o, callback);
				}
			}
		,this._polling_interval);
    },

  /**
   * @description This method attempts to interpret the server response and
   * determine whether the transaction was successful, or if an error or
   * exception was encountered.
   * @method handleTransactionResponse
   * @private
   * @static
   * @param {object} o The connection object
   * @param {object} callback The user-defined callback object
   * @param {boolean} isAbort Determines if the transaction was terminated via abort().
   * @return {void}
   */
    handleTransactionResponse:function(o, callback, isAbort)
    {
		var httpStatus, responseObject;
		var args = (callback && callback.argument)?callback.argument:null;

		try
		{
			if(o.conn.status !== undefined && o.conn.status !== 0){
				httpStatus = o.conn.status;
			}
			else{
				httpStatus = 13030;
			}
		}
		catch(e){

			 // 13030 is a custom code to indicate the condition -- in Mozilla/FF --
			 // when the XHR object's status and statusText properties are
			 // unavailable, and a query attempt throws an exception.
			httpStatus = 13030;
		}

		if(httpStatus >= 200 && httpStatus < 300 || httpStatus === 1223){
			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<header.length; i++){
				var delimitPos = header[i].indexOf(':');
				if(delimitPos != -1){
					headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+2);
				}
			}
		}
		catch(e){}

		obj.tId = o.tId;
		// Normalize IE's response to HTTP 204 when Win error 1223.
		obj.status = (o.conn.status == 1223)?204:o.conn.status;
		// Normalize IE's statusText to "No Content" instead of "Unknown".
		obj.statusText = (o.conn.status == 1223)?"No Content":o.conn.statusText;
		obj.getResponseHeader = headerObj;
		obj.getAllResponseHeaders = headerStr;
		obj.responseText = o.conn.responseText;
		obj.responseXML = o.conn.responseXML;

		if(callbackArg){
			obj.argument = callbackArg;
		}

		return obj;
    },

  /**
   * @description If a transaction cannot be completed due to dropped or closed connections,
   * there may be not be enough information to build a full response object.
   * The failure callback will be fired and this specific condition can be identified
   * by a status property value of 0.
   *
   * If an abort was successful, the status property will report a value of -1.
   *
   * @method createExceptionObject
   * @private
   * @static
   * @param {int} tId The Transaction Id
   * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
   * @param {boolean} isAbort Determines if the exception case is caused by a transaction abort
   * @return {object}
   */
    createExceptionObject:function(tId, callbackArg, isAbort)
    {
		var COMM_CODE = 0;
		var COMM_ERROR = 'communication failure';
		var ABORT_CODE = -1;
		var ABORT_ERROR = 'transaction aborted';

		var obj = {};

		obj.tId = tId;
		if(isAbort){
			obj.status = ABORT_CODE;
			obj.statusText = ABORT_ERROR;
		}
		else{
			obj.status = COMM_CODE;
			obj.statusText = COMM_ERROR;
		}

		if(callbackArg){
			obj.argument = callbackArg;
		}

		return obj;
    },

  /**
   * @description Method that initializes the custom HTTP headers for the each transaction.
   * @method initHeader
   * @public
   * @static
   * @param {string} label The HTTP header label
   * @param {string} value The HTTP header value
   * @param {string} isDefault Determines if the specific header is a default header
   * automatically sent with each transaction.
   * @return {void}
   */
	initHeader:function(label, value, isDefault)
	{
		var headerObj = (isDefault)?this._default_headers:this._http_headers;
		headerObj[label] = value;

		if(isDefault){
			this._has_default_headers = true;
		}
		else{
			this._has_http_headers = true;
		}
	},


  /**
   * @description Accessor that sets the HTTP headers for each transaction.
   * @method setHeader
   * @private
   * @static
   * @param {object} o The connection object for the transaction.
   * @return {void}
   */
	setHeader:function(o)
	{
		if(this._has_default_headers){
			for(var prop in this._default_headers){
				if(YAHOO.lang.hasOwnProperty(this._default_headers, prop)){
					o.conn.setRequestHeader(prop, this._default_headers[prop]);
				}
			}
		}

		if(this._has_http_headers){
			for(var prop in this._http_headers){
				if(YAHOO.lang.hasOwnProperty(this._http_headers, prop)){
					o.conn.setRequestHeader(prop, this._http_headers[prop]);
				}
			}
			delete this._http_headers;

			this._http_headers = {};
			this._has_http_headers = false;
		}
	},

  /**
   * @description Resets the default HTTP headers object
   * @method resetDefaultHeaders
   * @public
   * @static
   * @return {void}
   */
	resetDefaultHeaders:function(){
		delete this._default_headers;
		this._default_headers = {};
		this._has_default_headers = false;
	},

  /**
   * @description This method assembles the form label and value pairs and
   * constructs an encoded string.
   * asyncRequest() will automatically initialize the transaction with a
   * a HTTP header Content-Type of application/x-www-form-urlencoded.
   * @method setForm
   * @public
   * @static
   * @param {string || object} form id or name attribute, or form object.
   * @param {boolean} optional enable file upload.
   * @param {boolean} optional enable file upload over SSL in IE only.
   * @return {string} string of the HTML form field name and value pairs..
   */
	setForm:function(formId, isUpload, secureUri)
	{
		// reset the HTML form data and state properties
		this.resetFormState();

		var oForm;
		if(typeof formId == 'string'){
			// Determine if the argument is a form id or a form name.
			// Note form name usage is deprecated, but supported
			// here for backward compatibility.
			oForm = (document.getElementById(formId) || document.forms[formId]);
		}
		else if(typeof formId == 'object'){
			// Treat argument as an HTML form object.
			oForm = formId;
		}
		else{
			return;
		}

		// If the isUpload argument is true, setForm will call createFrame to initialize
		// an iframe as the form target.
		//
		// The argument secureURI is also required by IE in SSL environments
		// where the secureURI string is a fully qualified HTTP path, used to set the source
		// of the iframe, to a stub resource in the same domain.
		if(isUpload){

			// Create iframe in preparation for file upload.
			var io = this.createFrame((window.location.href.toLowerCase().indexOf("https") === 0 || secureUri)?true:false);
			// Set form reference and file upload properties to true.
			this._isFormSubmit = true;
			this._isFileUpload = true;
			this._formNode = oForm;

			return;

		}

		var oElement, oName, oValue, oDisabled;
		var hasSubmit = false;

		// Iterate over the form elements collection to construct the
		// label-value pairs.
		for (var i=0; i<oForm.elements.length; i++){
			oElement = oForm.elements[i];
			oDisabled = oElement.disabled;
			oName = oElement.name;
			oValue = oElement.value;

			// Do not submit fields that are disabled or
			// do not have a name attribute value.
			if(!oDisabled && oName)
			{
				switch(oElement.type)
				{
					case 'select-one':
					case 'select-multiple':
						for(var j=0; j<oElement.options.length; j++){
							if(oElement.options[j].selected){
								if(window.ActiveXObject){
									this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text) + '&';
								}
								else{
									this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';
								}
							}
						}
						break;
					case 'radio':
					case 'checkbox':
						if(oElement.checked){
							this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
						}
						break;
					case 'file':
						// stub case as XMLHttpRequest will only send the file path as a string.
					case undefined:
						// stub case for fieldset element which returns undefined.
					case 'reset':
						// stub case for input type reset button.
					case 'button':
						// stub case for input type button elements.
						break;
					case 'submit':
						if(hasSubmit === false){
							if(this._hasSubmitListener && this._submitElementValue){
								this._sFormData += this._submitElementValue + '&';
							}
							else{
								this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
							}

							hasSubmit = true;
						}
						break;
					default:
						this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
				}
			}
		}

		this._isFormSubmit = true;
		this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);


		this.initHeader('Content-Type', this._default_form_header);

		return this._sFormData;
	},

  /**
   * @description Resets HTML form properties when an HTML form or HTML form
   * with file upload transaction is sent.
   * @method resetFormState
   * @private
   * @static
   * @return {void}
   */
	resetFormState:function(){
		this._isFormSubmit = false;
		this._isFileUpload = false;
		this._formNode = null;
		this._sFormData = "";
	},

  /**
   * @description Creates an iframe to be used for form file uploads.  It is remove from the
   * document upon completion of the upload transaction.
   * @method createFrame
   * @private
   * @static
   * @param {string} optional qualified path of iframe resource for SSL in IE.
   * @return {void}
   */
	createFrame:function(secureUri){

		// IE does not allow the setting of id and name attributes as object
		// properties via createElement().  A different iframe creation
		// pattern is required for IE.
		var frameId = 'yuiIO' + this._transaction_id;
		var io;
		if(window.ActiveXObject){
			io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');

			// 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<l; i=i+1) {
                h.removeChild(n[i]);
            }
        }
        q.nodes = [];
    };

    /**
     * Saves the state for the request and begins loading
     * the requested urls
     * @method queue
     * @param type {string} the type of node to insert
     * @param url {string} the url to load
     * @param opts the hash of options for this request
     * @private
     */
    var _queue = function(type, url, opts) {

        var id = "q" + (qidx++);
        opts = opts || {};

        if (qidx % YAHOO.util.Get.PURGE_THRESH === 0) {
            _autoPurge();
        }

        queues[id] = lang.merge(opts, {
            tId: id,
            type: type,
            url: url,
            finished: false,
            nodes: []
        });

        var q = queues[id];
        q.win = q.win || window;
        q.scope = q.scope || q.win;
        q.autopurge = ("autopurge" in q) ? q.autopurge : 
                      (type === "script") ? true : false;

        lang.later(0, q, _next, id);

        return {
            tId: id
        };
    };

    /**
     * Detects when a node has been loaded.  In the case of
     * script nodes, this does not guarantee that contained
     * script is ready to use.
     * @method _track
     * @param type {string} the type of node to track
     * @param n {HTMLElement} the node to track
     * @param id {string} the id of the request
     * @param url {string} the url that is being loaded
     * @param win {Window} the targeted window
     * @param qlength the number of remaining items in the queue,
     * including this one
     * @param trackfn {Function} function to execute when finished
     * the default is _next
     * @private
     */
    var _track = function(type, n, id, url, win, qlength, trackfn) {
        var f = trackfn || _next;

        // IE supports the readystatechange event for script and css nodes
        if (ua.ie) {
            n.onreadystatechange = function() {
                var rs = this.readyState;
                if ("loaded" === rs || "complete" === rs) {
                    f(id, url);
                }
            };

        // webkit prior to 3.x is problemmatic
        } else if (ua.webkit) {

            if (type === "script") {

                // Safari 3.x supports the load event for script nodes (DOM2)
                if (ua.webkit >= 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<l; i=i+1) {
                                w = w[a[i]];
                                if (!w) {
                                    // if we have exausted our attempts, give up
                                    this.attempts++;
                                    if (this.attempts++ > 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: 
         * <dl>
         * <dt>onSuccess</dt>
         * <dd>
         * callback to execute when the script(s) are finished loading
         * The callback receives an object back with the following
         * data:
         * <dl>
         * <dt>win</dt>
         * <dd>the window the script(s) were inserted into</dd>
         * <dt>data</dt>
         * <dd>the data object passed in when the request was made</dd>
         * <dt>nodes</dt>
         * <dd>An array containing references to the nodes that were
         * inserted</dd>
         * <dt>purge</dt>
         * <dd>A function that, when executed, will remove the nodes
         * that were inserted</dd>
         * <dt>
         * </dl>
         * </dd>
         * <dt>onFailure</dt>
         * <dd>
         * callback to execute when the script load operation fails
         * The callback receives an object back with the following
         * data:
         * <dl>
         * <dt>win</dt>
         * <dd>the window the script(s) were inserted into</dd>
         * <dt>data</dt>
         * <dd>the data object passed in when the request was made</dd>
         * <dt>nodes</dt>
         * <dd>An array containing references to the nodes that were
         * inserted successfully</dd>
         * <dt>purge</dt>
         * <dd>A function that, when executed, will remove any nodes
         * that were inserted</dd>
         * <dt>
         * </dl>
         * </dd>
         * <dt>scope</dt>
         * <dd>the execution context for the callbacks</dd>
         * <dt>win</dt>
         * <dd>a window other than the one the utility occupies</dd>
         * <dt>autopurge</dt>
         * <dd>
         * setting to true will let the utilities cleanup routine purge 
         * the script once loaded
         * </dd>
         * <dt>data</dt>
         * <dd>
         * data that is supplied to the callback when the script(s) are
         * loaded.
         * </dd>
         * <dt>varName</dt>
         * <dd>
         * 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.
         * </dd>
         * <dt>insertBefore</dt>
         * <dd>node or node id that will become the new node's nextSibling</dd>
         * </dl>
         * <dt>charset</dt>
         * <dd>Node charset, default utf-8</dd>
         * <pre>
         * // assumes yahoo, dom, and event are already on the page
         * &nbsp;&nbsp;YAHOO.util.Get.script(
         * &nbsp;&nbsp;["http://yui.yahooapis.com/2.3.1/build/dragdrop/dragdrop-min.js",
         * &nbsp;&nbsp;&nbsp;"http://yui.yahooapis.com/2.3.1/build/animation/animation-min.js"], &#123;
         * &nbsp;&nbsp;&nbsp;&nbsp;onSuccess: function(o) &#123;
         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log("won't cause error because YAHOO is the scope");
         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.log(o.nodes.length === 2) // true
         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// o.purge(); // optionally remove the script nodes immediately
         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
         * &nbsp;&nbsp;&nbsp;&nbsp;onFailure: function(o) &#123;
         * &nbsp;&nbsp;&nbsp;&nbsp;&#125;,
         * &nbsp;&nbsp;&nbsp;&nbsp;data: "foo",
         * &nbsp;&nbsp;&nbsp;&nbsp;scope: YAHOO,
         * &nbsp;&nbsp;&nbsp;&nbsp;// win: otherframe // target another window/frame
         * &nbsp;&nbsp;&nbsp;&nbsp;autopurge: true // allow the utility to choose when to remove the nodes
         * &nbsp;&nbsp;&#125;);
         * </pre>
         * @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: 
         * <dl>
         * <dt>onSuccess</dt>
         * <dd>
         * callback to execute when the css file(s) are finished loading
         * The callback receives an object back with the following
         * data:
         * <dl>win</dl>
         * <dd>the window the link nodes(s) were inserted into</dd>
         * <dt>data</dt>
         * <dd>the data object passed in when the request was made</dd>
         * <dt>nodes</dt>
         * <dd>An array containing references to the nodes that were
         * inserted</dd>
         * <dt>purge</dt>
         * <dd>A function that, when executed, will remove the nodes
         * that were inserted</dd>
         * <dt>
         * </dl>
         * </dd>
         * <dt>scope</dt>
         * <dd>the execution context for the callbacks</dd>
         * <dt>win</dt>
         * <dd>a window other than the one the utility occupies</dd>
         * <dt>data</dt>
         * <dd>
         * data that is supplied to the callbacks when the nodes(s) are
         * loaded.
         * </dd>
         * <dt>insertBefore</dt>
         * <dd>node or node id that will become the new node's nextSibling</dd>
         * <dt>charset</dt>
         * <dd>Node charset, default utf-8</dd>
         * </dl>
         * <pre>
         *      YAHOO.util.Get.css("http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css");
         * </pre>
         * <pre>
         *      YAHOO.util.Get.css(["http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css",
         * </pre>
         * @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&#20803;",COP:"CO $%.2f",DKK:"kr %.2f",EUR:"&euro; %.2f","EUR-at":"%.2f &euro;","EUR-be":"%.2f &euro;","EUR-de":"%.2f &euro;","EUR-fr":"%.2f &euro;","EUR-pt":"%.2f &euro;","EUR-es":"%.2f &euro;",GBP:"UK &pound;%.2f",HKD:"HK $%.2f",INR:"Rs. %.2f",JPY:"%d &#20870;",KRW:"&#8361; %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&#20803;",COP:"$%.2f",DKK:"kr %.2f",EUR:"&euro; %.2f","EUR-at":"%.2f &euro;","EUR-be":"%.2f &euro;","EUR-de":"%.2f &euro;","EUR-fr":"%.2f &euro;","EUR-pt":"%.2f &euro;","EUR-es":"%.2f &euro;",GBP:"&pound; %.2f",HKD:"$%.2f",INR:"Rs. %.2f",JPY:"%d &#20870;",KRW:"&#8361; %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&&currency_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<arguments.length;i++)new_args[i]=arguments[i];for(var event_name=new_args.shift(),list=F.array_copy(this._eb_listeners),max=list.length,i=0;i<max;++i)list[i][event_name]&&list[i][event_name].apply(list[i],new_args)},eb_add:function(obj){return this.eb_remove(obj),this._eb_listeners.push(obj),!0},eb_remove:function(obj){for(var list=this._eb_listeners,i=list.length;i--;)if(list[i]==obj)return list.splice(i,1),!0;return!1},eb_remove_all:function(){this._eb_listeners=[]}},F.decorate(F,F._eb).eb_go_go_go(),F.toggleClass=function(el,className){el=_ge(el);return Y.U.Dom.hasClass(el,className)?Y.U.Dom.removeClass(el,className):Y.U.Dom.addClass(el,className),!1},F.prepare_for_insertion=function(el){return!el.parentNode||F.is_ie?el:el.parentNode.removeChild(el)},F.get_local_X=function(el){return el.style.left?_pi(el.style.left):el.offsetLeft},F.get_local_Y=function(el){return el.style.top?_pi(el.style.top):el.offsetTop},F._paginator={paginator_go_go_go:function(){F.decorate(this,F._eb).eb_go_go_go(),this.paginator_hide(),this.pages=0,this.page=0,this.side_slots=2,this.middle_slots=7,this.pagesA=[],this.total_slots=2*this.side_slots+this.middle_slots;var html='<nobr><a id="paginator_link_prev" href="" class="Prev" onclick="_ge(\''+this.id+'\').paginator_go_prev(); this.blur(); return false;">&lt; Prev</a><a id="paginator_link_1" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_2" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><span id="paginator_break_1" class="break">...</span><a id="paginator_link_3" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_4" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_5" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_6" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_7" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_8" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_9" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><span id="paginator_break_2" class="break">...</span><a id="paginator_link_10" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_11" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_next" href="" class="Next" onclick="_ge(\''+this.id+"').paginator_go_next(); this.blur(); return false;\">Next &gt;</a></nobr>";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++)0<this.pagesA[i-1]&&(this.pagesA[i-1]=i);for(i=1;i<=this.side_slots;i++){var index=this.pagesA.length-i;this.pagesA[index]=this.pages-i+1}writeDebug(this.pagesA.join(",")),this.paginator_draw()}},paginator_draw:function(){this.paginator_hide_break(1),this.paginator_hide_break(2);for(var i=1;i<=this.total_slots;i++)this.paginator_hide_link(i);for(var k=0,i=0;i<this.pagesA.length;i++){var p=this.pagesA[i];p<1||(k++,this.paginator_show_link(k,p),2==k&&this.pagesA[i+1]&&this.pagesA[i+1]>p+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)?'<table class="shadow_table" cellpadding="0" cellspacing="0" border="0" style="padding:0px;"><tr><td width="11"><img class="trans_png" width="11" height="11" src="'+_images_root+'/tc_white_shadow_tl.png"></td><td id="'+this.id+'_width_controller"><img class="trans_png" width="100%" height="11" src="'+_images_root+'/tc_white_shadow_t.png"></td><td width="11"><img class="trans_png" width="11" height="11" src="'+_images_root+'/tc_white_shadow_tr.png"></td></tr><tr><td height="30" id="'+this.id+'_height_controller"><img class="trans_png" width="11" height="100%" src="'+_images_root+'/tc_white_shadow_l.png"></td><td></td><td><img class="trans_png" width="11" height="100%" src="'+_images_root+'/tc_white_shadow_r.png"></td></tr><tr><td><img class="trans_png" width="11" height="11" src="'+_images_root+'/tc_white_shadow_bl.png"></td><td><img class="trans_png" width="100%" height="11" src="'+_images_root+'/tc_white_shadow_b.png"></td><td><img class="trans_png" width="11" height="11" src="'+_images_root+'/tc_white_shadow_br.png"></td></tr></table>':'<table class="shadow_table" cellpadding="0" cellspacing="0" border="0" style="padding:0px;"><tr><td width="11"><img width="11" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_tl"></td><td id="'+this.id+'_width_controller"><img width="100%" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_t"></td><td width="11"><img width="11" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_tr"></td></tr><tr><td height="30" id="'+this.id+'_height_controller"><img width="11" height="100%" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_l"></td><td></td><td><img width="11" height="100%" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_r"></td></tr><tr><td><img width="11" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_bl"></td><td><img width="100%" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_b"></td><td><img width="11" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_br"></td></tr></table>',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="&nbsp;&nbsp;&nbsp;"+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<show_num;i++){var url,onclick,style="margin-top:3px;";"site"!=this.page_type&&"explore"!=this.page_type&&"places_home"!=this.page_type||_ge("div_force_header_location_search")?(style+=i==this.current_location_index?"font-weight:bold; text-decoration:none":"",onclick="_ge('"+this.id+"').div_on_result_click("+i+"); return false;",url="else"==this.page_type||"world_map"==this.page_type||_ge("div_force_header_location_search")?"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="+this.locations[i].id+"&woe_sub_title="+escape(this.locations[i].sub_title):"/map?place_id="+this.locations[i].id:"GeocodedBuilding"==this.locations[i].precision||"POI"==this.locations[i].precision?"/photos/organize/?start_tab=map&fLat="+this.locations[i].lat+"&fLon="+this.locations[i].lon+"&zl=2&place_id="+this.locations[i].id+"&woe_sub_title="+escape(this.locations[i].sub_title):"/photos/organize/?start_tab=map&fLat="+this.locations[i].lat+"&fLon="+this.locations[i].lon+"&zl=2"):(url=_ge("world_map")||_ge("f_div_photo_ribbon_holder")?_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="+this.locations[i].id+"&woe_sub_title="+escape(this.locations[i].sub_title):"/map?place_id="+this.locations[i].id,onclick="_ge('"+this.id+"').div_hide(); _ge('"+this.id+"').div_log('"+this.locations[i].id+"', this.href); return false");var html='<div style="margin-bottom:7px; font-size:12px; font-family:arial">';F.is_ie&&(url=encodeURI(url)),_ge("world_map")||_ge("f_div_photo_ribbon_holder")?(html+='<a href="'+url+'" style="'+style+'" onclick="'+onclick+'">',this.locations[i].title&&(html+='<span class="loc_search_found_term">'+this.locations[i].title+"</span>, ")):(this.locations[i].title&&(html+='<span class="loc_search_found_term">'+this.locations[i].title+"</span>, "),html+='<a href="'+url+'" style="'+style+'" onclick="'+onclick+'">'),html+=" "+this.locations[i].sub_title+"</a>",""!=this.locations[i].place_disambiguate&&(html+=" ("+this.locations[i].place_disambiguate+")"),html+="</div>",htmlA.push(html)}this.locations.length>show_num&&htmlA.push('<br><b><a href="#" onclick="_ge(\''+this.id+"').div_update_results(1); return false;\">"+F.output.get("loc_results_more")+"</a></b>"),_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<results.length;i++){try{var precision=String(results[i].getAttribute("precision"))}catch(er){precision=""}try{var relevance=String(results[i].getElementsByTagName("woe_specificprobability")[0].firstChild.nodeValue)}catch(er){relevance=""}try{var woeid=String(results[i].getElementsByTagName("woe_woeid")[0].firstChild.nodeValue)}catch(er){woeid=""}var lat=String(results[i].getElementsByTagName("Latitude")[0].firstChild.nodeValue),this_location=String(results[i].getElementsByTagName("Longitude")[0].firstChild.nodeValue);try{var bbox=String(results[i].getElementsByTagName("woe_bbox")[0].firstChild.nodeValue)}catch(er){bbox=""}try{var address=String(results[i].getElementsByTagName("Address")[0].firstChild.nodeValue)}catch(er){address=""}try{var neighbourhood=String(results[i].getElementsByTagName("Neighbourhood")[0].firstChild.nodeValue)}catch(er){neighbourhood=""}try{var city=String(results[i].getElementsByTagName("City")[0].firstChild.nodeValue)}catch(er){city=""}try{var state=String(results[i].getElementsByTagName("State")[0].firstChild.nodeValue)}catch(er){state=""}try{String(results[i].getElementsByTagName("Zip")[0].firstChild.nodeValue)}catch(er){}try{var country=String(results[i].getElementsByTagName("Country")[0].firstChild.nodeValue)}catch(er){country=""}try{var place_url=String(results[i].getElementsByTagName("place_url")[0].firstChild.nodeValue)}catch(er){place_url=""}try{var place_disambiguate=String(results[i].getElementsByTagName("place_disambiguate")[0].firstChild.nodeValue)}catch(er){place_disambiguate=""}country="United Kingdom"==(country="United States"==country?"US":country)?"UK":country;var title="",sub_title="",use_term=this.last_search_term.trim().split(" ")[0].split(",")[0],test_term=use_term.toLowerCase();"GeocodedBuilding"!=precision&&"POI"!=precision||address&&(sub_title=sub_title+", "+address),neighbourhood&&neighbourhood!=city&&(sub_title=sub_title+", "+neighbourhood),city&&(sub_title=sub_title+", "+city),state&&(sub_title=sub_title+", "+state),2<(sub_title=country?sub_title+", "+country:sub_title).length&&(sub_title=sub_title.substring(2,sub_title.length)),"County"==precision?title=use_term.substring(0,1).toUpperCase()+use_term.substring(1,use_term.length)+" County":"GeocodedBuilding"==precision?sub_title=use_term+" "+sub_title:"POI"==precision?sub_title=this.last_search_term+", "+sub_title:(sub_titleA=sub_title.split(", "),test_term==sub_titleA[0].toLowerCase()&&sub_titleA[0]!=sub_title&&(title=sub_titleA[0],sub_title=sub_title.replace_global(sub_titleA[0]+", ","")));this_location=new woe_location_obj(woeid,title,sub_title,relevance,bbox,precision,lat,this_location,place_url,place_disambiguate);"/"!=this_location.place_url&&this.locations.push(this_location)}this.current_location_index=-1,this.div_update_results(),1==this.locations.length?(this.current_location_index=0,"site"!=this.page_type&&"explore"!=this.page_type&&"places_home"!=this.place_type||_ge("div_force_header_location_search")?(id=this.id,setTimeout(function(){_ge(id).focus_on_location()},50)):_ge("world_map")?this.div_go_to_place(0,0):this.div_go_to_map(0,0)):0<this.locations.length&&.85<_pf(this.locations[0].relevance)&&"places_world"==this.page_type&&(this.current_location_index=0,id=this.id,setTimeout(function(){_ge(id).focus_on_location()},50))}else this.div_update_results()}else writeDebug("Something sucked")},F._loc_search_div.focus_on_location=function(){var map_funcs;if(window.YGeoPoint?map_funcs={point:YGeoPoint,bbox:null,panAndZoom:"drawZoomAndCenter",getCenter:"getCenterLatLon",getZoom:"getZoomLevel",zoomToBounds:null,poiZoom:2}:window.L&&window.L.Map&&(map_funcs={point:L.LatLng,bbox:L.LatLngBounds,panAndZoom:"setView",getCenter:"getCenter",getZoom:"getZoom",zoomToBounds:"fitBounds",poiZoom:17}),null!=map_funcs&&"site"!=this.page_type&&"places_home"!=this.page_type||_ge("div_force_header_location_search")){var woe_loc=this.locations[this.current_location_index];if("places_world"!=this.page_type){if(1!=this.locations.length||"GeocodedBuilding"!=woe_loc.precision&&"POI"!=woe_loc.precision){this.best_fit_points=[],woe_loc.bbox?(this.best_fit_points.push(new map_funcs.point(woe_loc.bbox.split(",")[1],woe_loc.bbox.split(",")[0])),this.best_fit_points.push(new map_funcs.point(woe_loc.bbox.split(",")[3],woe_loc.bbox.split(",")[2]))):this.best_fit_points.push(new map_funcs.point(woe_loc.lat,woe_loc.lon));var temp_best_fit_points=[];for(i=0;i<this.best_fit_points.length;i++)temp_best_fit_points.push(this.best_fit_points[i]);if(_ge("f_div_photo_ribbon_holder"))map_funcs.zoomToBounds?ymap[map_funcs.zoomToBounds](new map_funcs.bbox(temp_best_fit_points)):(new_zoom_level=map_controller.ymap[map_funcs.getZoom](temp_best_fit_points),"GeocodedStreet"!=woe_loc.precision?(new_zoom_level=Math.max(5,new_zoom_level),new_geobox=map_controller.ymap.getGeoBox(temp_best_fit_points),new_geobox_center=map_controller.ymap.getBoxGeoCenter(new_geobox.min,new_geobox.max)):(new_geobox_center=new map_funcs.point(woe_loc.lat,woe_loc.lon),new_zoom_level=3),map_controller.ymap[map_funcs.panAndZoom](new_geobox_center,new_zoom_level),_ge("f_inpt_search_what").value=F.output.get("numap_amazing_photos"),_ge("f_inpt_search_where").value=F.output.get("numap_this_map"),_ge("f_div_search_mode_tab")&&(_ge("f_div_search_mode_tab").firstest_time_ever=!1),"object"==typeof map_controller&&(map_controller.from_top_search=!0),_ge("f_div_search_mode_tab").do_search());else if(_ge("div_force_header_location_search"))map_funcs.zoomToBounds?ymap[map_funcs.zoomToBounds](new map_funcs.bbox(temp_best_fit_points)):(old_center=drag_map.ymap[map_funcs.getCenter](),new_zoom_level=drag_map.ymap[map_funcs.getZoom](temp_best_fit_points),"GeocodedStreet"!=woe_loc.precision?(new_zoom_level=Math.max(5,new_zoom_level),new_geobox=drag_map.ymap.getGeoBox(temp_best_fit_points),new_geobox_center=drag_map.ymap.getBoxGeoCenter(new_geobox.min,new_geobox.max)):(new_geobox_center=new map_funcs.point(woe_loc.lat,woe_loc.lon),new_zoom_level=3),old_center.Lon==new_geobox_center.Lon&&old_center.Lat==new_geobox_center.Lat&&drag_map.ymap[map_funcs.getZoom]()==new_zoom_level||(drag_map.ymap[map_funcs.panAndZoom](new_geobox_center,new_zoom_level),drag_map.end_pan()));else if(map_funcs.zoomToBounds){var dots=_ge("map_controller").dots;if(dots)for(var id in dots)-1<id.indexOf("dot_holder")&&dots.hasOwnProperty(id)&&dots[id].show(!1);ymap[map_funcs.zoomToBounds](new map_funcs.bbox(temp_best_fit_points))}else{var new_geobox,new_geobox_center,old_center=ymap[map_funcs.getCenter](),new_zoom_level=ymap[map_funcs.getZoom](temp_best_fit_points);_ge("you_are_here_holder").show(!1,""),"GeocodedStreet"!=woe_loc.precision?(new_zoom_level=Math.max(5,new_zoom_level),new_geobox=ymap.getGeoBox(temp_best_fit_points),new_geobox_center=ymap.getBoxGeoCenter(new_geobox.min,new_geobox.max)):(new_geobox_center=new map_funcs.point(woe_loc.lat,woe_loc.lon),new_zoom_level=3),old_center.Lon==new_geobox_center.Lon&&old_center.Lat==new_geobox_center.Lat&&ymap[map_funcs.getZoom]()==new_zoom_level||(ymap[map_funcs.panAndZoom](new_geobox_center,new_zoom_level),_ge("map_controller").end_pan())}}else{var old_center,new_zoom_level=map_funcs.poiZoom;_ge("f_div_photo_ribbon_holder")?(map_controller.ymap[map_funcs.panAndZoom](new map_funcs.point(woe_loc.lat,woe_loc.lon),new_zoom_level),_ge("f_inpt_search_what").value=F.output.get("numap_amazing_photos"),_ge("f_inpt_search_where").value=F.output.get("numap_this_map"),_ge("f_div_search_mode_tab")&&(_ge("f_div_search_mode_tab").firstest_time_ever=!1),"object"==typeof map_controller&&(map_controller.from_top_search=!0),_ge("f_div_search_mode_tab").do_search()):_ge("div_force_header_location_search")?(old_center=drag_map.ymap[map_funcs.getCenter]()).Lon==woe_loc.lon&&old_center.Lat==woe_loc.lat&&drag_map.ymap[map_funcs.getZoom]()==new_zoom_level||(drag_map.ymap[map_funcs.panAndZoom](new map_funcs.point(woe_loc.lat,woe_loc.lon),new_zoom_level),drag_map.end_pan()):(old_center=ymap[map_funcs.getCenter](),_ge("you_are_here_holder").setYGeoPoint(new map_funcs.point(woe_loc.lat,woe_loc.lon),new_zoom_level),_ge("you_are_here_holder").show(!0,woe_loc.sub_title),old_center.Lon==woe_loc.lon&&old_center.Lat==woe_loc.lat&&ymap[map_funcs.getZoom]()==new_zoom_level||(ymap[map_funcs.panAndZoom](new map_funcs.point(woe_loc.lat,woe_loc.lon),new_zoom_level),_ge("map_controller").end_pan()))}this.setLocation_geo_point=new map_funcs.point(woe_loc.lat,woe_loc.lon),this.setLocation_source_id=this.last_source_id,this.setLocation_search_term=this.last_search_term,this.div_log(woe_loc.id)}else""!=_ge("txt_search_for").value&&_ge("txt_search_for").value!=places.defaults.search_for?_ge("user_places_is_go")?window.location="photos/"+_ge("user_places_is_go").innerHTML+"/places"+woe_loc.place_url+"/?q="+_ge("txt_search_for").value:window.location="/places"+woe_loc.place_url+"/?q="+_ge("txt_search_for").value:alert("here")}},F._loc_search_div.div_log=function(result_id,url_to_go_to){this.provider_name&&"yahoo"==this.provider_name.toLowerCase()||this.locations.length<2&&"places_home"!=this.page_type||!result_id&&this.logged_last||(this.logged_last=1,F.API.callMethod("flickr.geocode.log",{query:this.last_search_term,result_id:result_id,provider_name:this.provider_name},{flickr_geocode_log_onLoad:function(){url_to_go_to&&(document.location=url_to_go_to)}}))},F._canvas={canvas_go_go_go:function(w,h){null!=w&&(this.width=w,this.style.width=w+"px"),null!=h&&(this.height=h,this.style.height=h+"px"),F.is_ie&&!this.getContext&&G_vmlCanvasManager_.initElement(this)},rounded_rect:function(x,y,w,h,r){var ctx=this.getContext("2d");ctx.beginPath(),ctx.moveTo(x,y+r),ctx.lineTo(x,y+h-r),ctx.quadraticCurveTo(x,y+h,x+r,y+h),ctx.lineTo(x+w-r,y+h),ctx.quadraticCurveTo(x+w,y+h,x+w,y+h-r),ctx.lineTo(x+w,y+r),ctx.quadraticCurveTo(x+w,y,x+w-r,y),ctx.lineTo(x+r,y),ctx.quadraticCurveTo(x,y,x,y+r),ctx.stroke()}},F._simple_button={button_disabled:0,button_go_go_go:function(img_name_root){if((this.EXT=this).style.cursor=F.is_ie?"hand":"pointer","IMG"==this.tagName)this.img_id=this.id;else for(var i=0;i<this.childNodes.length;i++){var el=this.childNodes[i];"IMG"==el.tagName?(el.id||(el.id=this.id+"IMG"),this.img_id=el.id):"SPAN"==el.tagName&&(el.id||(el.id=this.id+"SPAN"),this.span_id=el.id)}if(this.img_id){this.button_has_disabled_src=img_name_root?1:0;var img=this.button_get_img();this.img_format=img.src.split(".")[img.src.split(".").length-1],/v[0-9]+/.test(this.img_format)&&(this.img_format=img.src.split(".")[img.src.split(".").length-2]);img_name_root=img.src.split("/"),img_name_root=img_name_root[img_name_root.length-1];this.img_path_root=img.src.replace_global("/"+img_name_root,"");img_name_root=img_name_root.split("_default."+this.img_format)[0];return this.button_set_img_srcs(img_name_root),"png"==this.img_format&&(img.className="trans_png"),this.button_is_down=0,this.button_is_over=0,this.addEventListener("click",this.button_default_onclick,!1),this}},button_get_img:function(){return _ge(this.img_id)},button_get_span:function(){return _ge(this.span_id)},button_set_img_srcs_and_change:function(img_name_root){this.button_set_img_srcs(img_name_root),this.button_change_src()},button_set_text:function(txt){var span=this.button_get_span();span&&(span.innerHTML=txt)},button_set_img_srcs:function(img_name_root){this.button_default_img={},this.button_default_img.src=this.img_path_root+"/"+img_name_root+"_default."+this.img_format,this.button_hover_img={},this.button_hover_img.src=this.img_path_root+"/"+img_name_root+"_hover."+this.img_format,this.button_selected_img={},this.button_selected_img.src=this.img_path_root+"/"+img_name_root+"_selected."+this.img_format,F.preload_images(this.button_default_img.src,this.button_hover_img.src,this.button_selected_img.src),this.button_has_disabled_src?(this.button_disabled_img={},this.button_disabled_img.src=this.img_path_root+"/"+img_name_root+"_disabled."+this.img_format,F.preload_images(this.button_disabled_img.src)):this.button_disabled_img=this.button_default_img},button_change_src:function(){var new_src=this.button_default_img.src;this.button_disabled?new_src=this.button_disabled_img.src:this.button_is_down?new_src=this.button_selected_img.src:this.button_is_over&&(new_src=this.button_hover_img.src);var button_img=this.button_get_img();button_img&&(button_img.src=new_src)},button_enable:function(){this.button_disabled=0,this.button_change_src(),"A"==this.tagName&&(this.className=this.className.replace_global("_disabled",""))},button_disable:function(){this.button_disabled||(this.button_disabled=1,this.button_is_over=0,this.button_is_down=0,this.button_change_src(),"A"==this.tagName&&(this.className=this.className+"_disabled"))},onmouseover:function(){this.button_disabled||(this.button_is_over=1,this.button_change_src())},onmouseout:function(){this.button_disabled||(this.button_is_over=0,this.button_is_down=0,this.button_change_src())},onmousedown:function(){this.button_disabled||(this.button_is_over=1,this.button_is_down=1,this.button_change_src())},onmouseup:function(){this.button_disabled||(this.button_is_over=1,this.button_is_down=0,this.button_change_src())},button_default_onclick:function(e){return this.blur(),!1}},F._link_button={_decotype:F._simple_button,button_go_go_go:function(){F._link_button._decotype.button_go_go_go.apply(this)},button_default_onclick:function(e){return this.blur(),!0}},F._button_bar={bar_go_go_go:function(){if(this.bar_button)for(var menu_buttons=Y.U.Dom.getElementsByClassName("menu_li","li",this),i=0;i<menu_buttons.length;i++)F.decorate(menu_buttons[i],this.bar_button).button_go_go_go()}},F._l10n_button={button_go_go_go:function(){this.button_menu_id=this.id.replace_global("button","menu"),this.button_form_id=this.id.replace_global("button","form");var button,a=_ge(this.button_form_id);a&&(button=this,a.addEventListener("submit",function(e){e.preventDefault(),button.button_close()},!1)),this.button_is_open=0,this.button_is_split=-1<this.button_get_img().src.indexOf("_split")?1:0,this.onclick_default=function(){},this.onclick=this.onclick_handler;a=this.button_get_a();a&&(a.onclick_default=null)},button_get_img:function(){return"IMG"==this.tagName?this:this.getElementsByTagName("img")[0]},button_get_src:function(which){which=which||"default";var split=this.button_is_split?"split_":"";return _images_root+"/"+this.button_img_root+split+which+"."+this.button_img_ext},button_close:function(and_hover){var img=this.button_get_img();Y.U.Dom.removeClass(this,"selected"),and_hover?img.src=this.button_get_src("hover"):(Y.U.Dom.removeClass(this,"hover"),img.src=this.button_get_src()),_ge(this.button_menu_id).style.display="none",this.button_is_open=0,document.onmousedown=null,F.eb_broadcast("stewart_play_if_was_playing")},button_disable:function(){this.onmouseout(),this.button_is_disabled=1},button_undisable:function(){this.button_is_disabled=0},button_go_down:function(which){"both"!=(which=which||"both")&&"left"!=which||Y.U.Dom.addClass(this,"selected"),"both"!=which&&"right"!=which||(this.button_get_img().src=this.button_get_src("selected"))},button_open:function(){this.button_is_split?this.button_go_down("right"):this.button_go_down();var button,menu_el=_ge(this.button_menu_id);menu_el&&(menu_el.style.display="block",this.button_is_open=1,F.eb_broadcast("stewart_pause"),button=this,document.onmousedown=function(e){var el=_get_event_src(e),is_child=0;if(el.parentNode)for(;el.parentNode;){if(el.parentNode==button){is_child=1;break}el=el.parentNode}is_child||button.button_close()})},button_swap_image_if_needed:function(e,which){var img=this.button_get_img();if(img&&(_get_event_src(e)==img||this.button_always_swap_img))return img.src=this.button_get_src(which),1;return 0},onmouseover:function(e){this.button_is_disabled||this.button_is_open||(Y.U.Dom.addClass(this,"hover"),this.button_swap_image_if_needed(e,"hover")?Y.U.Dom.removeClass(this,"hover_left"):Y.U.Dom.addClass(this,"hover_left"))},onmouseout:function(e){this.button_is_disabled||this.button_is_open||(this.button_swap_image_if_needed(e,"default"),Y.U.Dom.removeClass(this,"hover"),Y.U.Dom.removeClass(this,"hover_left"),Y.U.Dom.removeClass(this,"selected"))},onmouseup:function(e){_enable_select(),this.button_is_disabled||this.button_is_open||(this.button_swap_image_if_needed(e,"hover"),Y.U.Dom.removeClass(this,"selected"))},onmousedown:function(e){if(!this.button_is_disabled){this.button_is_split?(a=_get_event_src(e))==this.button_get_img()?this.button_go_down("right"):this.button_go_down("left"):this.button_go_down();var a=_get_event_src(e);if(!this.button_click_is_in_menu(a)){a=this.button_get_a();return a&&a.href?void 0:(_disable_select(),!1)}}},onclick_handler:function(should_close){if(this.button_is_disabled)return!1;var aA=_get_event_src(should_close),a=this.button_get_img();if(aA!=a&&this.button_is_split||(this.button_is_open?(should_close=1,(should_close=_ge(this.button_form_id)&&this.button_click_is_in_menu(aA)?0:should_close)&&this.button_close(1)):_ge(this.button_menu_id)&&this.button_open()),(aA!=a||aA==this)&&!this.button_click_is_in_menu(aA)){a=this.button_get_a();if(a){if(a.onclick_default)return a.onclick_default();if(a.href&&aA!=a)return void(document.location=a.href)}else this.onclick_default();if(this.button_is_split){aA=_ge(this.button_menu_id).getElementsByTagName("A");if(aA&&aA[0]){if(aA[0].onclick)return aA[0].onclick();if(aA[0].href){if(a)return a.href||(a.href=aA[0].href),1;document.location=aA[0].href}}}}},button_get_a:function(){var aA=this.getElementsByTagName("A");return aA?aA[0]:null},button_click_is_in_menu:function(el){for(var p=el;p;){if(Y.U.Dom.hasClass(p,"candy_menu"))return 1;if((p=p.parentNode)==this)return 0}return 0}},F._nav_button={_decotype:F._l10n_button,button_always_swap_img:0,button_img_root:"site_nav_caret_",button_img_ext:"png",button_go_go_go:function(){F.preload_images(_images_root+"/site_nav_caret_split_default.png",_images_root+"/site_nav_caret_split_hover.png",_images_root+"/site_nav_caret_split_selected.png"),F._nav_button._decotype.button_go_go_go.apply(this)}},F._gray_menu_button={_decotype:F._l10n_button,button_always_swap_img:1,button_img_root:"gray_button_caret_",button_img_ext:"gif",button_go_go_go:function(){F.preload_images(_images_root+"/gray_button_caret_default.gif",_images_root+"/gray_button_caret_hover.gif",_images_root+"/gray_button_caret_selected.gif",_images_root+"/gray_button_caret_split_default.gif",_images_root+"/gray_button_caret_split_hover.gif",_images_root+"/gray_button_caret_split_selected.gif",_images_root+"/gray_button_bg_hover.gif",_images_root+"/gray_button_bg_selected.gif"),F._gray_menu_button._decotype.button_go_go_go.apply(this)}},F._gray_button={_decotype:F._l10n_button,button_always_swap_img:1,button_img_root:"gray_button_no_caret_",button_img_ext:"gif",button_go_go_go:function(){F.preload_images(_images_root+"/gray_button_no_caret_default.gif",_images_root+"/gray_button_no_caret_hover.gif",_images_root+"/gray_button_no_caret_selected.gif",_images_root+"/gray_button_bg_hover.gif",_images_root+"/gray_button_bg_selected.gif"),F._gray_button._decotype.button_go_go_go.apply(this)}},F._gray_button_bar={_decotype:F._button_bar,bar_button:F._gray_menu_button,bar_go_go_go:function(){for(var menu_buttons=Y.U.Dom.getElementsByClassName("no_menu_li","li",this),i=0;i<menu_buttons.length;i++)F.decorate(menu_buttons[i],F._gray_button).button_go_go_go();F._gray_button_bar._decotype.bar_go_go_go.apply(this)}},F._nav_button_bar={_decotype:F._button_bar,bar_button:F._nav_button},F.str_to_XML=function(str){var xmlDocument;return window.DOMParser?xmlDocument=(new DOMParser).parseFromString(str,"text/xml"):window.ActiveXObject&&((xmlDocument=new ActiveXObject("Microsoft.XMLDOM")).async=!1,xmlDocument.loadXML(str)),xmlDocument.normalize&&xmlDocument.normalize(),xmlDocument},F.make_hoverable=function(trigger_elm,hover_class){trigger_elm.hover_class=hover_class,Y.U.Event.addListener(trigger_elm,"mouseover",F.handle_hoverable_mouseover),Y.U.Event.addListener(trigger_elm,"mouseout",F.handle_hoverable_mouseout)},F.handle_hoverable_mouseover=function(e){Y.U.Dom.addClass(this,this.hover_class)},F.handle_hoverable_mouseout=function(e){Y.U.Dom.removeClass(this,this.hover_class)},F.html_info={show: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='<img src="'+_images_root+'/pulser2.gif" width="32" height="15" border="0">',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='<img src="'+_images_root+'/pulser2.gif" width="32" height="15" border="0">',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="&#9662;"),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="&#9656;"),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;n<len;n++)if(years_we_have_burningman_tiles_for[n]==photo_taken_year){yr=_pi(photo_taken_year);break}"YAHOO_MAP"==map_type&&zl<10&&(-4.3634901047<=lat_lon.Lat&&lat_lon.Lat<=-4.3009300232&&15.2374696732<=lat_lon.Lon&&lat_lon.Lon<=15.3460502625&&(tileReg=!0),2.0093801022<=lat_lon.Lat&&lat_lon.Lat<=2.0614199638&&45.313911438<=lat_lon.Lon&&lat_lon.Lon<=45.3669013977&&(tileReg=!0),-17.8511505127<=lat_lon.Lat&&lat_lon.Lat<=-17.7955493927&&31.021030426<=lat_lon.Lon&&lat_lon.Lon<=31.0794296265&&(tileReg=!0),-1.3546253687<=lat_lon.Lat&&lat_lon.Lat<=-1.1987955811&&36.7169952392<=lat_lon.Lon&&lat_lon.Lon<=36.9593811035&&(tileReg=!0,cache_buster="kibera"),5.5237197876<=lat_lon.Lat&&lat_lon.Lat<=5.5998301506&&-.253580004<=lat_lon.Lon&&lat_lon.Lon<=-.1586299986&&(tileReg=!0),30.0068798065<=lat_lon.Lat&&lat_lon.Lat<=30.1119003296&&31.2149791718<=lat_lon.Lon&&lat_lon.Lon<=31.311170578&&(tileReg=!0),36.699760437<=lat_lon.Lat&&lat_lon.Lat<=36.8181610107&&2.9909501076<=lat_lon.Lon&&lat_lon.Lon<=3.1476099491&&(tileReg=!0),50.3168792725<=lat_lon.Lat&&30.3380508423<=lat_lon.Lon&&lat_lon.Lat<=50.5327110291&&lat_lon.Lon<=30.713060379&&(tileReg=!0),16.4462890625<=lat_lon.Lat&&107.5323104858<=lat_lon.Lon&&lat_lon.Lat<=16.4913291931&&lat_lon.Lon<=107.6173629761&&(tileReg=!0),4.5628199577<=lat_lon.Lat&&-74.1714935303<=lat_lon.Lon&&lat_lon.Lat<=4.7098898888&&lat_lon.Lon<=-74.0556335449&&(tileReg=!0),3.403539896<=lat_lon.Lat&&-76.5521697998<=lat_lon.Lon&&lat_lon.Lat<=3.4737200737&&lat_lon.Lon<=-76.4818496704&&(tileReg=!0),6.2083601952<=lat_lon.Lat&&-75.618598938<=lat_lon.Lon&&lat_lon.Lat<=6.2879300117&&lat_lon.Lon<=-75.5447769165&&(tileReg=!0),zl<9&&(35.46290704974905<=lat_lon.Lat&&lat_lon.Lat<=36.02799998329552&&139.21875<=lat_lon.Lon&&lat_lon.Lon<=140.27069091796875&&(tileReg=!0),17.811454<=lat_lon.Lat&&lat_lon.Lat<=20.179721&&-74.641111<=lat_lon.Lon&&lat_lon.Lon<=-68.225095&&(tileReg=!0),zl<8&&(39.8558502197<=lat_lon.Lat&&lat_lon.Lat<=40.0156097412&&116.2662734985<=lat_lon.Lon&&lat_lon.Lon<=116.4829177856&&(tileReg=!0),-34.6944313049<=lat_lon.Lat&&lat_lon.Lat<=-34.4146499634&&-58.6389389038<=lat_lon.Lon&&lat_lon.Lon<=-58.2992210388&&(tileReg=!0),35.6444816589<=lat_lon.Lat&&lat_lon.Lat<=35.7650184631&&51.3495407104<=lat_lon.Lon&&lat_lon.Lon<=51.4786109924&&(tileReg=!0),20.9743099213<=lat_lon.Lat&&lat_lon.Lat<=21.0687198639&&105.7889633179<=lat_lon.Lon&&lat_lon.Lon<=105.878868103&&(tileReg=!0),10.7326498032<=lat_lon.Lat&&lat_lon.Lat<=10.8422002792&&106.6206512451<=lat_lon.Lon&&lat_lon.Lon<=106.7253265381&&(tileReg=!0),23.0498790741<=lat_lon.Lat&&lat_lon.Lat<=23.1469707489&&-82.4551391602<=lat_lon.Lon&&lat_lon.Lon<=-82.3025131226&&(tileReg=!0),-33.5340118408<=lat_lon.Lat&&lat_lon.Lat<=-33.3920707703&&-70.7330093384<=lat_lon.Lon&&lat_lon.Lon<=-70.5628662109&&(tileReg=!0),14.4964799881<=lat_lon.Lat&&lat_lon.Lat<=14.6804504395&&120.9344711304<=lat_lon.Lon&&lat_lon.Lon<=121.0866470337&&(tileReg=!0),7.0708699226<=lat_lon.Lat&&lat_lon.Lat<=7.0890498161&&125.6036834717<=lat_lon.Lon&&lat_lon.Lon<=125.6218566895&&(tileReg=!0),10.2898797989<=lat_lon.Lat&&lat_lon.Lat<=10.3323202133&&123.8772964478<=lat_lon.Lon&&lat_lon.Lon<=123.9136810303&&(tileReg=!0),-35.2210502625<=lat_lon.Lat&&lat_lon.Lat<=-34.6507987976&&138.4653778076<=lat_lon.Lon&&lat_lon.Lon<=138.7634735107&&(tileReg=!0),-34.1896095276<=lat_lon.Lat&&lat_lon.Lat<=-33.5781402588&&150.5171661377<=lat_lon.Lon&&lat_lon.Lon<=151.3425750732&&(tileReg=!0),-27.8130893707<=lat_lon.Lat&&lat_lon.Lat<=-27.0251598358&&152.6393127441<=lat_lon.Lon&&lat_lon.Lon<=153.3230438232&&(tileReg=!0),-35.4803314209<=lat_lon.Lat&&lat_lon.Lat<=-35.1245193481&&148.9959259033<=lat_lon.Lon&&lat_lon.Lon<=149.2332458496&&(tileReg=!0),-38.4112510681<=lat_lon.Lat&&lat_lon.Lat<=-37.5401115417&&144.5532073975<=lat_lon.Lon&&lat_lon.Lon<=145.5077362061&&(tileReg=!0),33.2156982422<=lat_lon.Lat&&lat_lon.Lat<=33.4300994873&&44.2592010498<=lat_lon.Lon&&lat_lon.Lon<=44.5364112854&&(tileReg=!0),34.461101532<=lat_lon.Lat&&lat_lon.Lat<=34.5925598145&&69.0997009277<=lat_lon.Lon&&lat_lon.Lon<=69.2699813843&&(tileReg=!0),zl<7&&(40.735551<=lat_lon.Lat&&lat_lon.Lat<=40.807533&&-119.272041<=lat_lon.Lon&&lat_lon.Lon<=-119.163379&&2008==yr&&(tileReg=!0,bm=1),40.7472569628<=lat_lon.Lat&&lat_lon.Lat<=40.7971774152&&-119.267578125<=lat_lon.Lon&&lat_lon.Lon<=-119.201660156&&(tileReg=!0,bm=1))))),tileReg?(this.osming||(this.osming=!0,this.oldTileReg=YMapConfig.tileReg,tileReg="/map_openstreetmap_tile_broker.gne?t=m&",""!=cache_buster&&(tileReg+="v="+cache_buster+"&"),bm&&(tileReg+="bm="+bm+"&",yr&&(tileReg+="yr="+yr+"&")),YMapConfig.tileReg=[tileReg,tileReg],_ge("f_div_osm_cc")&&(_ge("f_div_osm_cc").style.display="block"),map_obj._cleanTileCache(),map_obj._callTiles()),setTimeout("F.osming.hide_y_copy('"+parent_node+"')",100),setTimeout("F.osming.hide_y_copy('"+parent_node+"')",800)):1==this.osming&&(this.osming=!1,YMapConfig.tileReg=this.oldTileReg,_ge("f_div_osm_cc")&&(_ge("f_div_osm_cc").style.display="none"),map_obj._cleanTileCache(),map_obj._callTiles(),setTimeout("F.osming.show_y_copy('"+parent_node+"')",100),setTimeout("F.osming.show_y_copy('"+parent_node+"')",800))}},hide_y_copy:function(parent_node){var copy_img=Y.U.Dom.getElementsBy(function(e){return"1px"==e.style.left&&"0px"==e.style.bottom||0<=e.src.indexOf("/copy")},"img",_ge(parent_node));1==copy_img.length&&(copy_img[0].style.display="none"),1==(copy_img=Y.U.Dom.getElementsBy(function(e){return 0<=e.src.indexOf("/yahoo.png")},"img",_ge(parent_node))).length&&(copy_img[0].style.display="none"),1==(copy_img=Y.U.Dom.getElementsBy(function(e){return 0<=e.innerHTML.indexOf("Yahoo!")},"div",_ge(parent_node))).length&&(copy_img[0].style.display="none")},show_y_copy:function(parent_node){var copy_img=Y.U.Dom.getElementsBy(function(e){return"1px"==e.style.left&&"0px"==e.style.bottom||0<=e.src.indexOf("/copy")},"img",_ge(parent_node));1==copy_img.length&&(copy_img[0].style.display="block"),1==(copy_img=Y.U.Dom.getElementsBy(function(e){return 0<=e.src.indexOf("/yahoo.png")},"img",_ge(parent_node))).length&&(copy_img[0].style.display="block"),1==(copy_img=Y.U.Dom.getElementsBy(function(e){return 0<=e.innerHTML.indexOf("Yahoo!")},"div",_ge(parent_node))).length&&(copy_img[0].style.display="block")}},F.set_spaceid=function(spaceid){var srcURL=_ge("beacon");if(!srcURL||!srcURL.getElementsByTagName("img")[0])return!1;var beaconImg=srcURL.getElementsByTagName("img")[0],srcURL=beaconImg.src,urlParams=(srcURL=srcURL.substr(srcURL.indexOf("?")+1)).split("&"),targetParams={s:"792600122",t:(new Date).getTime(),r:encodeURIComponent(window.location.href)};spaceid&&(targetParams.s=spaceid);for(var item,i=0,len=urlParams.length;i<len;i++)targetParams[item=urlParams[i].split("=")[0]]&&(urlParams[i]=item+"="+targetParams[item]);beaconImg.src="//geo.yahoo.com/f?"+urlParams.join("&"),writeDebug("beaconImg.src: "+beaconImg.src)},F.getty_intl_warn=function(sURL){var oComm,oCommShadow={"en-us":"english","fr-fr":!1,"de-de":!1,"es-us":!1,"it-it":!1,"pt-br":!1,"zh-hk":!1,"ko-kr":!1};if(!global_intl_lang||void 0===oCommShadow[global_intl_lang])return F.getty_log_omniture(),!0;if(!oCommShadow[global_intl_lang])return global_comm_div&&(oComm=_ge("comm_div"),oCommShadow=_ge("shadow_div"),oComm&&(F.find_parent_node(oComm).removeChild(oComm),oCommShadow&&((oCommShadow=F.find_parent_node(oCommShadow).removeChild(oCommShadow)).style.left="0px",oCommShadow.style.top="0px",document.body.appendChild(oCommShadow)),global_comm_div=null)),global_comm_div||_make_comm_div("10001"),global_comm_div.start_comming(F.output.get("getty_intl_warning"),void 0,void 0,!0,!0,F.output.get("go_ahead"),function(){F.getty_log_omniture(),window.location.href=sURL},!0,F.output.get("remain_here"),function(){_ge("shadow_div").style.display="none",_ge("shadow_div").style.left="-9999px",_ge("shadow_div").style.top="-9999px"},void 0,!0,!1),!1;F.getty_log_omniture(),window.location.href=sURL},F.getty_log_omniture=function(){var s;window.s_gi&&((s=s_gi(s_account)).linkTrackVars="eVar9,events",s.linkTrackEvents="event21",s.eVar9=page_photo_id,s.events="event21",s.tl("","o","Link Name"))},Y.E.addListener(window,"load",function(){window.setTimeout(F._preload_images_ready,1e3)}),F.keyboardShortcuts={enabled:!1,handlers:{jumpToSearchField:function(type,args,obj){var searchField=_ge("header_search_q");searchField&&"input"===searchField.tagName.toLowerCase()&&searchField.focus&&(Y.E.stopEvent(args[1]),F.scroll_this_el_into_view(searchField,null,function(){searchField.focus()},null,10,!0))},jumpToCommentField:function(type,args,obj){var commentField=_ge("message");commentField&&"textarea"===commentField.tagName.toLowerCase()&&commentField.focus&&(Y.E.stopEvent(args[1]),F.scroll_this_el_into_view(commentField,null,function(){commentField.focus()},null,60,!0))},addTag:function(type,args,obj){tagrs_showForm&&"function"==typeof tagrs_showForm&&(Y.E.stopEvent(args[1]),F.scroll_this_el_into_view("tagadderlink",null,function(){tagrs_showForm()},null,0,!0))},addPerson:function(type,args,obj){var addPersonLink=_ge("add-person-link");addPersonLink&&"function"==typeof addPersonLink.onclick&&(Y.E.stopEvent(args[1]),F.scroll_this_el_into_view(addPersonLink,null,function(){addPersonLink.onclick()},null,0,!0))},favoritePhoto:function(type,args,obj){var favButton=_ge("photo_gne_button_add_to_faves");favButton&&"function"==typeof favButton.handle_click&&(Y.E.stopEvent(args[1]),F.scroll_this_el_into_view("photo_gne_button_add_to_faves",null,function(){favButton.handle_click()},null,0,!0))},nextPhotoInContext:function(type,args,obj){var contextDiv;!nextprev_currentContextID||(contextDiv=_ge("nextprev_div_"+nextprev_currentContextID))&&contextDiv.next_url&&(Y.E.stopEvent(args[1]),window.location=contextDiv.next_url)},prevPhotoInContext:function(type,args,obj){var contextDiv;!nextprev_currentContextID||(contextDiv=_ge("nextprev_div_"+nextprev_currentContextID))&&contextDiv.prev_url&&(Y.E.stopEvent(args[1]),window.location=contextDiv.prev_url)},nextContext:function(type,args,obj){},previousContext:function(type,args,obj){},navigateToUpload:function(){window.location="/photos/upload/"},navigateToYourPhotostream:function(){window.location=photos_url},navigateToOrganizr:function(){window.location="/photos/organize/"},navigateToRecentActivity:function(){window.location="/notifications/"},navigateToContactsUploads:function(){window.location="/photos/friends/"},navigateToGroups:function(){window.location="/groups/"},navigateToHelp:function(){window.location="/help/"}},enableAll:function(){F.keyboardShortcuts.enabled||(F.keyboardShortcuts.jumpToSearchField.enable(),F.keyboardShortcuts.jumpToCommentField.enable(),F.keyboardShortcuts.addPerson.enable(),F.keyboardShortcuts.favoritePhoto.enable(),F.keyboardShortcuts.nextPhotoInContext.enable(),F.keyboardShortcuts.prevPhotoInContext.enable(),F.keyboardShortcuts.navigateToUpload.enable(),F.keyboardShortcuts.navigateToYourPhotostream.enable(),F.keyboardShortcuts.navigateToOrganizr.enable(),F.keyboardShortcuts.navigateToRecentActivity.enable(),F.keyboardShortcuts.navigateToContactsUploads.enable(),F.keyboardShortcuts.navigateToGroups.enable(),F.keyboardShortcuts.enabled=!0)},disableAll:function(){F.keyboardShortcuts.enabled&&(F.keyboardShortcuts.jumpToSearchField.disable(),F.keyboardShortcuts.jumpToCommentField.disable(),F.keyboardShortcuts.addPerson.disable(),F.keyboardShortcuts.favoritePhoto.disable(),F.keyboardShortcuts.nextPhotoInContext.disable(),F.keyboardShortcuts.prevPhotoInContext.disable(),F.keyboardShortcuts.navigateToUpload.disable(),F.keyboardShortcuts.navigateToYourPhotostream.disable(),F.keyboardShortcuts.navigateToOrganizr.disable(),F.keyboardShortcuts.navigateToRecentActivity.disable(),F.keyboardShortcuts.navigateToContactsUploads.disable(),F.keyboardShortcuts.navigateToGroups.disable(),F.keyboardShortcuts.enabled=!1)}},F.keyboardShortcuts.jumpToSearchField=new Y.U.KeyListener(document,{keys:83,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.jumpToSearchField,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.jumpToCommentField=new Y.U.KeyListener(document,{keys:67,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.jumpToCommentField,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.addTag=new Y.U.KeyListener(document,{keys:84,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.addTag,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.addPerson=new Y.U.KeyListener(document,{keys:80,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.addPerson,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.favoritePhoto=new Y.U.KeyListener(document,{keys:70,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.favoritePhoto,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.nextPhotoInContext=new Y.U.KeyListener(document,{keys:75,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.nextPhotoInContext,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.prevPhotoInContext=new Y.U.KeyListener(document,{keys:74,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.prevPhotoInContext,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.nextContext=new Y.U.KeyListener(document,{keys:73,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.nextContext,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.previousContext=new Y.U.KeyListener(document,{keys:77,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.previousContext,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.navigateToUpload=new Y.U.KeyListener(document,{keys:85,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.navigateToUpload,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.navigateToYourPhotostream=new Y.U.KeyListener(document,{keys:89,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.navigateToYourPhotostream,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.navigateToOrganizr=new Y.U.KeyListener(document,{keys:79,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.navigateToOrganizr,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.navigateToRecentActivity=new Y.U.KeyListener(document,{keys:82,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.navigateToRecentActivity,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.navigateToContactsUploads=new Y.U.KeyListener(document,{keys:78,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.navigateToContactsUploads,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.navigateToGroups=new Y.U.KeyListener(document,{keys:71,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.navigateToGroups,scope:F.keyboardShortcuts,correctScope:!0}),F.keyboardShortcuts.navigateToHelp=new Y.U.KeyListener(document,{keys:191,ctrl:!0,shift:!0},{fn:F.keyboardShortcuts.handlers.navigateToHelp,scope:F.keyboardShortcuts,correctScope:!0}),F.wordwrap=function(str,int_width,str_break,cut){for(var j,s,r,m=int_width||75,b=str_break||"\n",c=cut||!1,i=-1,l=(r=str.split(/\r\n|\n|\r/)).length;++i<l;r[i]+=s)for(s=r[i],r[i]="";s.length>m;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='<div id="global-dialog-container" class="global_dialog_container"><div class="wrapper">'+innerHTML+"</div></div>",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<api_responses_expected?api_responses_done_handler=function(){self.do_auth(o_auth_params)}:self.do_auth(o_auth_params)},this.do_auth_ok_handler=function(){writeDebug("do_auth_ok_handler()")},this.do_auth_fail_handler=function(){writeDebug("do_auth_fail_handler()")},this.do_auth=function(params){if(!params)return writeDebug("do_auth: {partner:} param missing?"),!1;params={magic_cookie:global_auth_hash,partner:params.partner};window.page_always_post_fragment_requests=!0,F.fragment_getter.get("/services/auth/inline.gne",params,this,"do_auth_onload")},this.do_auth_onload=function(success,responseText,params){writeDebug("do_auth_onload: checking response: "+responseText);var rsp=eval("("+responseText+")"),token;rsp.stat?(token=rsp.token,writeDebug("response: OK"),self.do_auth_ok_handler?(writeDebug("calling do_auth_ok_handler()"),self.do_auth_ok_handler(success,responseText,params)):writeDebug("no do_auth_ok_handler()?")):(writeDebug("Response: Fail"),self.do_auth_fail_handler?(writeDebug("calling do_auth_fail_handler"),self.do_auth_fail_handler(success,responseText,params)):writeDebug("no do_auth_fail_handler?"))},this.set_photo_ids=function(a_photo_ids){writeDebug("set_photo_ids"),self.options.photo_ids=a_photo_ids,print_item_count=self.options.photo_ids.length,is_multiple_photoids=1<print_item_count},this.need_to_get_photo_info=function(){writeDebug("need_to_get_photo_info()");for(var item,queue=[],i=0,j=self.options.photo_ids.length;i<j;i++)(item=window.global_photos[self.options.photo_ids[i]])&&item.originalformat||queue.push(self.options.photo_ids[i]);return queue.length?writeDebug("need_to_get_photo_info: "+queue.length+" items"):writeDebug("need_to_get_photo_info: photo info present"),queue.length||writeDebug("need_to_get_photo_info(): nothing in queue"),queue},this.check_global_photos=function(f_api_onload_handler){writeDebug("check_global_photos()");var queue=self.need_to_get_photo_info();writeDebug("queue: "+queue.length+" items");for(var i=queue.length;i--;)self.global_photos_data.queue.push(queue[i]);return writeDebug("number of items in queue: "+self.global_photos_data.queue.length),self.global_photos_data.queue.length?self.get_global_photos_info(f_api_onload_handler):0},this.get_global_photos_info=function(f_api_onload_handler){if(!self.global_photos_data.queue.length)return 0;var max_items=Math.min(self.global_photos_data.max_items_to_check,self.global_photos_data.queue.length),api_calls=Math.max(1,Math.ceil(max_items/self.global_photos_data.max_ids_per_api_call));writeDebug("api_calls: "+api_calls),self.global_photos_data.api_responses_expected=api_calls;for(var index,get_info_photo_ids=[],i=0,j=Math.min(self.global_photos_data.max_items_to_check,self.global_photos_data.queue.length);i<j;i++)get_info_photo_ids[index=Math.floor(i/self.global_photos_data.max_ids_per_api_call)]||(get_info_photo_ids[index]=[]),get_info_photo_ids[index].push(self.global_photos_data.queue[i]);for(var params,limit=Math.min(api_calls,get_info_photo_ids.length),i=0;i<limit;i++)writeDebug("checking photo "+i),params={photo_ids:get_info_photo_ids[i].join(",")},F.API.callMethod("flickr.photos.getInfo",params,{flickr_photos_getInfo_onLoad:function(success,responseXML,responseText,params){for(var photos=responseXML.documentElement.getElementsByTagName("photo"),i=0,j=photos.length;i<j;i++)_upsert_photo(photos[i]);self.global_photos_data.api_responses++,self.global_photos_data.api_responses>=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<print_item_count,writeDebug("order_products: using "+self.options.print_partner+" / "+self.options.photo_ids.join(",")),self.check_global_photos(self.show_printing_products),self.fetched_product_list)return F.global_dialog.show(),!1;writeDebug("Fetching product list, etc..."),F.global_dialog.set_loading({modal:!0});params=null,params=is_multiple_photoids?{photo_id:self.options.photo_ids.join(",")}:{photo_id:self.options.photo_ids[0]};void 0!==window.is_organizr&&(params.use_yui2_printing=1),use_simple_confirm_dialog=self.options.checkout||self.options.is_organizr||self.options.product&&!self.composites_allowing_single_photo["prod"+params.product_id]&&"print"!=self.options.product},this.print_set=function(handler){if(!handler)return writeDebug("print_set: need options"),!1;var params=handler.photo_ids||null,handler=handler.set_id||null;if(params&&params.length)return self.order_products({photo_ids:params}),!1;if(writeDebug("print_set: no photo ids?"),null==handler)return writeDebug("print_set: set_id is null"),!1;params={photoset_id:handler},handler={flickr_photosets_getPhotos_onLoad:function(success,responseXML,responseText,params){for(var photos=responseXML.documentElement.getElementsByTagName("photo"),photo_ids=[],i=0,j=photos.length;i<j;i++)photo_ids.push(photos[i].getAttribute("id"));if(!photo_ids.length)return F.global_dialog.set_loading(!1),!1;self.order_products({photo_ids:photo_ids})}};F.global_dialog.set_loading(!0),F.API.callMethod("flickr.photosets.getPhotos",params,handler)},this.photo_print_fragment_onload=function(success,responseText,params){writeDebug("photo print fragment onload: "+responseText),F.global_dialog.remove_existing_dialog(),is_multiple_photoids||use_simple_confirm_dialog?F.global_dialog.create_dialog('<div class="bd" style="padding:12px">'+self.get_print_options_html()+'</div><div class="ft">'+self.get_footer_checkout_note()+"</div>",{style:self.options.style}):F.global_dialog.create_dialog('<div class="bd" style="padding:12px">'+self.get_print_options_html()+"</div>",{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","&times;"));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","&times;"))}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='<div id="PrintDialog"'+(is_multiple_photoids?' class="print_cart is_multiple_photos"':' class="print_cart"')+">";return start_html+='<div id="PrintDialogHeaderDiv">'+F.output.get("photo_loading_print_options")+"</div>",start_html+='<div id="PrintDialogListWrapperDiv">',start_html+='<div id="PrintDialogListDiv" style="padding-right:2px; max-height:450px; overflow:auto;overflow-x:hidden"></div>',start_html+="</div>",start_html+="</div>",start_html+='<div id="PrintDialogBottomDiv" style="margin:3px; display:none; text-align:center;">',start_html+='<a href="" onclick="hide_PrintDialog(); return false;">'+F.output.get("cancel")+"</a>",start_html+="</div>",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?"<b>"+F.output.get("print_x_photos_with_snapfish",print_item_count)+"</b>":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<print_item_count;i++)self.calculate_photo_props(self.options.photo_ids[i]);void 0===window.global_photos&&(writeDebug("global_photos[] undefined - creating"),window.global_photos=[]),void 0===window.page_p&&(writeDebug("page_p undefined - creating"),window.page_p=null);var p=global_photos[self.options.photo_ids[0]]||null;!is_multiple_photoids&&p&&!p.o_h&&page_p&&page_p.o_w&&(writeDebug("using page photo o_w/o_h"),p.o_w=parseInt(page_p.o_w),p.o_h=parseInt(page_p.o_h));var provider_host,collection=was_multiple_photoids.documentElement.getElementsByTagName("product");if(0==collection.length)return writeDebug("nothing to show?"),hide_printDialog(),!1;writeDebug("checking printcart, productsO"),window.page_print_prices={},self.productsO={},enable_printcart&&(provider_host=was_multiple_photoids.documentElement.getElementsByTagName("products")[0].getAttribute("provider_host"));allowed_photo_ids=was_multiple_photoids.documentElement.getElementsByTagName("products")[0].getAttribute("currency");self.options.user_currency=allowed_photo_ids,writeDebug("parsing collection");for(var hidden_count=0,g=0;g<collection.length;g++){var do_exclude=collection[g],product_id=do_exclude.getAttribute("id"),product_price=do_exclude.getAttribute("price"),product_name=do_exclude.getAttribute("name"),product_description=do_exclude.getAttribute("description"),product_minresx=parseInt(do_exclude.getAttribute("minresx")),product_minresy=parseInt(do_exclude.getAttribute("minresy"));isNaN(product_minresx)&&(product_minresx=null),isNaN(product_minresy)&&(product_minresy=null);do_exclude.getAttribute("aspect"),do_exclude.getAttribute("panorama");var product_type=null,product_endpoint=do_exclude.getAttribute("product_endpoint"),size_label=null,size_units=null;enable_printcart&&(product_type=do_exclude.getAttribute("product_type"),F.printing.cart_urls["product"+product_id]=provider_host+product_endpoint),enable_printcart&&(product_name=product_name||"",product_description=product_description||F.output.get(F.printing.options.print_partner+"_product"+product_id+"_desc"),size_label=do_exclude.getAttribute("size_label"),(size_units=do_exclude.getAttribute("size_units"))&&(self.size_units=size_units),writeDebug("label/units: "+size_label+"/"+size_units),null==product_price&&(product_price=1==(product_rec=do_exclude.getElementsByTagName("prices")[0]).getAttribute("has_range")||product_rec.getElementsByTagName("price")[0].childNodes[0]?product_rec.getElementsByTagName("price")[0].childNodes[0].nodeValue:(writeDebug("WARN: bad product (undefined price)"),product_type="bad",999999)));var product_rec,do_show=0,do_exclude=0;enable_printcart?(do_show=1,self.options.product?self.options.product!=product_endpoint?(do_show=0,"composite"!=product_type||self.composites_allowing_single_photo["prod"+product_id]||(do_exclude=1)):(do_show=1,do_exclude=0):"composite"==product_type&&(do_show=0,self.composites_allowing_single_photo["prod"+product_id]?do_show=do_exclude=0:do_exclude=1)):(p.huge?-1<F.array_index_of(global_huge_photo_print_ids,product_id)&&(do_show=1):-1<F.array_index_of(global_wallet_photo_print_ids,product_id)&&(do_show=1),p.square&&-1<F.array_index_of(global_square_photo_print_ids,product_id)&&(do_show=1),p.dig_dims?-1<F.array_index_of(global_dig_photo_print_ids,product_id)&&(do_show=1):-1<F.array_index_of(global_reg_photo_print_ids,product_id)&&(do_show=1)),"bad"==product_type&&(writeDebug("WARN: Excluding bad product "+product_id+" ("+product_name+")"),do_exclude=1,do_show=0),product_rec=!is_multiple_photoids&&product_minresx&&product_minresy&&p&&p.o_w&&p.o_h?(writeDebug("min rec size: "+product_minresx+"x"+product_minresy+", photo size:"+p.o_w+"x"+p.o_h),p.o_w>=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<self.options.photo_ids.length;self.reset_exclusions();allowed_photo_ids=self.check_global_photo_exceptions();if(was_multiple_photoids||0!=allowed_photo_ids.length){if(self.set_photo_ids(allowed_photo_ids),0==self.options.photo_ids.length)return F.global_dialog.hide(),F.global_dialog.create_dialog('<div class="bd"><p>'+F.output.get("nothing_to_print")+'</p><p><a href="#" onclick="F.global_dialog.hide();return false" class="Butt">'+F.output.get("ok")+"</a></p></div>"),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<links.length;i++)links[i].href="/photos/organize/?start_tab=print&ids="+product_ids+"&product="+link_types[links[i].className].product_name},this.show_all_printing_products=function(){for(p in F.global_dialog.hide(),self.productsO){var prod=self.productsO[p];prod.show||prod.exclude||(_ge("prod"+prod.id+"_printcart").style.display=F.is_ie?"block":"table-row",prod.recommended||(_ge("print_not_rec_tr").style.display=F.is_ie?"block":"table-row"))}F.global_dialog.show()},this.update_print_prices=function(){var print_form=_ge("print_form"),ppt_td=_ge("price_print_total_td"),t=0;writeDebug("update_print_prices");for(var i=0;i<print_form.elements.length;i++)"select-one"==print_form.elements[i].type&&0<+print_form.elements[i].value&&(t+=page_print_prices[print_form.elements[i].name]*print_form.elements[i].value);var this_price=0;self.options.photo_ids instanceof Array||(self.options.photo_ids=self.options.photo_ids.split(","));for(var product_type,i=0;i<print_form.elements.length;i++)"radio"==print_form.elements[i].type&&print_form.elements[i].checked&&(writeDebug("value: "+print_form.elements[i].value),page_print_prices[print_form.elements[i].name],this_price=page_print_prices[print_form.elements[i].value],isNaN(this_price)||(product_type=self.productsO[print_form.elements[i].value].product_type,t+=page_print_prices[print_form.elements[i].value]*("composite"==product_type&&self.composites_allowing_single_photo[print_form.elements[i].value]?1:print_item_count)));var ft=F.currency.format_currency(t,{currency_type:self.options.user_currency,country:self.user_data.user_country});0<t?(ft="<nobr><b>"+ft+"</b></nobr>",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<el.getElementsByTagName("option").length-1&&(el.selectedIndex++,F.printing.update_print_prices())}catch(e){}},this.show_printing_products=function(){if(writeDebug("show_printing_products"),null!=self.productsO){if(self.is_showing_products)return writeDebug("have already written products out - exiting"),!1;writeDebug("writing innerHTML for product list"),self.options.show_other_products&&(writeDebug("showing other products"),_ge("other_printers_tr")&&(_ge("other_printers_tr").style.display=F.is_ie?"block":"table-row")),writeDebug(ref_str_base+"HeaderDiv: "+_ge(ref_str_base+"HeaderDiv")),_ge(ref_str_base+"HeaderDiv")&&(_ge(ref_str_base+"HeaderDiv").innerHTML=self.get_click_a_text(),_ge(ref_str_base+"HeaderDiv").style.display="block");var template_tr,header_tr;F.output.get("snapfish_cost_heading",self.options.print_country);is_multiple_photoids?(template_tr=_ge("print_multiple_photo_tr"),header_tr=_ge("print_multiple_header_tr"),_ge("print_single_header_tr").style.display="none",Y.D.getElementsByClassName("print_header_td","td",header_tr)[0].innerHTML+=" ("+self.size_units+")",Y.D.getElementsByClassName("print_cost_header","td",header_tr)[0].innerHTML=F.output.get("cost_currency",self.options.user_currency),header_tr.style.display=F.is_ie?"block":"table-row"):(template_tr=_ge("print_product_tr"),header_tr=_ge("print_single_header_tr"),Y.D.getElementsByClassName("print_header_td","td",header_tr)[1].innerHTML+=" ("+self.size_units+")",Y.D.getElementsByClassName("print_cost_header","td",header_tr)[0].innerHTML=F.output.get("cost_currency",self.options.user_currency)),_ge("more-from-snapfish")&&(writeDebug("checking more-from-snapfish"),print_cancel=window.page_p&&window.page_p.isOwner,product_type="undefined"!=typeof page_set_owner_nsid&&global_nsid&&page_set_owner_nsid==global_nsid,_ge("more-from-snapfish").style.display=print_cancel||product_type?"block":"none",writeDebug("checking OK"));function rep(txt,price){var tip_html=price.description+" "+F.output.get("photo_we_recommend",price.minresx,price.minresy);global_js_tip_count++;tip_html=F.get_tip_html(tip_html,"js_tooltip_"+global_js_tip_count,"tip_print_menu");txt=(txt=(txt=txt.replace_global("REP_TIP",tip_html)).replace_global("REP_NAME",price.name)).replace_global("REP_PRODUCT","prod"+price.id+"_printcart");price=F.currency.format_currency(price.price,{currency_type:self.options.user_currency,country:self.user_data.user_country,show_prefix:!1});return txt=txt.replace_global("REP_PRICE",is_multiple_photoids?F.output.get("print_price_ea",price):price)}var tbody=template_tr.parentNode;for(p in self.productsO){var prod=self.productsO[p],tr=document.createElement("tr");tr.id="prod"+prod.id+"_printcart",is_multiple_photoids&&(tr.className="print_radio_row"),tr.onclick=F.printing.update_print_prices,tr.onkeypress=F.printing.update_print_prices,tr.onchange=F.printing.update_print_prices,prod.show||(tr.style.display="none");var td3=document.createElement("td");td3.className="print_dropdown_td",td3.innerHTML=rep(template_tr.childNodes[0].innerHTML,prod),tr.appendChild(td3);td3=document.createElement("td");td3.className=prod.recommended?"print_item_td":"print_item_notrec_td",td3.innerHTML=rep(template_tr.childNodes[1].innerHTML,prod),tr.appendChild(td3);td3=document.createElement("td");td3.className=prod.recommended?"print_price_td":"print_price_notrec_td",td3.innerHTML=rep(template_tr.childNodes[2].innerHTML,prod),tr.appendChild(td3),prod.recommended?tbody.insertBefore(tr,_ge("print_not_rec_tr")):(prod.show&&(_ge("print_not_rec_tr").style.display=F.is_ie?"block":"table-row"),tbody.appendChild(tr))}var print_cancel=_ge("print_cancel"),product_type=_ge("print_add"),print_form=_ge("print_form");print_form.clear=function(){for(var i=0;i<print_form.elements.length;i++)"select-one"==print_form.elements[i].type&&(print_form.elements[i].selectedIndex=0);self.update_print_prices()},page_print_orderA=[],print_cancel.onclick=self.hide_printDialog,product_type.onclick=function(){if(writeDebug("print add onclick"),page_print_orderA=[],is_multiple_photoids)for(var product_type,i=0;i<print_form.elements.length;i++)"radio"==print_form.elements[i].type&&print_form.elements[i].checked&&(writeDebug("value: "+print_form.elements[i].value),page_print_prices[print_form.elements[i].name],this_price=page_print_prices[print_form.elements[i].value],isNaN(this_price)||(writeDebug("this price: "+this_price),product_type=self.productsO[print_form.elements[i].value].product_type,writeDebug("photo ids length: "+print_item_count),writeDebug("print_form.elements[i].value "+print_form.elements[i].value),page_print_orderA.push(print_form.elements[i].value+":"+ +("composite"==product_type&&self.composites_allowing_single_photo[print_form.elements[i].value]?1:print_item_count)+":")));else for(var i=0;i<print_form.elements.length;i++)"select-one"==print_form.elements[i].type&&(0<+print_form.elements[i].value?(writeDebug("adding item, print_form.elements[i].value: "+print_form.elements[i].value),page_print_orderA.push(print_form.elements[i].name+":"+print_form.elements[i].value+":")):writeDebug("ignoring item "+print_form.elements[i]));return writeDebug("page_print_orderA.length: "+page_print_orderA.length),0<page_print_orderA.length?self.send_to_action():writeDebug("Nothing to order."),!1},_ge("change_country_link2")&&(_ge("change_country_link2").onclick=function(){return self.show_country_form(),!1}),_ge("more_print_options")&&(_ge("more_print_options").onclick=function(){return this.style.display="none",self.show_all_printing_products(),!1}),_ge("print_form").style.display="block",_ge(ref_str_base+"ListDiv").parentNode.style.display="block",self.options.product?(writeDebug("Filter case"),1==(product_type=self.find_products_by_name(self.options.product)).length?(product_type=(params=product_type[0]).product_type,writeDebug("adding filtered product: "+params.product_endpoint),page_print_orderA.push("prod"+params.id+"_printcart:"+ +("composite"==product_type&&self.composites_allowing_single_photo["prod"+params.id]?1:print_item_count)+":"),params='<div class="bd">',params+='<h3 style="margin:0px;padding:0px;color:#ff0084;font-size:14px;font-weight:bold">'+F.output.get("snapfish_off_you_go")+"</h3>",params+="<p>"+F.output.get("snapfish_handing_off")+"</p>",params+='<p id="prints-in-shopping-cart" style="display:none">'+F.output.get("prints_in_shopping_cart")+"</p>",params+="<p>"+F.output.get("have_fun")+"</p>",params+='<form id="print_cart_form" onsubmit="return false"><input type="button" id="print_ok_button" class="Butt" value="'+F.output.get("continuoo")+'" style="margin:5px 0px 0px 0px;text-transform:uppercase">&nbsp;&nbsp;<input type="button" id="print_cancel_button" class="CancelButt" value="'+F.output.get("cancel")+'" style="margin:5px 0px 0px 0px;text-transform:uppercase"></form></div>',params+="</div>",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<self.global_photos_data.api_responses_expected)return writeDebug("global_photos: "+self.global_photos_data.api_responses_expected+", waiting for "+self.global_photos_data.api_responses+" responses"),!1;var params={provider_id:self.options.print_partner};writeDebug("printcart.getProductList"),F.API.callMethod("flickr.printcart.getProductList",params,{flickr_printcart_getProductList_onLoad:function(success,responseXML,responseText,params){F.API.callMethod("flickr.printing.getPrefs",null,{flickr_printing_getPrefs_onLoad:function(success2,responseXML2,responseText2,params2){self.user_data.user_country=responseXML2.documentElement.getElementsByTagName("country").length?responseXML2.documentElement.getElementsByTagName("country")[0].code:null,writeDebug("got print country: "+self.user_data.user_country),self.flickr_printcart_getProductList_onLoad(success,responseXML,responseText,params);try{self.show_printing_products()}catch(e){writeDebug("Oh snap! show_printing_products error: "+e.toString())}}})}})}else writeDebug("printing.getProducts"),F.API.callMethod("flickr.printing.getProducts",{provider_id:page_printing_provider},self)},this.get_footer_checkout_note=function(){return['<div id="print_cart_prompt" style="border-top:none;padding-top:0px"><img src="'+_images_root+'/icon_cart.gif" width="16" height="16" border="0" style="margin:0 6px 0px 0px; border:none; float:left; display:inline">',"<div>"+F.output.get("prints_during_checkout")+"</div>",'<div style="clear:both;font-size:1px;line-height:1px;overflow:hidden;height:1px;display:inline">&nbsp;</div>',"</div>"].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<photo_ids.length;i++)(i<max_ids?this_ids:queued_ids).push(photo_ids[i]);params.photo_ids=this_ids.join(","),writeDebug("adding "+photo_ids.length+" items, max of "+max_ids+" per API call"),queued_ids.length?(writeDebug("queued IDs after max call: "+queued_ids.length),self.addToCart_responses_expected++,handler={generic_api_onLoad:function(onload_success,onload_responseXML,onload_responseText,onload_params){writeDebug("printcart: addPrint/addComposite onload(): Going back for more"),self.addToCart_responses++,params.photo_ids=queued_ids,self.add_product(api_method_name,params,scope),writeDebug("OK")}}):writeDebug("no queued IDs"),F.API.callMethod(api_method_name,params,handler)}},this.calculate_photo_props=function(shorter_side){var longer_side,p=global_photos[shorter_side];p&&(longer_side=Math.max(p.o_w,p.o_h),shorter_side=Math.min(p.o_w,p.o_h),p.aspect=longer_side/shorter_side,p.panorama=2<=p.aspect?1:0,p.dig_dims=p.aspect<1.36?1:0,p.square=.96<p.aspect&&p.aspect<1.04?1:0,p.small=longer_side<=1024?1:0,p.huge=3e3<=shorter_side&&4500<=longer_side?1:0)},this.hide_printDialog=function(){F.global_dialog.hide();var print_form=_ge("print_form");print_form&&print_form.clear&&print_form.clear()},this.snapfish_auth_ok=function(success,responseText,params){var result,url_params;F.global_dialog.hide(),writeDebug("self.options.print_partner: "+self.options.print_partner),"snapfish"==self.options.print_partner?(writeDebug("success: "+success),writeDebug("responseText: "+responseText),writeDebug("params: "+params),writeDebug("evaling response.."),result=eval("("+responseText+")"),writeDebug("eval OK"),writeDebug("checking result.stat"),url_params={product_name:self.options.product_name},"ok"==result.stat&&result.token&&result.token.is_new?(writeDebug("result stat OK, is new"),_ge("share-email")&&_ge("share-email").checked&&result.user?(writeDebug("going to post details"),url_params={product_name:self.options.product_name,email:encodeURI(result.user.email),first_name:encodeURI(result.user.first_name),last_name:encodeURI(result.user.last_name)},writeDebug("got user params")):writeDebug("no result.user, no token or no email")):writeDebug("result != OK or not new"),self.post_to_url(self.addtocart_cart_url,url_params),success||self.post_to_url(self.addtocart_cart_url,url_params)):(writeDebug("Warn: missing/unknown partner?"),self.post_to_url(self.addtocart_cart_url,url_params))},this.show_snapfish_unavailable=function(){return F.global_dialog.create_dialog('<div class="bd"><p>'+F.output.get("snapfish_unavailable")+'</p><p><a href="#" onclick="F.global_dialog.hide();return false" class="Butt">'+F.output.get("ok")+"</a></p></div>"),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+='<input name="'+item+'" id="'+item+'" value="'+o_params[item]+'" />\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('<div class="bd"><p>'+F.output.get("print_cart_empty")+'</p><p><a href="#" onclick="F.global_dialog.hide();F.printing.reset();return false" class="Butt">'+F.output.get("ok")+"</a></p></div>"),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_responses<self.addToCart_responses_expected)return void self.send_another_printing_product();var photo_notes=_ge("photo_notes");if(writeDebug("self.addToCart_responses: "+self.addToCart_responses+", self.addToCart_error_count: "+self.addToCart_error_count),self.addToCart_responses>self.addToCart_error_count){var confirm_html="";if(use_simple_confirm_dialog)return self.go_to_cart(),!1;enable_printcart?confirm_html+='<div class="bd">':confirm_html='<div id="contactChangerContainer" class="global_dialog_container">',0<self.addToCart_error_count?confirm_html+=F.output.get("photo_adding_some_errors",global_photos[photo_id].title,self.addToCart_error_count,self.addToCart_last_error.truncate_with_ellipses(400).replace_global("&","[wbr]&").replace_global("/","/[wbr]").replace_global("=","=[wbr]").escape_for_display_and_wrap().replace_global("[wbr]","<wbr>")):confirm_html+=use_simple_confirm_dialog?'<h3 style="margin:0px 0px 4px 0px;padding:0px;color:#ff0084;font-size:14px;font-weight:bold">'+F.output.get("photo_added_prints_to_order")+"</h3>":'<div style="margin-bottom:4px"><b>'+F.output.get("photo_added_prints_to_order")+"</b></div>",confirm_html+='<ul style="list-style-type:none;margin:0px;padding:0px">';for(var i=0;i<page_print_orderA.length;i++){var A=page_print_orderA[i].split(":");writeDebug("looking for self.productsO["+A[0]+"]"),-1<F.array_index_of(self.addToCart_problem_product_ids,self.productsO[A[0]].id)?confirm_html+='<li style="color:red;"><b>(0)</b> '+self.productsO[A[0]].id+" "+self.productsO[A[0]].name+"</li>":"undefined"!=typeof page_printing_use_printcart?confirm_html+="<li>("+A[1]+") "+self.productsO[A[0]].name+" <nobr> &mdash; "+F.currency.format_currency(A[1]*self.productsO[A[0]].price,{currency_type:self.options.user_currency,country:self.user_data.user_country})+"*</nobr></li>":confirm_html+="<li>("+A[1]+") "+self.productsO[A[0]].name+" <nobr>("+self.format_price(A[1]*self.productsO[A[0]].price.replace_global(".",""))+") total*</nobr></li>"}confirm_html+="</ul>","undefined"!=typeof page_printing_use_printcart&&("USD"!=self.options.user_currency?confirm_html+='<p style="font-size:10px;color:#666">'+F.output.get("snapfish_estimated_price")+"</p>":confirm_html+='<p style="font-size:10px;color:#666">'+F.output.get("snapfish_estimated_price_usd")+"</p>"),confirm_html+='<form id="print_cart_form" onsubmit="return false"><input type="button" id="print_cart_button" class="Butt" value="'+F.output.get("photo_proceed_to_checkout")+'" style="margin:5px 0px 0px 0px">&nbsp;&nbsp;<input type="button" id="print_ok_button" class="CancelButt" value="'+F.output.get("close")+'" style="margin:5px 0px 0px 0px;text-transform:uppercase"></form></div>',confirm_html+='<div class="ft"><div id="print_cart_prompt" style="border-top:none;padding-top:0px"><img src="'+_images_root+'/icon_cart.gif" width="16" height="16" border="0" style="margin:0 6px 20px 0; border:0; float:left; display:block;"><div>'+F.output.get("photo_get_to_cart")+"</div></div>",confirm_html+="</div></div>",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("<","</"):"",str="",i=0;i<A.length;i++)0<i&&(i==A.length-1?(2<A.length&&(str+=","),str+=" "+F.output.get("and")+" "):str+=", "),str+=b_tag+A[i]+e_tag;return str},F.output.sentencize=function(A){for(var str="<b>",i=0;i<A.length&&(str+=A[i],i!=A.length-1);i++)i!=A.length-2?str+="</b>, <b>":str+="</b> and <b>";return str+="</b>"},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;i<arguments.length;i++)new_args[i]=arguments[i];var format_id=new_args[0],count=_pi(new_args[1]);return 1<count?format_id+="_plural":0==count&&"fr-fr"!=global_intl_lang&&(format_id+="_plural"),new_args[0]=format_id,new_args[1]=count.pretty_num(),this.get.apply(this,new_args)},F.output.get=function(){for(var new_args=[],i=0;i<arguments.length;i++)new_args[i]=arguments[i];var format_id=new_args.shift(),format_str=this.format_strs[format_id];return null==format_str?" output:"+format_id:(new_args.unshift(format_str),this.sprintf.apply(null,new_args))},F.output.sprintf=function(fstring){function pad(str,ch,len){for(var ps="",i=0;i<Math.abs(len);i++)ps+=ch;return 0<len?str+ps:ps+str}function processFlags(flags,width,rs,arg){function pn(flags,arg,rs){return 0<=arg?0<=flags.indexOf(" ")?rs=" "+rs:0<=flags.indexOf("+")&&(rs="+"+rs):rs="-"+rs,rs}var iWidth=parseInt(width,10);if("0"!=width.charAt(0))return(rs=pn(flags,arg,rs)).length<iWidth&&(rs=flags.indexOf("-")<0?pad(rs," ",rs.length-iWidth):pad(rs," ",iWidth-rs.length)),rs;var ec=0;return(0<=flags.indexOf(" ")||0<=flags.indexOf("+"))&&ec++,rs.length<iWidth-ec&&(rs=pad(rs,"0",rs.length-(iWidth-ec))),pn(flags,arg,rs)}var converters=new Array;converters.c=function(flags,width,precision,arg){return"number"==typeof arg?String.fromCharCode(arg):"string"==typeof arg?arg.charAt(0):""},converters.d=function(flags,width,precision,arg){return converters.i(flags,width,precision,arg)},converters.u=function(flags,width,precision,arg){return converters.i(flags,width,precision,Math.abs(arg))},converters.i=function(flags,width,precision,arg){var iPrecision=parseInt(precision),rs=Math.abs(arg).toString().split(".")[0];return rs.length<iPrecision&&(rs=pad(rs," ",iPrecision-rs.length)),processFlags(flags,width,rs,arg)},converters.E=function(flags,width,precision,arg){return converters.e(flags,width,precision,arg).toUpperCase()},converters.e=function(flags,width,precision,arg){return iPrecision=parseInt(precision),isNaN(iPrecision)&&(iPrecision=6),rs=Math.abs(arg).toExponential(iPrecision),rs.indexOf(".")<0&&0<=flags.indexOf("#")&&(rs=rs.replace(/^(.*)(e.*)$/g,"$1.$2")),processFlags(flags,width,rs,arg)},converters.f=function(flags,width,precision,arg){return iPrecision=parseInt(precision),isNaN(iPrecision)&&(iPrecision=6),rs=Math.abs(arg).toFixed(iPrecision),rs.indexOf(".")<0&&0<=flags.indexOf("#")&&(rs+="."),processFlags(flags,width,rs,arg)},converters.G=function(flags,width,precision,arg){return converters.g(flags,width,precision,arg).toUpperCase()},converters.g=function(flags,width,precision,arg){return iPrecision=parseInt(precision),absArg=Math.abs(arg),rse=absArg.toExponential(),rsf=absArg.toFixed(6),isNaN(iPrecision)||(rsep=absArg.toExponential(iPrecision),rse=rsep.length<rse.length?rsep:rse,rsfp=absArg.toFixed(iPrecision),rsf=rsfp.length<rsf.length?rsfp:rsf),rse.indexOf(".")<0&&0<=flags.indexOf("#")&&(rse=rse.replace(/^(.*)(e.*)$/g,"$1.$2")),rsf.indexOf(".")<0&&0<=flags.indexOf("#")&&(rsf+="."),rs=rse.length<rsf.length?rse:rsf,processFlags(flags,width,rs,arg)},converters.o=function(flags,width,precision,arg){var iPrecision=parseInt(precision),rs=Math.round(Math.abs(arg)).toString(8);return rs.length<iPrecision&&(rs=pad(rs," ",iPrecision-rs.length)),0<=flags.indexOf("#")&&(rs="0"+rs),processFlags(flags,width,rs,arg)},converters.X=function(flags,width,precision,arg){return converters.x(flags,width,precision,arg).toUpperCase()},converters.x=function(flags,width,precision,arg){var iPrecision=parseInt(precision);arg=Math.abs(arg);var rs=Math.round(arg).toString(16);return rs.length<iPrecision&&(rs=pad(rs," ",iPrecision-rs.length)),0<=flags.indexOf("#")&&(rs="0x"+rs),processFlags(flags,width,rs,arg)},converters.s=function(flags,width,precision,arg){var iPrecision=parseInt(precision),rs=arg;return rs.length>iPrecision&&(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,"<b>"):arg},farr=fstring.split("%"),retstr=farr[0],fpRE=/^([0-9]+\$)?([-+ #]*)(\d*)\.?(\d*)([acdieEfFgGosuxX])(.*)$/;for(var i=1;i<farr.length;i++)if(fps=fpRE.exec(farr[i]),fps){var arg_i=i;fps[1]&&(arg_i=fps[1].replace_global("$","")),null!=arguments[arg_i]&&(retstr+=converters[fps[5]](fps[2],fps[3],fps[4],arguments[arg_i])),retstr+=fps[6]}return retstr};window.ActiveXObject&&!window.XMLHttpRequest&&(window.XHR=function(){return new ActiveXObject(-1!=navigator.userAgent.toLowerCase().indexOf("msie 5")?"Microsoft.XMLHTTP":"Msxml2.XMLHTTP")}),!window.ActiveXObject&&window.XMLHttpRequest&&(window.ActiveXObject=function(type){switch(type.toLowerCase()){case"microsoft.xmlhttp":case"msxml2.xmlhttp":return new XMLHttpRequest}return null}),void 0===window.XHR&&window.XMLHttpRequest&&(window.XHR=window.XMLHttpRequest);F.API={},F.API.callMethod=function(APIMethod,p_params,listener,testingURL,attempts,server,sync,delayMS){_qs_args.APIdelayMS&&(delayMS=_qs_args.APIdelayMS);var params={};if("object"==typeof p_params)for(var p in p_params)params[p]=p_params[p];params.method=APIMethod;var async=sync?0:1,RESTURLROOT=F.config.flickr.flags.enable_client_fullpath_api?F.config.flickrAPI.flickr_api_uri:"/services/rest/";server&&(RESTURLROOT=server+RESTURLROOT),params.src="js",params.api_key=global_magisterLudi,params.auth_hash=global_auth_hash,params.auth_token=global_auth_token,params.cb=(new Date).getTime();var params_keyA=[],RESTURL="";for(var p in params)"RESTURL"!=p&&(params[p]=params[p],params_keyA.push(p),RESTURL+="&"+p+"="+escape_utf8(params[p]));params_keyA.sort();var cal=global_flickr_secret;if(""!=cal&&window.md5_calcMD5){for(var i=0;i<params_keyA.length;i++)cal+=params_keyA[i]+params[params_keyA[i]];cal=md5_calcMD5(cal),RESTURL="api_sig="+cal+RESTURL}params.RESTURL=RESTURL;attempts=null==attempts?1:attempts;var req=new XHR,unload_obj={};return async&&(F.eb_add(unload_obj),unload_obj.window_onbeforeunload=function(do_alert){F.eb_remove(unload_obj),req.onreadystatechange=function(){},req.abort(),do_alert&&"object"==typeof F.API&&F.API.handleResponse(null,APIMethod,params,"Action cancelled by window unload. Try again please!",listener)}),params.timer_index=_page_timer.add("before api call "+params.method),req&&(req.onreadystatechange=function(){4==req.readyState&&(""==req.responseText&&attempts<2?(attempts++,req.abort(),F.API.callMethod(APIMethod,params,listener,testingURL,attempts,server,async)):(F.eb_remove(unload_obj),"object"==typeof F.API&&F.API.handleResponse(req.responseXML,APIMethod,params,req.responseText,listener)),this.onreadystatechange=null)},testingURL&&(RESTURLROOT=testingURL),req.open("POST",RESTURLROOT,async),req.withCredentials=!0,req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),async&&delayMS?("1"!=_qs_args.no_api_debug&&writeAPIDebug("delaying API call "+delayMS+" milliseconds for "+RESTURLROOT+"?"+RESTURL),setTimeout(function(){"1"!=_qs_args.no_api_debug&&writeAPIDebug(RESTURLROOT+"?"+RESTURL),req.send(RESTURL)},delayMS)):("1"!=_qs_args.no_api_debug&&writeAPIDebug(RESTURLROOT+"?"+RESTURL),req.send(RESTURL)),async||this.handleResponse(req.responseXML,APIMethod,params,req.responseText,listener)),req},F.API.getCallBackName=function(dotted){return dotted.split(".").join("_")+"_onLoad"},F.API.handleResponse=function(responseXML,APIMethod,params,responseText,listener){if("json"==params.format){var success=0,jsonFlickrApi=function(rsp){"ok"==rsp.stat&&(success=1),responseXML=rsp};try{eval(responseText)}catch(e){}}else if(responseXML){-1<navigator.userAgent.indexOf("Gecko")&&!F.is_safari&&(responseXML=F.str_to_XML(responseText));var success=!(!responseXML.documentElement||"ok"!=responseXML.documentElement.getAttribute("stat"))}else var success=0==responseText.indexOf('<?xml version="1.0" encoding="utf-8" ?>\n<rsp stat="ok">');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<RESTURL.length||window.page_always_post_fragment_requests;POST?req.open("POST",RESTURLROOT,async):req.open("GET",RESTURLROOT+RESTURL,async),req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),async&&delayMS?setTimeout(function(){POST?req.send(RESTURL):req.send(null)},delayMS):POST?req.send(RESTURL):req.send(null)}},F.fragment_getter.handleResponse=function(callback_name,params,responseText,listener){listener=listener||this,"1"!=_qs_args.no_api_debug&&writeAPIDebug(responseText);try{listener[callback_name](1,responseText,params)}catch(err){}};var escape_utf8=function(data){if(""===data||null==data)return"";if(F&&F.config&&F.config.flickr&&F.config.flickr.flags.enable_simple_client_side_utf8_escaping)return encodeURIComponent(data);data=data.toString();for(var buffer="",i=0;i<data.length;i++){var c=data.charCodeAt(i),bs=new Array;if(65536<c?(bs[0]=240|(1835008&c)>>>18,bs[1]=128|(258048&c)>>>12,bs[2]=128|(4032&c)>>>6,bs[3]=128|63&c):2048<c?(bs[0]=224|(61440&c)>>>12,bs[1]=128|(4032&c)>>>6,bs[2]=128|63&c):128<c?(bs[0]=192|(1984&c)>>>6,bs[1]=128|63&c):bs[0]=c,1<bs.length)for(var j=0;j<bs.length;j++){var b=bs[j];buffer+="%"+(nibble_to_hex((240&b)>>>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<jsVersion?window.location.replace(flashPage):window.location=flashPage),hasRightVersion=!0):useRedirect&&(1<jsVersion?window.location.replace(2<=actualVersion?upgradePage:noFlashPage):window.location=2<=actualVersion?upgradePage:noFlashPage)}jsVersion=1.1,isIE&&isWin&&(document.write("<SCRIPT LANGUAGE=VBScript> \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<str.length;i++)blks[i>>2]|=str.charCodeAt(i)<<i%4*8;return blks[i>>2]|=128<<i%4*8,blks[16*nblk-2]=8*str.length,blks}function md5_add(x,y){var lsw=(65535&x)+(65535&y);return(x>>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function md5_rol(num,cnt){return num<<cnt|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<x.length;i+=16)olda=a,oldb=b,oldc=c,oldd=d,a=md5_ff(a,b,c,d,x[i+0],7,-680876936),d=md5_ff(d,a,b,c,x[i+1],12,-389564586),c=md5_ff(c,d,a,b,x[i+2],17,606105819),b=md5_ff(b,c,d,a,x[i+3],22,-1044525330),a=md5_ff(a,b,c,d,x[i+4],7,-176418897),d=md5_ff(d,a,b,c,x[i+5],12,1200080426),c=md5_ff(c,d,a,b,x[i+6],17,-1473231341),b=md5_ff(b,c,d,a,x[i+7],22,-45705983),a=md5_ff(a,b,c,d,x[i+8],7,1770035416),d=md5_ff(d,a,b,c,x[i+9],12,-1958414417),c=md5_ff(c,d,a,b,x[i+10],17,-42063),b=md5_ff(b,c,d,a,x[i+11],22,-1990404162),a=md5_ff(a,b,c,d,x[i+12],7,1804603682),d=md5_ff(d,a,b,c,x[i+13],12,-40341101),c=md5_ff(c,d,a,b,x[i+14],17,-1502002290),b=md5_ff(b,c,d,a,x[i+15],22,1236535329),a=md5_gg(a,b,c,d,x[i+1],5,-165796510),d=md5_gg(d,a,b,c,x[i+6],9,-1069501632),c=md5_gg(c,d,a,b,x[i+11],14,643717713),b=md5_gg(b,c,d,a,x[i+0],20,-373897302),a=md5_gg(a,b,c,d,x[i+5],5,-701558691),d=md5_gg(d,a,b,c,x[i+10],9,38016083),c=md5_gg(c,d,a,b,x[i+15],14,-660478335),b=md5_gg(b,c,d,a,x[i+4],20,-405537848),a=md5_gg(a,b,c,d,x[i+9],5,568446438),d=md5_gg(d,a,b,c,x[i+14],9,-1019803690),c=md5_gg(c,d,a,b,x[i+3],14,-187363961),b=md5_gg(b,c,d,a,x[i+8],20,1163531501),a=md5_gg(a,b,c,d,x[i+13],5,-1444681467),d=md5_gg(d,a,b,c,x[i+2],9,-51403784),c=md5_gg(c,d,a,b,x[i+7],14,1735328473),b=md5_gg(b,c,d,a,x[i+12],20,-1926607734),a=md5_hh(a,b,c,d,x[i+5],4,-378558),d=md5_hh(d,a,b,c,x[i+8],11,-2022574463),c=md5_hh(c,d,a,b,x[i+11],16,1839030562),b=md5_hh(b,c,d,a,x[i+14],23,-35309556),a=md5_hh(a,b,c,d,x[i+1],4,-1530992060),d=md5_hh(d,a,b,c,x[i+4],11,1272893353),c=md5_hh(c,d,a,b,x[i+7],16,-155497632),b=md5_hh(b,c,d,a,x[i+10],23,-1094730640),a=md5_hh(a,b,c,d,x[i+13],4,681279174),d=md5_hh(d,a,b,c,x[i+0],11,-358537222),c=md5_hh(c,d,a,b,x[i+3],16,-722521979),b=md5_hh(b,c,d,a,x[i+6],23,76029189),a=md5_hh(a,b,c,d,x[i+9],4,-640364487),d=md5_hh(d,a,b,c,x[i+12],11,-421815835),c=md5_hh(c,d,a,b,x[i+15],16,530742520),b=md5_hh(b,c,d,a,x[i+2],23,-995338651),a=md5_ii(a,b,c,d,x[i+0],6,-198630844),d=md5_ii(d,a,b,c,x[i+7],10,1126891415),c=md5_ii(c,d,a,b,x[i+14],15,-1416354905),b=md5_ii(b,c,d,a,x[i+5],21,-57434055),a=md5_ii(a,b,c,d,x[i+12],6,1700485571),d=md5_ii(d,a,b,c,x[i+3],10,-1894986606),c=md5_ii(c,d,a,b,x[i+10],15,-1051523),b=md5_ii(b,c,d,a,x[i+1],21,-2054922799),a=md5_ii(a,b,c,d,x[i+8],6,1873313359),d=md5_ii(d,a,b,c,x[i+15],10,-30611744),c=md5_ii(c,d,a,b,x[i+6],15,-1560198380),b=md5_ii(b,c,d,a,x[i+13],21,1309151649),a=md5_ii(a,b,c,d,x[i+4],6,-145523070),d=md5_ii(d,a,b,c,x[i+11],10,-1120210379),c=md5_ii(c,d,a,b,x[i+2],15,718787259),b=md5_ii(b,c,d,a,x[i+9],21,-343485551),a=md5_add(a,olda),b=md5_add(b,oldb),c=md5_add(c,oldc),d=md5_add(d,oldd);return md5_rhex(a)+md5_rhex(b)+md5_rhex(c)+md5_rhex(d)}var g_tooltip_elm=null,g_tooltip_inner_elm=null,g_tooltip_showing=0,g_tooltip_trigger_elm=null,g_tooltip_previous_click=null,g_tip_elm=null;function init_tooltip(){g_tooltip_elm=document.createElement("DIV"),g_tooltip_inner_elm=document.createElement("DIV"),g_tooltip_elm.style.display="none",g_tooltip_elm.style.zIndex="200000",document.body.appendChild(g_tooltip_elm),g_tooltip_elm.appendChild(g_tooltip_inner_elm)}function show_tooltip(trigger_elm,tip_elm_id,len,extra_txt,className){if(g_tooltip_elm||init_tooltip(),"hidden"!=Y.U.Dom.getStyle(trigger_elm,"visibility")){className=className||"ToolTip";if(g_tooltip_elm.className=className,g_tooltip_showing){if(g_tooltip_trigger_elm==trigger_elm)return void hide_tooltip();hide_tooltip()}if(len+=(extra_txt=null==extra_txt?"":extra_txt).length,g_tip_elm=document.getElementById(tip_elm_id),g_tooltip_inner_elm.innerHTML=g_tip_elm.innerHTML+extra_txt,g_tooltip_inner_elm.style.width="auto",g_tooltip_elm.style.display="block",g_tooltip_elm.style.visibility="hidden","ToolTipSmall"!=className){var w=150;200<len?w=300:100<len&&(w=200),g_tooltip_inner_elm.style.width=w+"px"}var full_w=g_tooltip_elm.offsetWidth,x=Y.U.Dom.getX(trigger_elm),y=Y.U.Dom.getY(trigger_elm);"ToolTipSmall"==className?(x-=Math.round((full_w-trigger_elm.offsetWidth)/2)-5,"below"==trigger_elm.tip_placement?y+=trigger_elm.offsetHeight+10:y-=22):y+=20;var s_w=_find_screen_width()-40;s_w<x+full_w&&(x=s_w-full_w),x=Math.max(10,x),g_tooltip_elm.style.left=x+"px",g_tooltip_elm.style.top=y+"px",g_tooltip_showing=1,g_tooltip_elm.style.display="block",g_tooltip_elm.style.visibility="visible",g_tooltip_trigger_elm=trigger_elm,document.onmousedown=doc_mousedown}}function doc_mousedown(e){var e_src=_get_event_src(e);e_src==g_tooltip_trigger_elm||_el_is_in_a_link(e_src)&&tooltip_el_is_in_tooltip(e_src)?document.onmousedown=function(){}:hide_tooltip()}function hide_tooltip(if_trigger_elm){if(!if_trigger_elm||g_tooltip_trigger_elm==if_trigger_elm)return document.onmousedown=function(){},!!g_tooltip_elm&&(g_tooltip_showing=0,g_tooltip_elm.style.display="none",!(g_tooltip_trigger_elm="null"))}var tooltip_el_is_in_tooltip=function(el){for(var p=el;p;){if(p==g_tooltip_elm)return 1;p=p.parentNode}return 0};function deja_view_check(deja_view_item){if(deja_view_item&&_ok_for_scrumjax_xml()){window.deja_view_item=deja_view_item,window.deja_view_should_refresh=0,window.deja_view_should_empty_titles_and_descriptions=1,window.deja_view_type=deja_view_item.substring(0,1),window.deja_view_id=deja_view_item.replace(deja_view_type,"");var george=_get_cookie("deja_view");if(george){georgeA=george.split(" ");for(var i=0;i<georgeA.length;i++){var item=georgeA[i].split("^");if(item[0]==deja_view_item){global_time_stamp==item[1]&&(deja_view_should_refresh=1,"t"===deja_view_type&&(deja_view_should_empty_titles_and_descriptions=0),YAHOO.util.Event.onDOMReady(function(){var el=_ge("otherContexts_div");el&&(el.style.display="none")}));break}}}}}function deja_view_uh_huh(){if(window.deja_view_item){var tempA=[deja_view_item+"^"+global_time_stamp],george=_get_cookie("deja_view");if(george){georgeA=george.split(" ");for(var i=0;i<georgeA.length;i++){if(georgeA[i].split("^")[0]!=deja_view_item&&tempA.push(georgeA[i]),30==tempA.length)break}}_set_cookie("deja_view",tempA.join(" "),1)}}function deja_view_refresh(){if(window.deja_view_should_refresh&&window.deja_view_item&&_ok_for_scrumjax_xml()){var caterina={flickr_photos_getInfo_onLoad:function(success,responseXML,responseText){if(success){var title_div=_ge("title_div"+deja_view_id);title_div&&"function"==typeof title_div.flickr_photos_getInfo_onLoad&&title_div.flickr_photos_getInfo_onLoad(success,responseXML,responseText);var photo_notes=_ge("photo_notes");photo_notes&&photo_notes.p_id&&"function"==typeof photo_notes.flickr_photos_getInfo_onLoad&&photo_notes.flickr_photos_getInfo_onLoad(success,responseXML,responseText);var description_div=_ge("description_div"+deja_view_id);description_div&&"function"==typeof description_div.flickr_photos_getInfo_onLoad&&description_div.flickr_photos_getInfo_onLoad(success,responseXML,responseText);var tagadder=_ge("tagadder");tagadder&&"function"==typeof tagadder.flickr_photos_getInfo_onLoad&&tagadder.flickr_photos_getInfo_onLoad(success,responseXML,responseText)}},flickr_photos_getAllContexts_onLoad:function(success,responseXML,responseText){var otherContexts_div=_ge("otherContexts_div");if(success){for(var actual={},sets=responseXML.documentElement.getElementsByTagName("set"),t=0;t<sets.length;t++){actual["contextDiv_set"+(id=sets[t].getAttribute("id"))]=1,add_context_widget("set",id,deja_view_id)}var pools=responseXML.documentElement.getElementsByTagName("pool");for(t=0;t<pools.length;t++){actual["contextDiv_pool"+(id=pools[t].getAttribute("id"))]=1,add_context_widget("pool",id,deja_view_id)}var exisiting_context_divs=Y.U.Dom.getElementsByClassName("contextDiv","DIV");for(t=0;t<exisiting_context_divs.length;t++){var div_id=exisiting_context_divs[t].id;if(1!=actual[div_id]){var type="set",temp=div_id.split(type);1==temp.length&&(type="pool",temp=div_id.split(type));var id=temp[1];remove_context_widget(type,id)}}}otherContexts_div.style.display="block"},flickr_photos_search_onLoad:function(success,responseXML,responseText){if(success){for(var photo_id,title,photos=responseXML.documentElement.getElementsByTagName("photo"),n=0,len=photos.length;n<len;n++)photo_id=photos[n].getAttribute("id"),(title=_ge("sv_title_"+photo_id))&&Y.D.addClass(title,"checked");var streamViews=Y.D.getElementsByClassName("StreamView","div","Main");for(n=0,len=streamViews.length;n<len;n++)-1===streamViews[n].id.search(/^sv_title_/)||Y.D.hasClass(streamViews[n],"checked")||(photo_id=streamViews[n].id.replace(/^sv_title_/g,""),F._photo_vanisher.vanish_photo(photo_id,!0))}},flickr_applications_getInfo_onLoad:function(success,responseXML,responseText){if(success){var title_div=_ge("title_div"+deja_view_id);title_div&&"function"==typeof title_div.flickr_applications_getInfo_onLoad&&title_div.flickr_applications_getInfo_onLoad(success,responseXML,responseText);var description_div=_ge("description_div"+deja_view_id);description_div&&"function"==typeof description_div.flickr_applications_getInfo_onLoad&&description_div.flickr_applications_getInfo_onLoad(success,responseXML,responseText);var website_div=_ge("app_website_div"+deja_view_id);website_div&&"function"==typeof website_div.flickr_applications_getInfo_onLoad&&website_div.flickr_applications_getInfo_onLoad(success,responseXML,responseText)}}};if("p"==deja_view_type)F.API.callMethod("flickr.photos.getInfo",{photo_id:deja_view_id},caterina),F.API.callMethod("flickr.photos.getAllContexts",{photo_id:deja_view_id},caterina),F.people_taggr&&F.people_taggr.updateAll&&F.people_taggr.updateAll();else if("t"===deja_view_type){var pieces=deja_view_id.split("-"),page=pieces[0],per_page=pieces[1];F.API.callMethod("flickr.photos.search",{user_id:global_nsid,page:page,per_page:per_page},caterina)}else"a"==deja_view_type&&F.API.callMethod("flickr.applications.getInfo",{app_id:deja_view_id},caterina)}}var tab_bumper=1,insitu_init_page_app_title_div=function(app_id){return!!_ok_for_scrumjax()&&(insitu_init_generic_title_div(app_id,global_apps).getInput=function(){return'<input name="content" value="'+this.form_content.escape_for_xml().replace_global('"',"&#34;")+'" style="font-size:22px; font-weight: bold; font-family: Arial; padding:4px; width:100%; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'},!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'<textarea tabindex="'+tab_bumper+'1" name="content" style="font-family:arial; font-size:12px; padding:3px; margin-top:0px; width:100%; height:100px; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'+this.form_content.escape_for_xml()+"</textarea>"},div.getExtra=function(){return"<br>"},!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="<i>"+F.output.get("insitu_click_to_add_url")+"</i>&nbsp;",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'<input name="content" value="'+this.form_content.escape_for_xml().replace_global('"',"&#34;")+'" style="font-size:12px; font-weight: normal; font-family: Arial; padding:4px 0; width:100%; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'},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="<i>"+F.output.get("insitu_saving")+"</i>&nbsp;",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<errArray.length&&"2"==errArray[0].getAttribute("code")){var warnDiv=document.createElement("div");warnDiv.id="spam-url-warn-div",warnDiv.innerHTML='<p class="Problem">'+F.output.get("spam_url_warning")+".</p>",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?"&nbsp;":global_apps[this.app_id].website_url.trim().escape_for_display().nl2br()+"&nbsp;",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?"&nbsp;":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?"&nbsp;":global_apps[this.app_id].title.escape_for_display();new_url.match(/\:\/\//)||(new_url=" "),30<new_url.length?new_url_trunc=new_url.substr(0,30)+"...":new_url_trunc=new_url,new_url_trunc!=div.innerHTML&&(div.innerHTML=new_url_trunc),"&nbsp;"==new_url?(this.website_button.disabled=!0,this.website_button.className="DisabledButt"):(this.website_form.action=new_url,this.website_button.disabled=!1,this.website_button.className="Butt")},window.deja_view_should_refresh&&window.deja_view_should_empty_titles_and_descriptions&&(div.innerHTML="..."),insitu_init_editable_div(div)},insitu_init_page_set_description_div=function(set_id){return!!_ok_for_scrumjax()&&(insitu_init_generic_description_div(set_id,global_sets).getInput=function(){return'<textarea name="content" tabindex="'+tab_bumper+'1" style="font-family:arial; font-size:12px; padding:3px; margin-top:14px; width:100%; height:75px;border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'+this.form_content.escape_for_xml()+"</textarea>"},!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'<input name="content" value="'+this.form_content.escape_for_xml().replace_global('"',"&#34;")+'" style="font-size:32px; font-family:arial; padding:3px; width:100%; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'},div.getExtra=function(){return"<br>"},!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'<textarea name="content" tabindex="'+tab_bumper+'1" style="font-family:arial; font-size:12px; padding:3px; margin-top:14px; width:100%; height:150px;border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'+this.form_content.escape_for_xml()+"</textarea>"},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'<input name="content" value="'+this.form_content.escape_for_xml().replace_global('"',"&#34;")+'" style="font-size:22px; font-family:arial; padding:3px; width:100%; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'},div.getExtra=function(){return"<br>"},!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'<textarea tabindex="'+tab_bumper+'1" name="content" style="font-family:arial; font-size:12px; padding:3px; margin-top:0px; width:100%; height:100px; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'+this.form_content.escape_for_xml()+"</textarea>"},div.getExtra=function(){return"<br>"},!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'<input name="content" value="'+this.form_content.escape_for_xml().replace_global('"',"&#34;")+'" style="font-size:22px; font-weight: bold; font-family: Arial; padding:4px; width:100%; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'},div.getExtra=function(){return"<br>"},!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='<i style="color: rgb(136, 136, 136);">'+F.output.get("insitu_click_to_add_blast")+"</i>&nbsp;":div.emptyText='<i style="color: rgb(136, 136, 136);">'+F.output.get("insitu_click_to_add_blast_spon")+"</i>&nbsp;",div.form_content=div.innerHTML==div.emptyText||"&nbsp;"==div.innerHTML?"":div.innerHTML,div.blast_date_format='<small id="blast_date" style="font-size: 11px;">'+blast_date+"</small>",div.change_checker=!1,(div=insitu_init_editable_div(div)).getInput=function(){return'<textarea id="ta_content_'+group_id+'" tabindex="'+tab_bumper+'1" name="content" style="font-family:arial; font-size:14px; padding:3px; margin-top:0px; width:100%; height:100px; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'+_ge("description_simple_div"+div.hash_id).innerHTML.replace_global("<br>",String.fromCharCode(13))+"</textarea>"},div.getExtra=function(){return"<br>"},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='<small id="blast_date" style="font-size: 11px;">'+div.blast_date+"</small> ",success){if(0<responseXML.documentElement.getElementsByTagName("blast").length&&responseXML.documentElement.getElementsByTagName("blast")[0].firstChild)var description_raw=responseXML.documentElement.getElementsByTagName("blast")[0].firstChild.nodeValue;else description_raw="";div.description=div.form_content=description_raw}else div.description=div.form_content=this.new_blast;0<div.form_content.length?(_ge("description_simple_div"+div.hash_id).innerHTML=div.form_content,_ge("div_boing_alert_"+this.hash_id)?div.form_content='<table cellpadding="0" collspacing="0" border="0"><tr><td width="55px" valign="top"><img src="'+global_icon_url+'" id="icon_'+global_nsid+'" width="48px" height="48px" /></td><td valign="top"><strong>'+F.output.get("page_groups_view_admin_says",global_name)+"</strong><br />"+div.blast_date_format+div.form_content.trim().nl2br()+"</td></tr></table>":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="<i>"+div.form_content+"</i>",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<errArray.length&&"116"==errArray[0].getAttribute("code")){var warnDiv=document.createElement("div");warnDiv.id="spam-url-warn-div",warnDiv.innerHTML='<p class="Problem">'+F.output.get("spam_url_warning")+".</p>";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<div.form_content.length){_ge("description_simple_div"+div.hash_id).innerHTML=div.form_content,_ge("div_boing_alert_"+this.hash_id)?div.form_content='<table cellpadding="0" collspacing="0" border="0"><tr><td width="55px" valign="top"><img src="'+global_icon_url+'" id="icon_'+global_nsid+'" width="48px" height="48px" /></td><td valign="top"><strong>'+F.output.get("page_groups_view_admin_says",global_name)+"</strong><br />"+div.blast_date_format+" - "+div.form_content.trim().nl2br()+"</td></tr></table>":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="<i>"+F.output.get("insitu_saving")+"</i>&nbsp;",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'<textarea name="content" tabindex="'+tab_bumper+'1" style="font-family:arial; font-size:12px; padding:3px; margin-top:0px; width:'+w+'px; height:75px;border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'+this.form_content.escape_for_xml()+"</textarea>"},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'<input name="content" value="'+this.form_content.escape_for_xml().replace_global('"',"&#34;")+'" style="font-size:14px; font-weight:bold; font-family:arial; padding:3px; width:'+w+'px; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;" />'},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'<textarea name="content" tabindex="'+tab_bumper+'1" style="font-family:arial; font-size:12px; padding:3px; margin-top:14px; width:100%; height:75px;border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'+this.form_content.escape_for_xml()+"</textarea>"},!0},insitu_init_page_gallery_description_div=function(gallery_id){return insitu_init_generic_description_div(gallery_id,global_galleries).getInput=function(){return'<textarea name="content" tabindex="'+tab_bumper+'1" style="font-family:arial; font-size:12px; padding:3px; margin-top:14px; width:100%; height:75px;border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'+this.form_content.escape_for_xml()+"</textarea>"},!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'<input name="content" value="'+this.form_content.escape_for_xml().replace_global('"',"&#34;")+'" style="font-size:32px; font-family:arial; padding:3px; width:100%; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;">'},div.getExtra=function(){return"<br>"},!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="<i>"+F.output.get("insitu_click_to_add_description")+"</i>&nbsp;",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?"&nbsp;":hash[div.hash_id].description.trim().nl2br();new_description!=div.innerHTML&&(div.innerHTML=new_description+"&nbsp;")}else div.form_content=hash[div.hash_id].description,div.innerHTML=""==hash[div.hash_id].description?"&nbsp;":hash[div.hash_id].description.trim().nl2br()+"&nbsp;";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?"&nbsp;":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+"&nbsp;"):(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?"&nbsp;":hash[div.hash_id].description.trim().nl2br()+"&nbsp;";else{var errArray=responseXML.documentElement.getElementsByTagName("err");if(errArray&&0<errArray.length&&"116"==errArray[0].getAttribute("code")){var warnDiv=document.createElement("div");warnDiv.id="spam-url-warn-div",warnDiv.innerHTML='<p class="Problem">'+F.output.get("spam_url_warning")+".</p>";var about=_ge("About");if(about)about.insertBefore(warnDiv,about.firstChild);else{var thumb=Y.D.getElementsByClassName("vsThumbnail","p",div.parentNode);thumb&&0<thumb.length?Y.D.insertAfter(warnDiv,thumb[0]):div.parentNode.insertBefore(warnDiv,div.parentNode.firstChild)}div.form_content=hash[div.hash_id].description,div.innerHTML=""==hash[div.hash_id].description?"&nbsp;":hash[div.hash_id].description.trim().nl2br()+"&nbsp;",div.startEditing()}else hash[div.hash_id].description=div.form_content,div.innerHTML=""==hash[div.hash_id].description?"&nbsp;":hash[div.hash_id].description.trim().nl2br()+"&nbsp;",alert(F.output.get("insitu_description_error"))}},div.saveChanges=function(form){deja_view_uh_huh(),hash[this.hash_id].description=form.content.value,this.innerHTML="<i>"+F.output.get("insitu_saving")+"</i>&nbsp;",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="<i>"+F.output.get("insitu_click_to_add_title")+"</i>&nbsp;",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?"&nbsp;":hash[div.hash_id].title.escape_for_xml()}else div.form_content=hash[div.hash_id].title,new_title=""==hash[div.hash_id].title?"&nbsp;":hash[div.hash_id].title.escape_for_display();new_title!=div.innerHTML&&(div.innerHTML=new_title),new_document_title="&nbsp;"===new_title?"":new_title,"&nbsp;"===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?"&nbsp;":hash[div.hash_id].title.escape_for_display()):(hash[div.hash_id].title=div.form_content,div.innerHTML=""==hash[div.hash_id].title?"&nbsp;":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="<i>"+F.output.get("insitu_saving")+"</i>&nbsp;",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='<form id="insitu_form_'+this.hash_id+'" style="margin-left:'+this.style.marginLeft+'" style="margin-right:'+this.style.marginRight+'">';formHTML+=this.getInput(),div.show_some_html_is_ok&&(_ge("div_boing_alert_"+this.hash_id)?formHTML+='<small>(<a id="insitu_plain_'+this.hash_id+'" class="Plain" href="/html.gne?tighten=1" tabindex="'+tab_bumper+'4">'+F.output.get("some_tiny_html")+"</a>.)</small>":formHTML+='<small>(<a id="insitu_plain_'+this.hash_id+'" class="Plain" href="/html.gne?tighten=0" tabindex="'+tab_bumper+'4">'+F.output.get("some_html")+"</a>.)</small>"),formHTML+='<br /><input id="blast_save_button" type="submit" class="'+(this.useSmallButts?"Small":"")+'Butt" value="'+F.output.get("save_up")+'" tabindex="'+tab_bumper+'2" />&nbsp;&nbsp;<span style="font-family:arial; font-size:'+(this.useSmallButts?"11":"12")+'px;">'+F.output.get("or_up")+'</span>&nbsp;&nbsp;<input type="button" class="'+(this.useSmallButts?"Small":"")+'CancelButt" value="'+F.output.get("cancel")+'" id="insitu_cancel_'+this.hash_id+'" tabindex="'+tab_bumper+'3" /></form>',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||"&nbsp;"!=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="&nbsp;",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<arguments.length;i++){var p=arguments[i];if(el.length){for(var cA=[],k=0;k<p.e.length;k++)cA.push(p.e[k]-p.b[k]);p.c=cA}else p.c=p.e-p.b;""!=p.eq&&Math[p.eq]||(p.eq="linearTween"),property_objectsA.push(p)}if(0!=property_objectsA.length){var interv=setInterval(function(){var elA=null==el.length?[el]:el;if(!(d<t)){for(var m=0;m<elA.length;m++)if("function"==typeof handler){for(var handler_args=[],i=0;i<property_objectsA.length;i++){var p=property_objectsA[i];if(null!=el.length)var val=_pi(Math[p.eq](t,p.b[m],p.c[m],d));else val=_pi(Math[p.eq](t,p.b,p.c,d));handler_args.push(val)}handler.apply(elA[m],handler_args)}else for(i=0;i<property_objectsA.length;i++){p=property_objectsA[i];if(null!=el.length)val=_pi(Math[p.eq](t,p.b[m],p.c[m],d));else val=_pi(Math[p.eq](t,p.b,p.c,d));val&&(val+="px"),elA[m].style[p.p]=val}t==d&&(clearTimeout(interv),seq_func.call(el),"function"==typeof after_func&&(after_args=after_args||[],after_func.apply(el[m],after_args))),t++}},ms);return interv}},anim_do_height_to=function(el,d,ms,h,eq,after_func,after_args,handler_func){if(el.length){for(var bh=[],i=0;i<el.length;i++)bh.push(el[i].style.height?_pi(el[i].style.height):el[i].offsetHeight);if(el.length!=h.length)return void alert("wrong length h "+el.length+" "+h.length)}else bh=el.style.height?_pi(el.style.height):el.offsetHeight;return anim_animate.call(el,[[d,ms,after_func,after_args,handler_func,{p:"height",b:bh,e:h,eq:eq}]],"anim_do_height_to")},anim_do_width_to=function(el,d,ms,w,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,null,{p:"width",b:el.offsetWidth,e:w,eq:eq}]],"anim_do_width_to")},anim_do_size_to=function(el,d,ms,s,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,anim_handler_size_to,{p:"s",b:el.offsetWidth,e:s,eq:eq}]],"anim_do_size_to")},anim_do_opacity_to=function(el,d,ms,op,eq,after_func,after_args){if(el.length){for(var bop=[],i=0;i<el.length;i++){var cop=100;F.is_ie?-1!=el[i].style.filter.indexOf("alpha(opacity=")&&(cop=el[i].style.filter.replace("alpha(opacity=","").replace(")","")):null!=el[i].style.opacity&&0<el[i].style.opacity.length&&(cop=100*el[i].style.opacity),bop.push(cop)}if(el.length!=bop.length)return void alert("wrong length of bop "+el.length+" "+bop.length);if(el.length!=op.length){if(op.length)return void alert("wrong length of op "+op);opA=[];for(i=0;i<el.length;i++)opA.push(op);op=opA}}else{bop=100;F.is_ie?-1!=el.style.filter.indexOf("alpha(opacity=")&&(bop=1*el.style.filter.replace("alpha(opacity=","").replace(")","")):null!=el.style.opacity&&0<el.style.opacity.length&&(bop=100*el.style.opacity)}return anim_animate.call(el,[[d,ms,after_func,after_args,anim_handler_opacity,{p:"val",b:bop,e:op,eq:eq}]],"anim_do_opacity_to")},anim_do_size_to_and_slide_to_on_center=function(el,d,ms,s,x,y,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,anim_handler_size_to_and_slide_to_on_center,{p:"s",b:el.offsetWidth,e:s,eq:eq},{p:"x",b:Y.U.Dom.getX(el)+el.offsetWidth/2,e:x,eq:eq},{p:"y",b:Y.U.Dom.getY(el)+el.offsetHeight/2,e:y,eq:eq}]],"anim_do_size_to_and_slide_to_on_center")},anim_do_size_to_and_slide_to=function(el,d,ms,s,x,y,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,anim_handler_size_to_and_slide_to,{p:"s",b:el.offsetWidth,e:s,eq:eq},{p:"x",b:F.get_local_X(el),e:x,eq:eq},{p:"y",b:F.get_local_Y(el),e:y,eq:eq}]],"anim_do_size_to_and_slide_to")},anim_do_slide_to_on_center=function(el,d,ms,x,y,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,anim_handler_center_on,{p:"x",b:Y.U.Dom.getX(el)+el.offsetWidth/2,e:x,eq:eq},{p:"y",b:Y.U.Dom.getY(el)+el.offsetHeight/2,e:y,eq:eq}]],"anim_do_slide_to_on_center")},anim_do_slide_to=function(el,d,ms,x,y,eq,after_func,after_args,sx,sy){if(el.length){if(null==sx||null==sx.length){sx=[],sy=[];for(var i=0;i<el.length;i++)null!=el[i].style.left?sx.push(_pi(el[i].style.left)):sx.push(Y.U.Dom.getX(el[i])),null!=el[i].style.top?sy.push(_pi(el[i].style.top)):sy.push(Y.U.Dom.getY(el[i]))}if(el.length!=sx.length||el.length!=sy.length)return void alert("wrong length of sx or sy "+el.length+" "+sx.length+" "+sy.length);if(el.length!=x.length||el.length!=y.length)return void alert("wrong length of s or y")}else sx=null!=sx?sx:null!=el.style.left?_pi(el.style.left):Y.U.Dom.getX(el),sy=null!=sy?sy:null!=el.style.top?_pi(el.style.top):Y.U.Dom.getY(el);return anim_animate.call(el,[[d,ms,after_func,after_args,null,{p:"left",b:sx,e:x,eq:eq},{p:"top",b:sy,e:y,eq:eq}]],"anim_do_slide_to")},anim_do_slide_relative_to=function(el,d,ms,x,y,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,null,{p:"left",b:_pi(el.style.left),e:x,eq:eq},{p:"top",b:_pi(el.style.top),e:y,eq:eq}]],"anim_do_slide_relative_to")},anim_do_slide_to_x=function(el,d,ms,x,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,null,{p:"left",b:F.get_local_X(el),e:x,eq:eq}]],"anim_do_slide_to_x")},anim_do_scroll_to_scrollTop=function(el,d,ms,scrollTop,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,anim_handler_set_scrollTop,{p:"scrollTop",b:el.scrollTop,e:scrollTop,eq:eq}]],"anim_do_scroll_to_scrollTop")},anim_do_marginTop_to=function(el,d,ms,marginTop,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,null,{p:"marginTop",b:_pi(el.style.marginTop),e:marginTop,eq:eq}]],"anim_do_marginTop_to")},anim_do_marginLeft_to=function(el,d,ms,marginLeft,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,null,{p:"marginLeft",b:_pi(el.style.marginLeft),e:marginLeft,eq:eq}]],"anim_do_marginLeft_to")},anim_do_blink_pink=function(el,after_func,after_args){return anim_animate.call(el,[[1,1,null,[],anim_handler_set_color_rgb,{p:"r",b:0,e:255,eq:"easeOutQuad"},{p:"g",b:0,e:0,eq:"easeOutQuad"},{p:"b",b:0,e:132,eq:"easeOutQuad"}],[4,50,null,[],anim_handler_set_color_rgb,{p:"r",b:255,e:0,eq:"easeOutQuad"},{p:"g",b:0,e:0,eq:"easeOutQuad"},{p:"b",b:132,e:0,eq:"easeOutQuad"}],[1,1,null,[],anim_handler_set_color_rgb,{p:"r",b:0,e:255,eq:"easeOutQuad"},{p:"g",b:0,e:0,eq:"easeOutQuad"},{p:"b",b:0,e:132,eq:"easeOutQuad"}],[4,50,after_func,after_args,anim_handler_set_color_rgb,{p:"r",b:255,e:0,eq:"easeOutQuad"},{p:"g",b:0,e:0,eq:"easeOutQuad"},{p:"b",b:132,e:0,eq:"easeOutQuad"}]],"anim_do_blink_pink")},anim_do_blink_yellow=function(el,after_func,after_args){return anim_animate.call(el,[[8,200,null,[],anim_handler_set_bgcolor_rgb,{p:"r",b:254,e:255,eq:"easeInQuad"},{p:"g",b:254,e:255,eq:"easeInQuad"},{p:"b",b:234,e:242,eq:"easeInQuad"}],[8,200,null,[],anim_handler_set_bgcolor_rgb,{p:"r",b:255,e:254,eq:"easeInQuad"},{p:"g",b:255,e:254,eq:"easeInQuad"},{p:"b",b:242,e:234,eq:"easeInQuad"}]],"anim_do_blink_yellow")},anim_do_color_to=function(el,d,ms,sr,sg,sb,er,eg,eb,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,null,[],anim_handler_set_color_rgb,{p:"r",b:sr,e:er,eq:eq},{p:"g",b:sg,e:eg,eq:eq},{p:"b",b:sb,e:eb,eq:eq}]],"anim_do_color_to")},anim_do_bgcolor_to=function(el,d,ms,sr,sg,sb,er,eg,eb,eq,after_func,after_args){return anim_animate.call(el,[[d,ms,after_func,after_args,anim_handler_set_bgcolor_rgb,{p:"r",b:sr,e:er,eq:eq},{p:"g",b:sg,e:eg,eq:eq},{p:"b",b:sb,e:eb,eq:eq}]],"anim_do_bgcolor_to")},anim_do_pink_fade=function(el,after_func,after_args){return anim_animate.call(el,[[50,50,null,[],anim_handler_set_backgroundColor_rgb,{p:"r",b:255,e:239,eq:"easeOutQuad"},{p:"g",b:255,e:239,eq:"easeOutQuad"},{p:"b",b:255,e:239,eq:"easeOutQuad"}]],"anim_do_blink_pink")},anim_do_margin_dance_right=function(el,d,ms){return anim_animate.call(el,[[d,ms,null,[],null,{p:"marginRight",b:110,e:0,eq:"easeInOutQuad"},{p:"marginLeft",b:-110,e:0,eq:"easeInOutQuad"}]],"anim_do_margin_dance_right")},anim_do_margin_dance_left=function(el,d,ms){return anim_animate.call(el,[[d,ms,null,[],null,{p:"marginLeft",b:110,e:0,eq:"easeInOutQuad"}]],"anim_do_margin_dance_left")},anim_handler_set_color_rgb=function(r,g,b){anm_set_rgb.call(this,"color",r,g,b)},anim_handler_set_bgcolor_rgb=function(r,g,b){anm_set_rgb.call(this,"backgroundColor",r,g,b)},anim_handler_set_scrollTop=function(scrollTop){this.scrollTop=scrollTop},anim_handler_set_backgroundColor_rgb=function(r,g,b){anm_set_rgb.call(this,"backgroundColor",r,g,b)},anim_handler_center_on=function(x,y){this.style.left=_pi(x-this.offsetWidth/2)+"px",this.style.top=_pi(y-this.offsetHeight/2)+"px"},anim_handler_opacity=function(val){this.style.opacity=val/100,this.style.filter="alpha(opacity="+val+")"},anim_handler_size_to=function(s){this.style.width=s+"px",this.style.height=s+"px"},anim_handler_size_to_and_slide_to_on_center=function(s,x,y){this.style.left=_pi(x-s/2)+"px",this.style.top=_pi(y-s/2)+"px",this.style.width=s+"px",this.style.height=s+"px"},anim_handler_size_to_and_slide_to=function(s,x,y){this.style.left=_pi(x)+"px",this.style.top=_pi(y)+"px",this.style.width=s+"px",this.style.height=s+"px"},anm_set_rgb=function(p,r,g,b){this.style[p]="rgb("+r+", "+g+", "+b+")"};Math.linearTween=function(t,b,c,d){return c*t/d+b},Math.easeInQuad=function(t,b,c,d){return c*(t/=d)*t+b},Math.easeOutQuad=function(t,b,c,d){return-c*(t/=d)*(t-2)+b},Math.easeInOutQuad=function(t,b,c,d){return(t/=d/2)<1?c/2*t*t+b:-c/2*(--t*(t-2)-1)+b},Math.easeInCubic=function(t,b,c,d){return c*(t/=d)*t*t+b},Math.easeOutCubic=function(t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},Math.easeInOutCubic=function(t,b,c,d){return(t/=d/2)<1?c/2*t*t*t+b:c/2*((t-=2)*t*t+2)+b},Math.easeInQuart=function(t,b,c,d){return c*(t/=d)*t*t*t+b},Math.easeOutQuart=function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},Math.easeInOutQuart=function(t,b,c,d){return(t/=d/2)<1?c/2*t*t*t*t+b:-c/2*((t-=2)*t*t*t-2)+b},Math.easeInQuint=function(t,b,c,d){return c*(t/=d)*t*t*t*t+b},Math.easeOutQuint=function(t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},Math.easeInOutQuint=function(t,b,c,d){return(t/=d/2)<1?c/2*t*t*t*t*t+b:c/2*((t-=2)*t*t*t*t+2)+b},Math.easeInSine=function(t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},Math.easeOutSine=function(t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},Math.easeInOutSine=function(t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},Math.easeInExpo=function(t,b,c,d){return 0==t?b:c*Math.pow(2,10*(t/d-1))+b},Math.easeOutExpo=function(t,b,c,d){return t==d?b+c:c*(1-Math.pow(2,-10*t/d))+b},Math.easeInOutExpo=function(t,b,c,d){return 0==t?b:t==d?b+c:(t/=d/2)<1?c/2*Math.pow(2,10*(t-1))+b:c/2*(2-Math.pow(2,-10*--t))+b},Math.easeInCirc=function(t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},Math.easeOutCirc=function(t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},Math.easeInOutCirc=function(t,b,c,d){return(t/=d/2)<1?-c/2*(Math.sqrt(1-t*t)-1)+b:c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},Math.easeInElastic=function(t,b,c,d,a,p){if(0==t)return b;if(1==(t/=d))return b+c;if(p=p||.3*d,a<Math.abs(c)){a=c;var s=p/4}else 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},Math.easeOutElastic=function(t,b,c,d,a,p){if(0==t)return b;if(1==(t/=d))return b+c;if(p=p||.3*d,a<Math.abs(c)){a=c;var s=p/4}else 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},Math.easeInOutElastic=function(t,b,c,d,a,p){if(0==t)return b;if(2==(t/=d/2))return b+c;if(p=p||d*(.3*1.5),a<Math.abs(c)){a=c;var s=p/4}else s=p/(2*Math.PI)*Math.asin(c/a);return t<1?a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*-.5+b:a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},Math.easeInBack=function(t,b,c,d,s){return null==s&&(s=1.70158),c*(t/=d)*t*((s+1)*t-s)+b},Math.easeOutBack=function(t,b,c,d,s){return null==s&&(s=1.70158),c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},Math.easeInOutBack=function(t,b,c,d,s){return null==s&&(s=1.70158),(t/=d/2)<1?c/2*(t*t*((1+(s*=1.525))*t-s))+b:c/2*((t-=2)*t*((1+(s*=1.525))*t+s)+2)+b},Math.easeInBounce=function(t,b,c,d){return c-Math.easeOutBounce(d-t,0,c,d)+b},Math.easeOutBounce=function(t,b,c,d){return(t/=d)<1/2.75?c*(7.5625*t*t)+b:t<2/2.75?c*(7.5625*(t-=1.5/2.75)*t+.75)+b:t<2.5/2.75?c*(7.5625*(t-=2.25/2.75)*t+.9375)+b:c*(7.5625*(t-=2.625/2.75)*t+.984375)+b},Math.easeInOutBounce=function(t,b,c,d){return t<d/2?.5*Math.easeInBounce(2*t,0,c,d)+b:.5*Math.easeOutBounce(2*t-d,0,c,d)+.5*c+b};F._one_photo_tab=new Object,F._one_photo_tab.tab_go_go_go=function(active){this.rsp_errs=[],active?(this.style.cursor="default",_ge("one_photo_edit_pop").pop_activate_tab(this.id)):this.style.cursor=F.is_ie?"hand":"pointer"},F._one_photo_tab.tab_activate=function(){this.className="one_photo_tab_active",this.style.cursor="default"},F._one_photo_tab.tab_deactivate=function(){this.className="one_photo_tab",this.style.cursor=F.is_ie?"hand":"pointer"},F._one_photo_tab.onclick=function(e){var e_src=_get_event_src(e);e=e||window.event,e_src==this&&_ge("one_photo_edit_pop").pop_activate_tab(this.id)},F._one_photo_edit_pop=new Object,F._one_photo_edit_pop.num_content_types=4,F._one_photo_edit_pop.pop_go_go_go=function(){F.decorate(this,F._eb).eb_go_go_go(),this.style.position="absolute",this.style.zIndex="995",this.style.top="0",this.style.left="0",this.style.display="none",this.pop_shadow_id=F.make_shadow(this.id,994).id,this.pop_showing=0,this.pop_loading=1,this.pop_fragment_loaded=0;var modal_blocker=document.createElement("DIV");return modal_blocker.id="one_photo_modal_blocker",modal_blocker.style.position="absolute",modal_blocker.style.zIndex="993",modal_blocker.style.top=0,modal_blocker.style.backgroundColor="#999",modal_blocker.style.opacity=".5",modal_blocker.style.filter="alpha(opacity=50)",modal_blocker.style.display="none",document.body.appendChild(modal_blocker),F.eb_add(this),this},F._one_photo_edit_pop.pop_get_mb=function(){return _ge("one_photo_modal_blocker")},F._one_photo_edit_pop.pop_get_active_tab_id=function(){return this.pop_active_tab_id},F._one_photo_edit_pop.pop_get_mat_id_from_tab_id=function(tab_id){return tab_id.replace_global("_tab_","_mat_")},F._one_photo_edit_pop.pop_activate_tab=function(tab_id){var mat_id;this.pop_get_active_tab_id()!=tab_id&&(this.pop_get_active_tab_id()&&this.pop_deactivate_tab(this.pop_get_active_tab_id()),_ge(tab_id).tab_activate(),mat_id=this.pop_get_mat_id_from_tab_id(tab_id),_ge(mat_id).style.display="block",this.pop_active_tab_id=tab_id,this.pop_place(),this.pop_do_focus())},F._one_photo_edit_pop.pop_close_license_pop=function(){(l_pop=_ge("one_photo_license_pop")).style.display="none",this.pop_license_pop_shadow_id&&_ge(this.pop_license_pop_shadow_id).shadow_hide()},F._one_photo_edit_pop.pop_license_was_switched=function(){this.pop_close_license_pop(),this.pop_change_license_name()},F._one_photo_edit_pop.pop_open_license_pop=function(){l_pop=_ge("one_photo_license_pop"),this.pop_license_pop_shadow_id||(this.pop_license_pop_shadow_id=F.make_shadow("one_photo_license_pop",2,this,l_pop).id),l_pop.style.display="block",l_pop.style.visibility="hidden";var x=_pi((this.offsetWidth-l_pop.offsetWidth)/2),y=_pi((this.offsetHeight-l_pop.offsetHeight)/2);l_pop.style.left=x+"px",l_pop.style.top=y+"px",l_pop.style.visibility="visible",_ge(this.pop_license_pop_shadow_id).shadow_size_and_place(),F.is_ie||_ge(this.pop_license_pop_shadow_id).shadow_show()},F._one_photo_edit_pop.pop_toggle_more_perms_table=function(){var table=_ge("one_photo_more_perms_table"),carrot=_ge("one_photo_more_perm_carrot_div");"none"!=table.style.display?(table.style.display="none",carrot.style.display="block"):(table.style.display="block",carrot.style.display="none"),this.pop_place()},F._one_photo_edit_pop.pop_deactivate_tab=function(tab_id){_ge(tab_id)&&(_ge(tab_id).tab_deactivate(),tab_id=this.pop_get_mat_id_from_tab_id(tab_id),_ge(tab_id).style.display="none")},F._one_photo_edit_pop.fragment_onLoad=function(success,responseText,params){this.innerHTML=responseText,this.pop_fragment_loaded=1;for(var tabs=Y.U.Dom.getElementsByClassName("one_photo_tab","div",_ge("one_photo_inner_border_div")),i=0;i<tabs.length;i++)F.decorate(tabs[i],F._one_photo_tab).tab_go_go_go();for(tabs=Y.U.Dom.getElementsByClassName("one_photo_tab_active","div",_ge("one_photo_inner_border_div")),i=0;i<tabs.length;i++)this.pop_active_tab_id=tabs[i].id,F.decorate(tabs[i],F._one_photo_tab).tab_go_go_go(1);F.decorate(_ge("one_photo_more_perm_carrot_div"),F._carrot).carrot_go_go_go("down",0),F.decorate(_ge("one_photo_close_img"),F._simple_button).button_go_go_go(),this.pop_stop_comming(),this.pop_photo&&this.pop_show(this.pop_photo.id,this.pop_A,this.pop_photo_slot,this.pop_what)},F._one_photo_edit_pop.pop_done_hiding=function(){this.style.display="none",_ge(this.pop_shadow_id).shadow_hide(),this.pop_photo=null,this.pop_A=null,this.pop_photo_slot=null,this.pop_what=null,this.pop_get_mb().style.display="none",this.pop_change_next_prev_text(),this.pop_activate_tab("one_photo_tab_title"),this.eb_broadcast("one_photo_onhide"),_ge("one_photo_prev_link").style.visibility="hidden",_ge("one_photo_next_link").style.visibility="hidden",_ge("one_photo_goto_next").style.visibility=_ge("one_photo_goto_next_label").style.visibility="hidden",this.pop_clear_form(),window.ymap&&(ymap._disableKeys=!1),F.eb_broadcast("stewart_play_if_was_playing")},F._one_photo_edit_pop.pop_hide=function(){_ge(this.pop_shadow_id).shadow_hide(),this.pop_close_license_pop();var pop=this;anim_do_opacity_to(pop,5,35,0,"easeInQuad",function(){pop.pop_done_hiding()}),this.pop_showing=0},F._one_photo_edit_pop.pop_show_start=function(p_id,A,photo_slot,what,no_load){this.pop_were_changes_when_opened=F.changes_count,this.eb_broadcast("one_photo_onshow"),this.pop_show(p_id,A,photo_slot,what,no_load)},F._one_photo_edit_pop.pop_show=function(p_id,A,photo_slot,what,no_load){F.eb_broadcast("stewart_pause"),window.ymap&&(ymap._disableKeys=!0),this.pop_photo=global_photos[p_id],this.pop_A=A,this.pop_photo_slot=photo_slot,this.pop_what=what,this.pop_place(),this.pop_fragment_loaded?(this.style.opacity="1",this.style.filter="alpha(opacity=100)",this.style.display="block",this.pop_get_mb().style.display="block",this.pop_place(),_ge(this.pop_shadow_id).shadow_show(),no_load&&this.pop_photo&&null!=this.pop_photo.description?(this.pop_loading=0,this.pop_fill_form(),this.pop_change_next_prev_text(),this.pop_place(),_ge(this.pop_shadow_id).shadow_show(),this.pop_showing=1,this.pop_do_focus()):(this.pop_loading=1,this.pop_clear_form(),this.pop_start_comming(F.output.get("one_photo_edit_loading_info")),F.API.callMethod("flickr.photos.getInfo",{photo_id:p_id,get_contexts:one_photo_show_belongs,get_geofences:!0},this))):(this.pop_loading=1,this.pop_start_comming(F.output.get("loading_interface")),F.fragment_getter.get("/photo_edit_fragment.gne",{one_photo_show_belongs:one_photo_show_belongs},this,"fragment_onLoad"))},F._one_photo_edit_pop.flickr_photos_getInfo_onLoad=function(success,responseXML,responseText){success&&responseXML?(success=responseXML.documentElement.getElementsByTagName("photo")[0],responseXML=_upsert_photo(success),writeAPIDebug(this.pop_photo.toString()),this.pop_stop_comming(),this.pop_show(responseXML.id,this.pop_A,this.pop_photo_slot,this.pop_what,1)):(this.pop_start_comming(F.output.get("one_photo_edit_problem_loading",responseText.escape_for_display()),1,1),this.pop_hide())},F._one_photo_edit_pop.pop_change_next_prev_text=function(what){this.pop_what&&this.pop_what;_ge("one_photo_next_link_what").innerHTML="",_ge("one_photo_prev_link_what").innerHTML="",_ge("one_photo_goto_what").innerHTML=""},F._one_photo_edit_pop.window_onresize=function(){this.pop_place()},F._one_photo_edit_pop.pop_place=function(x_or_func,y_or_func){bgY=window.innerWidth?(ww=window.innerWidth,wh=window.innerHeight,bgX=window.pageXOffset,window.pageYOffset):(ww=document.body.clientWidth,wh=document.body.clientHeight,bgX=document.body.scrollLeft,document.body.scrollTop);var ww,wh,bgX,bgY,pop=this,x_or_func="function"==typeof x_or_func?x_or_func():"number"==typeof x_or_func?x_or_func:(x_or_func=pop.offsetWidth,x_or_func=bgX+_pi((ww-x_or_func)/2),Math.max(x_or_func,1)),y_or_func="function"==typeof y_or_func?y_or_func():"number"==typeof y_or_func?y_or_func:(y_or_func=pop.offsetHeight,y_or_func=bgY+_pi((wh-y_or_func)/2),y_or_func=Math.min(y_or_func,90),Math.max(y_or_func,1)),x_or_func=Math.max(x_or_func,10),y_or_func=Math.max(y_or_func,10),x_or_func=(this.style.left=x_or_func+"px",this.style.top=y_or_func+"px",_ge(this.pop_shadow_id).shadow_size_and_place(),pop.pop_get_mb());x_or_func.style.left=bgX+"px",x_or_func.style.top=bgY+"px",x_or_func.style.width=ww+"px",x_or_func.style.height=wh+"px"},F._one_photo_edit_pop.pop_start_comming=function(msg,hide_anim,show_ok,ok_txt,ok_func,show_cancel,cancel_txt,cancel_func,form_div,show_progress){global_comm_div||_make_comm_div("1002"),x_func=null;var pop=this,modal=(y_func=function(){return pop.pop_place(),_pi(pop.style.top)+100},1);this.pop_fragment_loaded&&(this.pop_place(),modal={opacity:"0",filter:"alpha(opacity=0)"}),global_comm_div.start_comming(msg,x_func,y_func,hide_anim,show_ok,ok_txt,ok_func,show_cancel,cancel_txt,cancel_func,form_div,modal,show_progress)},F._one_photo_edit_pop.pop_stop_comming=function(){global_comm_div.stop_comming()},F._one_photo_edit_pop.pop_go_to_next=function(make_sure){this.pop_go_to_either(1,0,make_sure)},F._one_photo_edit_pop.pop_go_to_previous=function(make_sure){this.pop_go_to_either(-1,0,make_sure)},F._one_photo_edit_pop.pop_get_next_id=function(){return this.pop_go_to_either(1,1)},F._one_photo_edit_pop.pop_get_previous_id=function(){return this.pop_go_to_either(-1,1)},F._one_photo_edit_pop.pop_go_to_either=function(inc,no_go,make_sure){if(!no_go&&make_sure&&this.pop_has_changes())return void _ge("tabl").tabl_start_comming(F.output.get("unsaved_msg"),1,1,F.output.get("yes_discard"),function(){_ge("one_photo_edit_pop").pop_go_to_either(inc,no_go)},1,F.output.get("no_stay_here"),void 0,void 0,void 0,void 0,!0);var make_sure=null,p_id=0,findr=_ge("findr");if(this.pop_A?(curr_index=F.array_index_of(this.pop_A,this.pop_photo.id),p_id=this.pop_A[curr_index+inc]):null!=this.pop_photo_slot&&findr?(make_sure=this.pop_photo_slot+inc,p_id=findr.findr_get_photo_for_slot(make_sure).id):writeDebug("unknown context"),no_go)return p_id;p_id&&!this.pop_loading&&this.pop_show(p_id,this.pop_A,make_sure,this.pop_what)},F._one_photo_edit_pop.pop_clear_form=function(){_ge("one_photo_title").value="",_ge("addtagbox").value="",_ge("one_photo_description").value="",_ge("one_photo_img_div").style.visibility="hidden",_ge("one_photo_date_taken_exact").value="",_ge("one_photo_time_taken_exact").value="",_ge("one_photo_date_posted_exact").value="",_ge("one_photo_time_posted_exact").value="",_ge("one_photo_geo_data_lon").value="",_ge("one_photo_geo_data_lat").value="",_ge("div_load_photo_on_map").style.display="none",_ge("one_photo_geofence_title")&&(_ge("one_photo_geofence_title").innerHTML=""),_ge("one_photo_geofence")&&(_ge("one_photo_geofence").style.display="none"),_ge("one_photo_mat_belongs_list_div").innerHTML=""},F._one_photo_edit_pop.pop_fill_form=function(){disable_geo||(prefs_isset_viewgeo&&"true"!=_qs_args.show_geo_pref?_ge("one_photo_tab_loc").style.display="inline":_ge("one_photo_tab_loc").style.display="none");for(var p=this.pop_photo,show_text_className="video"==p.media?"one_photo_v_text":"one_photo_p_text",hide_text_className="video"==p.media?"one_photo_p_text":"one_photo_v_text",hide_text_els=Y.U.Dom.getElementsByClassName(hide_text_className),i=0;i<hide_text_els.length;i++)hide_text_els[i].style.display="none";for(var show_text_els=Y.U.Dom.getElementsByClassName(show_text_className),i=0;i<show_text_els.length;i++)show_text_els[i].style.display="inline";for(var hide_text_className=this.pop_get_previous_id(),show_text_className=this.pop_get_next_id(),tempA=(_ge("one_photo_prev_link").style.visibility=hide_text_className?"visible":"hidden",_ge("one_photo_next_link").style.visibility=show_text_className?"visible":"hidden",_ge("one_photo_goto_next").style.visibility=_ge("one_photo_goto_next_label").style.visibility=show_text_className?"visible":"hidden",this.pop_is_there_a_next=show_text_className,_ge("one_photo_title").value=p.title,[]),i=0;i<p.tags_rawA.length;i++){var tag=p.tags_rawA[i];-1!=tag.indexOf(" ")&&(tag='"'+tag+'"'),tempA.push(tag)}var hide_text_className=tempA.join(" "),show_text_className=(_ge("addtagbox").value=hide_text_className,_ge("one_photo_description").value=p.description,'<img src="'+_get_photo_src(p,"m")+'" style=""'),hide_text_className=("video"==p.media&&p.video_ready?(w=+p.video_width,h=+p.video_height):p.o_h&&p.o_w,(240<w||240<h)&&(w*=hide_text_className=Math.min(240/h,240/w),h*=hide_text_className),w&&h&&(show_text_className+=' height="'+h+'" width="'+w+'"'),show_text_className+=">","video"==p.media&&p.video_ready&&(show_text_className='<span class="photo_container pc_m" id="stewart_swf_'+p.id+'one_photo_div" >'+show_text_className+'<a href="/photos/'+p.owner_nsid+"/"+p.id+'/" class="pc_link" id="stewart_swf_'+p.id+'one_photo_trigger_a"><img src="/images/video_play_icon_medium.png" alt="Play Video"></a></span>'),_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<i;i--)if(+(option=month_s.options[i]).value==taken_month){option.selected=1;break}for(var option,year_s=_ge("one_photo_date_taken_approx_year"),i=year_s.options.length-1;-1<i;i--)if(+(option=year_s.options[i]).value==taken_year){option.selected=1;break}0==p.date_taken_granularity?(_ge("one_photo_date_taken_exact_div").style.display="block",_ge("one_photo_date_taken_approx_div").style.display="none",_ge("one_photo_date_taken_exact_switcher").style.display="none",_ge("one_photo_date_taken_approx_switcher").style.display="inline"):(_ge("one_photo_date_taken_exact_div").style.display="none",_ge("one_photo_date_taken_approx_div").style.display="block",_ge("one_photo_date_taken_exact_switcher").style.display="inline",_ge("one_photo_date_taken_approx_switcher").style.display="none");hide_text_className=F.convert_unix_time_stamp(p.date_upload),show_text_className=(hide_text_className.getMonth()+1).addZeros(2)+"/"+hide_text_className.getDate().addZeros(2)+"/"+hide_text_className.getFullYear(),w=hide_text_className.getHours().addZeros(2)+":"+hide_text_className.getMinutes().addZeros(2)+":"+hide_text_className.getSeconds().addZeros(2),_ge("one_photo_date_posted_exact").value=show_text_className,_ge("one_photo_time_posted_exact").value=w,h=_pf(p.longitude)&&_pf(p.latitude)?p.latitude:"",hide_text_className=_pf(p.longitude)&&_pf(p.latitude)?p.longitude:"";if(_ge("one_photo_geo_data_lat").value=h,_ge("one_photo_geo_data_lon").value=hide_text_className,0<h.length&&0<hide_text_className.length&&_ge("tabl")&&"tabl_tab_map"==_ge("tabl").tabl_get_active_tab_id()?(_ge("map_controller")._photo_to_open=_pi(p.id),_ge("div_load_photo_on_map").style.display="block"):_ge("div_load_photo_on_map").style.display="none",0!=_pi(p.accuracy)?"1"==p.geo_is_family&&"1"==p.geo_is_friend?_ge("one_photo_perm_viewgeo_2").checked=1:"1"==p.geo_is_family?_ge("one_photo_perm_viewgeo_4").checked=1:"1"==p.geo_is_friend?_ge("one_photo_perm_viewgeo_3").checked=1:"1"==p.geo_is_contact?_ge("one_photo_perm_viewgeo_1").checked=1:"1"==p.geo_is_public?_ge("one_photo_perm_viewgeo_0").checked=1:_ge("one_photo_perm_viewgeo_5").checked=1:_ge("one_photo_perm_viewgeo_"+user_default_geo).checked=1,void 0!==p.geofence_count&&0<p.geofence_count?(1==p.geofence_count?_ge("one_photo_geofence_title")&&(_ge("one_photo_geofence_title").innerHTML=p.geofence_label?F.output.get("organizer_geofence_title_name",p.geofence_label.truncate_with_ellipses(40).escape_for_display()):F.output.get("organizer_geofence_title_noname")):_ge("one_photo_geofence_title")&&(_ge("one_photo_geofence_title").innerHTML=F.output.get("organizer_geofence_title_number",p.geofence_count)),_ge("one_photo_geofence")&&(_ge("one_photo_geofence").style.display="block")):(_ge("one_photo_geofence_title")&&(_ge("one_photo_geofence_title").innerHTML=""),_ge("one_photo_geofence")&&(_ge("one_photo_geofence").style.display="none")),global_eighteen)if(_ge("one_photo_safety_level_"+p.safety_level)&&(_ge("one_photo_safety_level_"+p.safety_level).checked=1),_ge("one_photo_content_type_"+p.content_type)&&(_ge("one_photo_content_type_"+p.content_type).checked=1),can_set_non_safe||(_ge("one_photo_safety_level_1").disabled=1,_ge("one_photo_safety_level_2").disabled=1,Y.D.addClass("one_photo_safety_level_1_label","findr_input_disabled"),Y.D.addClass("one_photo_safety_level_2_label","findr_input_disabled"),0!=p.safety_level?(_ge("one_photo_safety_level_0").disabled=1,Y.D.addClass("one_photo_safety_level_0_label","findr_input_disabled")):(_ge("one_photo_safety_level_0").disabled=0,Y.D.removeClass("one_photo_safety_level_0_label","findr_input_disabled")),_ge("one_photo_mat_can_not_set_nonsafe_div").style.display="block"),"0"==p.moderation_mode||"3"==p.moderation_mode){for(i=0;i<this.num_content_types;i++)_ge("one_photo_safety_level_"+i)&&can_set_non_safe&&(_ge("one_photo_safety_level_"+i).disabled=0,Y.D.removeClass("one_photo_safety_level_"+i+"_label","findr_input_disabled")),_ge("one_photo_content_type_"+i)&&(_ge("one_photo_content_type_"+i).disabled=0,Y.D.removeClass("one_photo_content_type_"+i+"_label","findr_input_disabled"));_ge("one_photo_mat_filters_moderated_div").style.display="none"}else{for(i=0;i<this.num_content_types;i++)_ge("one_photo_safety_level_"+i)&&(_ge("one_photo_safety_level_"+i).disabled=1,Y.D.addClass("one_photo_safety_level_"+i+"_label","findr_input_disabled")),_ge("one_photo_content_type_"+i)&&(_ge("one_photo_content_type_"+i).disabled=1,Y.D.addClass("one_photo_content_type_"+i+"_label","findr_input_disabled"));_ge("one_photo_mat_filters_moderated_div").style.display="block",_ge("one_photo_mat_filters_moderated_a").href="/help/contact/?cat_shortcut=review_photo&photo_id="+p.id}for(var license_r=_ge("one_photo_license_form").one_photo_license,i=0;i<license_r.length;i++){var r=license_r[i];if(r.value==p.license_id){r.checked=1;break}}this.pop_change_license_name(),window.user_license_restricted&&(show_text_className=_ge("one_photo_change_license_link_span"))&&(show_text_className.style.display="none"),_ge("one_photo_is_public").checked=1,_ge("one_photo_is_family").checked=1,_ge("one_photo_is_friend").checked=1,"0"==p.is_public&&(_ge("one_photo_is_private").checked=1,"1"!=p.is_friend&&(_ge("one_photo_is_friend").checked=0),"1"!=p.is_family)&&(_ge("one_photo_is_family").checked=0);var w={0:"4",1:"3",2:"2",3:"1"},belongs_htmlA=(w[p.perm_comment]||(p.perm_comment=3),w[p.perm_addmeta]||(p.perm_addmeta=3),_ge("one_photo_perm_comment_"+w[p.perm_comment]).checked=1,_ge("one_photo_perm_addmeta_"+w[p.perm_addmeta]).checked=1,_privacy_specific_change("one_photo_",1),[]);if(belongs_htmlA.push(F.output.get("one_photo_edit_sets_title")),p.sets)for(i=0;i<p.sets.length;i++){var set=global_sets[p.sets[i]];set&&belongs_htmlA.push(this.pop_generate_set_HTML(set))}else belongs_htmlA.push(F.output.get("one_photo_edit_none"));if(belongs_htmlA.push(F.output.get("one_photo_edit_groups_title")),p.pools)for(i=0;i<p.pools.length;i++){var group=global_groups[p.pools[i]];group&&belongs_htmlA.push(this.pop_generate_group_HTML(group))}else belongs_htmlA.push(F.output.get("one_photo_edit_none"));_ge("one_photo_mat_belongs_list_div").innerHTML=belongs_htmlA.join(""),this.pop_add_form_handlers(),this.pop_form_data_saved=this.pop_get_data_from_form(),this.pop_disable_save_and_revert_buttons(),this.pop_slot&&_ge("findr")&&_ge("findr").findr_place_slot_in_mid(this.pop_slot)},F._one_photo_edit_pop.pop_generate_set_HTML=function(set){var photo=global_photos[set.primary_photo_id];return'<table class="existing_set_table" cellpadding="0" cellspacing="0" border="0"><tr><td><img src="'+_get_photo_src(photo)+'" width="25" height="25" alt="" title=""></td><td>'+set.title.truncate_with_ellipses(40).escape_for_display()+" (<b>"+set.count.pretty_num()+"</b>)</td></tr></table>"},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+=' <span class="group_pipe"> | </span> '+F.output.get("one_photo_edit_limit")+" "+_get_group_throttle_txt(group))):txt=F.output.get("one_photo_edit_no_longer_member"),'<table class="existing_group_table" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><img src="'+group.icon_url+'" width="24" height="24" alt="" title=""></td><td><b>'+group.name.truncate_with_ellipses(40).escape_for_display()+"</b><br>"+txt+"</td></tr></table>"},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;i<license_r.length;i++){var r=license_r[i];if(r.checked){license_name=_ge("one_photo_license_label"+r.value).innerHTML;break}}_ge("one_photo_current_license_name").innerHTML=license_name},F._one_photo_edit_pop.pop_do_focus=function(){this.pop_showing&&"one_photo_tab_title"==this.pop_get_active_tab_id()&&(_ge("one_photo_title").focus(),_ge("one_photo_title").select())},F._one_photo_edit_pop.pop_get_data_from_form=function(){for(var ob={},license_id=(ob.title=_ge("one_photo_title").value,ob.description=_ge("one_photo_description").value,ob.tags=_ge("addtagbox").value,ob.dates=F.get_dates_from_form("one_photo_",0),ob.lat=_ge("one_photo_geo_data_lat").value,ob.lon=_ge("one_photo_geo_data_lon").value,"0"),license_r=_ge("one_photo_license_form").one_photo_license,i=0;i<license_r.length;i++)if(license_r[i].checked){license_id=license_r[i].value;break}ob.license_id=license_id,ob.is_private=_ge("one_photo_is_private").checked?1:0,ob.is_public=ob.is_private?0:1,ob.is_friend=ob.is_public||_ge("one_photo_is_friend").checked?1:0,ob.is_family=ob.is_public||_ge("one_photo_is_family").checked?1:0,ob.safety_level=_ge("one_photo_safety_level_1").checked?1:0,ob.safety_level=_ge("one_photo_safety_level_2").checked?2:ob.safety_level,global_eighteen&&(_ge("one_photo_content_type_3")&&_ge("one_photo_content_type_3").checked?ob.content_type=3:_ge("one_photo_content_type_2").checked?ob.content_type=2:_ge("one_photo_content_type_1").checked?ob.content_type=1:ob.content_type=0),ob.geo_is_public=_ge("one_photo_perm_viewgeo_0").checked?1:0,ob.geo_is_family=_ge("one_photo_perm_viewgeo_2").checked||_ge("one_photo_perm_viewgeo_4").checked?1:0,ob.geo_is_friend=_ge("one_photo_perm_viewgeo_2").checked||_ge("one_photo_perm_viewgeo_3").checked?1:0,ob.geo_is_contact=_ge("one_photo_perm_viewgeo_1").checked?1:0,ob.perm_comment="0",_ge("one_photo_perm_comment_3").checked&&(ob.perm_comment="1"),_ge("one_photo_perm_comment_2").checked&&(ob.perm_comment="2"),_ge("one_photo_perm_comment_1").checked&&(ob.perm_comment="3"),ob.perm_addmeta="0",_ge("one_photo_perm_addmeta_3").checked&&(ob.perm_addmeta="1"),_ge("one_photo_perm_addmeta_2").checked&&(ob.perm_addmeta="2"),_ge("one_photo_perm_addmeta_1").checked&&(ob.perm_addmeta="3");for(i in ob)0;return ob},F._one_photo_edit_pop.pop_on_form_activity=function(){this.pop_has_changes()?(F.changes_were_made(F.output.get("one_photo_edit_photo_changed")),this.pop_enable_save_and_revert_buttons()):(this.pop_were_changes_when_opened||F.changes_were_saved(),this.pop_disable_save_and_revert_buttons())},F._one_photo_edit_pop.pop_add_form_handlers=function(){function activity_func_timed(e){setTimeout("_ge('one_photo_edit_pop').pop_on_form_activity();",100)}function perms_switch_func(e){_privacy_specific_change("one_photo_"),activity_func()}function license_switch_func(e){_ge("one_photo_edit_pop").pop_license_was_switched(),activity_func()}for(var activity_func=function(e){_ge("one_photo_edit_pop").pop_on_form_activity()},license_r=(_ge("one_photo_date_taken_exact_switcher").onclick=_ge("one_photo_date_taken_approx_switcher").onclick=function(e){return _ge("one_photo_edit_pop").pop_toggle_date_taken(),activity_func(),!1},Y.E.addListener(_ge("one_photo_title"),"change",activity_func),Y.E.addListener(_ge("one_photo_title"),"keyup",activity_func),Y.E.addListener(_ge("one_photo_title"),"keydown",activity_func_timed),Y.E.addListener(_ge("addtagbox"),"change",activity_func),Y.E.addListener(_ge("addtagbox"),"keyup",activity_func),Y.E.addListener(_ge("addtagbox"),"keydown",activity_func_timed),Y.E.addListener(_ge("one_photo_description"),"change",activity_func),Y.E.addListener(_ge("one_photo_description"),"keyup",activity_func),Y.E.addListener(_ge("one_photo_description"),"keydown",activity_func_timed),Y.E.addListener(_ge("one_photo_date_taken_exact"),"change",activity_func),Y.E.addListener(_ge("one_photo_date_taken_exact"),"keyup",activity_func),Y.E.addListener(_ge("one_photo_date_taken_exact"),"keydown",activity_func_timed),Y.E.addListener(_ge("one_photo_date_taken_exact"),"focus",activity_func),Y.E.addListener(_ge("one_photo_time_taken_exact"),"change",activity_func),Y.E.addListener(_ge("one_photo_time_taken_exact"),"keyup",activity_func),Y.E.addListener(_ge("one_photo_time_taken_exact"),"keydown",activity_func_timed),Y.E.addListener(_ge("one_photo_date_taken_approx_month"),"change",activity_func),Y.E.addListener(_ge("one_photo_date_taken_approx_year"),"change",activity_func),Y.E.addListener(_ge("one_photo_date_posted_exact"),"change",activity_func),Y.E.addListener(_ge("one_photo_date_posted_exact"),"keyup",activity_func),Y.E.addListener(_ge("one_photo_date_posted_exact"),"keydown",activity_func_timed),Y.E.addListener(_ge("one_photo_date_posted_exact"),"focus",activity_func),Y.E.addListener(_ge("one_photo_time_posted_exact"),"change",activity_func),Y.E.addListener(_ge("one_photo_time_posted_exact"),"keyup",activity_func),Y.E.addListener(_ge("one_photo_time_posted_exact"),"keydown",activity_func_timed),disable_geo||(Y.E.addListener(_ge("one_photo_geo_data_lon"),"change",activity_func),Y.E.addListener(_ge("one_photo_geo_data_lon"),"keyup",activity_func),Y.E.addListener(_ge("one_photo_geo_data_lon"),"keydown",activity_func_timed),Y.E.addListener(_ge("one_photo_geo_data_lat"),"change",activity_func),Y.E.addListener(_ge("one_photo_geo_data_lat"),"keyup",activity_func),Y.E.addListener(_ge("one_photo_geo_data_lat"),"keydown",activity_func_timed)),_ge("one_photo_license_form").one_photo_license),i=0;i<license_r.length;i++)Y.E.addListener(license_r[i],"click",license_switch_func);if(!disable_geo)for(i=0;i<7;i++)Y.E.addListener(_ge("one_photo_perm_viewgeo_"+i),"click",activity_func);Y.E.addListener(_ge("one_photo_is_private"),"click",perms_switch_func),Y.E.addListener(_ge("one_photo_is_public"),"click",perms_switch_func),Y.E.addListener(_ge("one_photo_is_family"),"click",perms_switch_func),Y.E.addListener(_ge("one_photo_is_friend"),"click",perms_switch_func);for(i=1;i<5;i++)Y.E.addListener(_ge("one_photo_perm_comment_"+i),"click",activity_func),Y.E.addListener(_ge("one_photo_perm_addmeta_"+i),"click",activity_func);if(!disable_geo)for(i=0;i<7;i++)Y.E.addListener(_ge("one_photo_perm_viewgeo_"+i),"change",activity_func);Y.E.addListener(_ge("one_photo_is_private"),"change",perms_switch_func),Y.E.addListener(_ge("one_photo_is_public"),"change",perms_switch_func),Y.E.addListener(_ge("one_photo_is_family"),"change",perms_switch_func),Y.E.addListener(_ge("one_photo_is_friend"),"change",perms_switch_func);for(i=1;i<5;i++)Y.E.addListener(_ge("one_photo_perm_comment_"+i),"change",activity_func),Y.E.addListener(_ge("one_photo_perm_addmeta_"+i),"change",activity_func);if(global_eighteen)for(i=0;i<this.num_content_types;i++)_ge("one_photo_safety_level_"+i)&&(Y.E.addListener(_ge("one_photo_safety_level_"+i),"change",activity_func),Y.E.addListener(_ge("one_photo_safety_level_"+i),"click",activity_func)),_ge("one_photo_content_type_"+i)&&(Y.E.addListener(_ge("one_photo_content_type_"+i),"change",activity_func),Y.E.addListener(_ge("one_photo_content_type_"+i),"click",activity_func));this.pop_add_form_handlers=function(){}},F._one_photo_edit_pop.pop_toggle_date_taken=function(){"none"==_ge("one_photo_date_taken_exact_div").style.display?(_ge("one_photo_date_taken_exact_div").style.display="block",_ge("one_photo_date_taken_approx_div").style.display="none",_ge("one_photo_date_taken_exact_switcher").style.display="none",_ge("one_photo_date_taken_approx_switcher").style.display="inline"):(_ge("one_photo_date_taken_exact_div").style.display="none",_ge("one_photo_date_taken_approx_div").style.display="block",_ge("one_photo_date_taken_exact_switcher").style.display="inline",_ge("one_photo_date_taken_approx_switcher").style.display="none")},F._one_photo_edit_pop.pop_disable_save_and_revert_buttons=function(){this.pop_disable_save_button(),this.pop_disable_revert_button()},F._one_photo_edit_pop.pop_enable_save_and_revert_buttons=function(){this.pop_enable_save_button(),this.pop_enable_revert_button()},F._one_photo_edit_pop.pop_disable_save_button=function(){_ge("one_photo_save").disabled=!0,_ge("one_photo_save").className="DisabledButt"},F._one_photo_edit_pop.pop_enable_save_button=function(){_ge("one_photo_save").disabled=!1,_ge("one_photo_save").className="Butt"},F._one_photo_edit_pop.pop_disable_revert_button=function(){_ge("one_photo_revert_link").style.visibility="hidden",_ge("one_photo_revert_link").onclick=function(){return this.blur(),!1}},F._one_photo_edit_pop.pop_enable_revert_button=function(){_ge("one_photo_revert_link").style.visibility="visible",_ge("one_photo_revert_link").onclick=function(){return this.blur(),_ge("one_photo_edit_pop").pop_revert(),!1}},F._one_photo_edit_pop.pop_delete_photo=function(confirm){var pop;confirm?(this.pop_start_comming(F.output.get("one_photo_edit_deleting")),F.API.callMethod("flickr.photos.delete",{photo_id:this.pop_photo.id},this)):(confirm=F.output.get("one_photo_edit_really_delete"),(pop=this).pop_start_comming(confirm,1,1,F.output.get("yes_delete"),function(){pop.pop_delete_photo(1)},1,F.output.get("one_photo_edit_no")))},F._one_photo_edit_pop.flickr_photos_delete_onLoad=function(success,responseXML,responseText){success?this.pop_done_deleting():this.pop_start_comming(F.output.get("api_err_generic")+" "+responseText.escape_for_display(),1,1)},F._one_photo_edit_pop.pop_done_deleting=function(){this.pop_were_changes_when_opened||F.changes_were_saved(),this.pop_stop_comming(),this.eb_broadcast("one_photo_on_save",this.pop_photo.id,0,1),this.pop_hide();global_photos[this.pop_photo.id];global_photos[this.pop_photo.id]=null,delete global_photos[this.pop_photo.id]},F._one_photo_edit_pop.pop_save=function(){exp_rsps=0;var geo_params,changed=this.pop_what_changed(),now=changed.now,err_msg="";""!=(err_msg=changed.tags&&F.get_tags_from_input_str(now.tags).length>global_tag_limit?F.output.get("too_many_tags",global_tag_limit):err_msg)?(err_msg="<b>"+F.output.get("cant_save")+"</b> "+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<this.rsp_errs.length){for(var msg="<b>"+F.output.get("not_all_saved")+"</b>",i=0;i<this.rsp_errs.length;i++)msg+="<br><br>"+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<url.indexOf("?")?"&":"?",url+="likes_hd="+likes_hd,document.location=url}},F._stewart_swf_div={swf_path:"/apps/video/stewart.swf.v"+global_stewartVersion,swf_id:"",is_playing:!1,was_playing:!1,play_tim:null,stewart_swf_event:function(pType,pItem){writeDebug("stewart_swf_event this.id:"+this.id+" pType:"+pType+" pItem:"+pItem);_ge(this.swf_id);"isPlayingChanged"==pType&&(this.is_playing="true"==pItem,this.is_playing&&this.stewart_hide_loading_el()),"showingPhotoAtStart"==pType&&this.stewart_hide_loading_el(),"platformReady"==pType&&this.stewart_swap_img_out()},stewart_hide_loading_el:function(){_ge(this.loading_el_id)&&(_ge(this.loading_el_id).style.display="none")},stewart_swap_img_in:function(){_ge(this.swf_id)&&(_ge(this.swf_id).style.visibility="hidden"),_ge(this.img_id)&&(_ge(this.img_id).style.display="block")},stewart_swap_img_out:function(){_ge(this.swf_id)&&(_ge(this.swf_id).style.visibility="visible"),_ge(this.img_id)&&(_ge(this.img_id).style.display="none")},stewart_play_after_pause:function(){var self=_ge(this.id),stew=_ge(this.swf_id);this.play_tim&&clearTimeout(this.play_tim),this.play_tim=setTimeout(function(){self.stewart_need_to_hide_video&&self.stewart_swap_img_out(),stew&&stew.playVideo&&(self.was_playing=!1,stew.playVideo())},200)},stewart_play_if_was_playing:function(){this.was_playing?this.stewart_play_after_pause():this.stewart_need_to_hide_video&&this.stewart_swap_img_out()},stewart_pause_if_need_to_hide_video:function(){this.stewart_need_to_hide_video&&this.stewart_pause()},stewart_pause:function(){this.stewart_need_to_hide_video&&this.stewart_swap_img_in(),this.play_tim&&clearTimeout(this.play_tim),this.play_tim=null;var was_playing=!1;if(this.is_playing){was_playing=!0;var stew=_ge(this.swf_id);stew&&stew.getIsPlaying&&(was_playing=stew.getIsPlaying(),stew.pauseVideo&&stew.pauseVideo()),this.was_playing=was_playing}},stewart_go_go_go:function(w,h,init_ob,wait,thumb_src){F.eb_add(this),this.loading_el_id=this.id.replace_global("_div","_loading_el"),this.img_id=this.id.replace_global("_div","_img"),this.swf_id=this.id.replace_global("_div",""),this.form_id=this.id.replace_global("_div","_form"),this.wait=wait,this.stewart_need_to_hide_video=window.opera||F.is_chrome||!F.is_safari&&!(F.is_ff3&&F.is_mac),this.flash_version=deconcept.SWFObjectUtil.getPlayerVersion(),_qs_args.noflash&&(this.flash_version.major=0),writeDebug("Flash:"+this.flash_version.major+"."+this.flash_version.minor+"r"+this.flash_version.rev),this.w=w.toString(),this.h=h.toString(),this.thumb_src=thumb_src,this.init_ob=init_ob,this.stewart_make_sure_we_have_thumb_src(),this.style.position="relative",_ge(this.form_id)&&this.stewart_add_form();var this_id=this.id;if(this.wait){if(this.stewart_is_flash_good()){var trigger_a_id=this.id.replace_global("_div","_trigger_a"),trigger_a=_ge(trigger_a_id);trigger_a&&(trigger_a.onclick=function(){if(_ge(this_id)&&_ge(this_id).stewart_write)return _ge(this_id).stewart_write(),!1});var big_trigger_a_id=this.id.replace_global("_div","_big_trigger_a"),big_trigger_a=_ge(big_trigger_a_id);big_trigger_a&&(big_trigger_a.onclick=trigger_a.onclick)}}else if(Y.U.Dom.hasClass(this,"photo_gne_video_wrapper_div")&&(this.style.backgroundColor="black"),this.stewart_is_flash_good()){var img;if(window.video_has_had_focus||1,F.is_safari&&0,0)(img=document.createElement("IMG")).id="stewart_temp_jpg",img.src=this.thumb_src,img.width=this.w,img.height=this.h,img.style.position="absolute",img.style.display="block",this.appendChild(img),(img=document.createElement("IMG")).id="stewart_play_button",img.src=_images_root+"/video_play_icon_large.png",img.width=40,img.height=22,img.style.position="absolute",img.style.display="block",img.style.left=Math.round(this.w/2)-Math.round(img.width/2)+"px",img.style.top=Math.round(this.h/2)-Math.round(img.height/2)+"px",this.appendChild(img),window.video_play_on_focus=function(){window.video_has_had_focus=1,Y.U.Event.removeListener(window,"focus",window.video_play_on_focus),_ge(this_id).stewart_write()},Y.U.Event.addListener(window,"focus",window.video_play_on_focus);else this.stewart_write()}else _ge("photo_gne_flash_notice_div")&&(_ge("photo_gne_flash_notice_div").style.display="block")},stewart_make_sure_we_have_thumb_src:function(){this.thumb_src=!this.thumb_src&&global_photos&&global_photos[this.init_ob.photo_id]&&global_photos[this.init_ob.photo_id].video_thumb_src?global_photos[this.init_ob.photo_id].video_thumb_src:this.thumb_src},stewart_is_flash_good:function(){return!(1*this.flash_version.major<9)&&(1*this.flash_version.major==9&&0<1*this.flash_version.minor||(1*this.flash_version.major==9&&28<=1*this.flash_version.rev||10<=1*this.flash_version.major))},stewart_write:function(force){if(!this.stewart_wrote||force){var so=new SWFObject(this.swf_path,this.swf_id,this.w,this.h,9,"#000000");so.addParam("wmode","opaque"),so.addParam("allowFullScreen","true"),so.addParam("allowScriptAccess","always"),so.addParam("bgcolor","#000000"),so.addVariable("intl_lang",global_intl_lang),so.addVariable("div_id",this.id),so.addVariable("flickr_notracking","true"),so.addVariable("flickr_target","_self"),so.addVariable("flickr_h",this.h),so.addVariable("flickr_w",this.w),so.addVariable("flickr_no_logo","true");var hash=F.get_hash();for(var p in hash&&hash.indexOf&&0==hash.indexOf("comment")&&(this.init_ob.flickr_noAutoPlay="true"),this.init_ob)null!=this.init_ob[p]&&null!=this.init_ob[p]&&so.addVariable(p,this.init_ob[p]);if("0"!=_qs_args.doSmall?so.addVariable("flickr_doSmall","true"):so.addVariable("flickr_doSmall","false"),"1"==_qs_args.noLimit&&so.addVariable("flickr_noLimit","true"),"1"==_qs_args.debugPos&&so.addVariable("flickr_debugPos","true"),"1"==_qs_args.use_debugswf&&so.addVariable("use_debugswf","true"),"1"==_qs_args.noBuffer&&so.addVariable("flickr_noBuffer","true"),this.init_ob.onsite){var loading_el=document.createElement("DIV");if(loading_el.id=this.loading_el_id,loading_el.className="loading_el",loading_el.innerHTML=F.output.get("loading"),"absolute"!=Y.U.Dom.getStyle(this.parentNode,"position")&&(this.parentNode.style.position="relative"),this.parentNode.appendChild(loading_el),!this.parentNode.offsetWidth||Y.U.Dom.hasClass(this,"photo_gne_video_wrapper_div")||Y.U.Dom.hasClass(this,"pc_l")||Y.U.Dom.hasClass(this,"bbml_img"))lel_left=Math.round(this.w/2)-Math.round(loading_el.offsetWidth/2);else var lel_left=Math.round(this.parentNode.offsetWidth/2)-Math.round(loading_el.offsetWidth/2);var lel_top=Math.round(this.h/2)-Math.round(loading_el.offsetHeight/2);loading_el.style.left=lel_left+"px",loading_el.style.top=lel_top+"px"}if(this.wait){var self=this;setTimeout(function(){self.stewart_actually_write(so)},100)}else this.stewart_actually_write(so);this.stewart_wrote=1}},stewart_actually_write:function(so){var extraHTML="";this.stewart_make_sure_we_have_thumb_src(),this.stewart_need_to_hide_video&&this.thumb_src&&(extraHTML='<img style="display:none; position:absolute;" id="'+this.img_id+'" width="'+this.w+'" height="'+this.h+'" src="'+this.thumb_src+'">'),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<this.installedVer.major&&(deconcept.SWFObject.doPrepUnload=!0),c&&this.addParam("bgcolor",c),q=q||"high",this.addParam("quality",q),this.setAttribute("useExpressInstall",!1),this.setAttribute("doExpressInstall",!1),xir=xir||window.location,this.setAttribute("xiRedirectUrl",xir),this.setAttribute("redirectUrl",""),redirectUrl&&this.setAttribute("redirectUrl",redirectUrl))},deconcept.SWFObject.prototype={useExpressInstall:function(path){this.xiSWFPath=path||"expressinstall.swf",this.setAttribute("useExpressInstall",!0)},setAttribute:function(name,value){this.attributes[name]=value},getAttribute:function(name){return this.attributes[name]},addParam:function(name,value){this.params[name]=value},getParams:function(){return this.params},addVariable:function(name,value){this.variables[name]=value},getVariable:function(name){return this.variables[name]},getVariables:function(){return this.variables},getVariablePairs:function(){var key,variablePairs=new Array,variables=this.getVariables();for(key in variables)variablePairs[variablePairs.length]=key+"="+variables[key];return variablePairs},getSWFHTML:function(extraHTML){var params,key,pairs,swfNode="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){for(key in this.getAttribute("doExpressInstall")&&(this.addVariable("MMplayerType","PlugIn"),this.setAttribute("swf",this.xiSWFPath)),swfNode='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"',swfNode+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" base="'+this.getAttribute("base")+'" ',params=this.getParams())swfNode+=[key]+'="'+params[key]+'" ';0<(pairs=this.getVariablePairs().join("&")).length&&(swfNode+='flashvars="'+pairs+'"'),swfNode+="/>"}else{for(key in this.getAttribute("doExpressInstall")&&(this.addVariable("MMplayerType","ActiveX"),this.setAttribute("swf",this.xiSWFPath)),swfNode='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">',swfNode+='<param name="movie" value="'+this.getAttribute("swf")+'" />',swfNode+='<param name="base" value="'+this.getAttribute("base")+'" />',params=this.getParams())swfNode+='<param name="'+key+'" value="'+params[key]+'" />';0<(pairs=this.getVariablePairs().join("&")).length&&(swfNode+='<param name="flashvars" value="'+pairs+'" />'),swfNode+="</object>"}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.major<fv.major)&&(this.major>fv.major||!(this.minor<fv.minor)&&(this.minor>fv.minor||!(this.rev<fv.rev)))},deconcept.util={getRequestParameter:function(param){var q=document.location.search||document.location.hash;if(null==param)return q;if(q)for(var pairs=q.substring(1).split("&"),i=0;i<pairs.length;i++)if(pairs[i].substring(0,pairs[i].indexOf("="))==param)return pairs[i].substring(pairs[i].indexOf("=")+1);return""}},deconcept.SWFObjectUtil.cleanupSWFs=function(){for(var objects=document.getElementsByTagName("OBJECT"),i=objects.length-1;0<=i;i--)for(var x in objects[i].style.display="none",objects[i])"function"==typeof objects[i][x]&&(objects[i][x]=function(){})},deconcept.SWFObject.doPrepUnload&&(deconcept.unloadSet||(deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){},__flash_savedUnloadHandler=function(){},window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)},window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload),deconcept.unloadSet=!0)),!document.getElementById&&document.all&&(document.getElementById=function(id){return document.all[id]});var getQueryParamValue=deconcept.util.getRequestParameter,FlashObject=deconcept.SWFObject,SWFObject=deconcept.SWFObject;function SWFMacMouseWheel(swfObject){this.so=swfObject,-1!=navigator.appVersion.toLowerCase().indexOf("mac")&&this.init()}SWFMacMouseWheel.prototype={init:function(){SWFMacMouseWheel.instance=this,window.addEventListener&&window.addEventListener("DOMMouseScroll",SWFMacMouseWheel.instance.wheel,!1),window.onmousewheel=document.onmousewheel=SWFMacMouseWheel.instance.wheel},handle:function(delta){document[this.so.getAttribute("id")].externalMouseEvent(delta)},wheel:function(event){var delta=0;event.wheelDelta?(delta=event.wheelDelta/120,window.opera&&(delta=-delta)):event.detail&&(delta=-event.detail/3),/AppleWebKit/.test(navigator.userAgent)&&(delta/=3),delta&&SWFMacMouseWheel.instance.handle(delta),event.preventDefault&&event.preventDefault(),event.returnValue=!1}};var icon_ccbgdiv=null,icon_ccdiv=null,icon_doneit=null,icon_isPopped=!1,icon_scrollTim=null,icon_popup_w=330,icon_popup_h=394,icon_buddyIcon=null,user_data=null,icon_progress_w=136,icon_progress_h=49,icon_after_contact_change_funcs=[],listeners={},idIncrementor=0,getUniqueId=function(){return++idIncrementor+""};function icon_windowClose(){clearTimeout(icon_scrollTim),Y.U.Event.removeListener(window,"resize",icon_positionWindow),Y.U.Event.removeListener(window,"scroll",icon_positionWindowOnScroll),icon_ccdiv.style.display="none",icon_ccbgdiv.style.display="none",icon_isPopped=!1,F.is_safari||(F.is_ff2||F.is_ff3)&&F.is_mac||F.eb_broadcast("stewart_play_if_was_playing")}function icon_windowOpenFromHover(nsid){if(user_data=_ge("person_hover").hover_persons[nsid]){return icon_windowOpen()}alert(F.output.get("personmenu_buddyicon")+" '"+nsid+"'")}function icon_windowOpenFromLink(nsid){var listener={flickr_people_getInfo_onLoad:function(success,responseXML,responseText){user_data=new BuddyData(responseXML),icon_windowOpen()}};F.API.callMethod("flickr.people.getInfo",{user_id:nsid},listener)}function icon_windowOpen(){var nsid=user_data.nsid,contact=user_data.is_contact,name=user_data.name,name_trunc=F.wordwrap(name,26,'<span class="breaking-non-space"> </span>',!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='<a id="relationshipChange'+user_data.nsid+uniqueId+'" href="/relationship.gne?id='+user_data.nsid+'" >'+F.output.get("personmenu_change")+"</a>?";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='<a id="relationshipChange'+user_data.nsid+uniqueId+'" href="/relationship.gne?id='+user_data.nsid+'" >'+F.output.get("personmenu_updatecontact_notcon_m")+"</a>?"),"F"==user_data.gender&&(el.innerHTML='<a id="relationshipChange'+user_data.nsid+uniqueId+'" href="/relationship.gne?id='+user_data.nsid+'" >'+F.output.get("personmenu_updatecontact_notcon_f")+"</a>?"),"M"!=user_data.gender&&"F"!=user_data.gender&&(el.innerHTML='<a id="relationshipChange'+user_data.nsid+uniqueId+'" href="/relationship.gne?id='+user_data.nsid+'" >'+F.output.get("personmenu_updatecontact_notcon_o")+"</a>?");(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?"&nbsp;":""):user_data.is_friend?el2.innerHTML=F.output.get("uber_contact_list_friend")+(YAHOO.env.ua.ie?"&nbsp;":""):user_data.is_family?el2.innerHTML=F.output.get("uber_contact_list_family")+(YAHOO.env.ua.ie?"&nbsp;":""):el2.innerHTML=F.output.get("uber_contact_list_contact")+(YAHOO.env.ua.ie?"&nbsp;":""):el2.innerHTML='<em style="color: #f15050">'+F.output.get("uber_contact_list_removed")+"</em>"+(YAHOO.env.ua.ie?"&nbsp;":"");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+=' <span class="edit_relationship">(<a id="editLink'+user_data.nsid+uniqueId+'" href="'+rel_link+'" >'+F.output.get("corrections_edit")+"</a>)</span>",el3.innerHTML=txt;else el3.innerHTML='<a id="editLink'+user_data.nsid+uniqueId+'" href="'+rel_link+'" >'+F.output.get("rel_link_add",shortName)+"</a>";(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<len;n++)icon_after_contact_change_funcs[n](user)}function icon_onAfterContactChange(func){"function"==typeof func&&icon_after_contact_change_funcs.push(func)}function icon_removeContact(nsid){icon_ccdiv.style.display="none",icon_showProgress(F.output.get("personmenu_working"));var callback={flickr_contacts_remove_onLoad:function(success,responseXML,responseText,params){success?(user_data.is_contact=!1,_ge("person_hover").hover_persons[params.user_id]=null,icon_updateContactTxt(),icon_afterContactChange(user_data),icon_showProgress(F.output.get("personmenu_success"))):icon_showProgress(F.output.get("personmenu_failure")),window.setTimeout("icon_hideProgress(); icon_windowClose();",500)}};F.API.callMethod("flickr.contacts.remove",{user_id:user_data.nsid},callback)}function icon_showProgress(status){global_comm_div||_make_comm_div("20002"),global_comm_div.start_comming(status)}function icon_showDialog(msg){global_comm_div||_make_comm_div("20002");global_comm_div.start_comming(msg,null,null,1,1,null,function(){icon_hideProgress(),icon_windowClose()})}function icon_hideProgress(){global_comm_div.stop_comming()}function iframeify(node){return null}function personmenu_process_img(img){_ge("person_hover").hover_add_img(img),img.onmouseover=_hitch(_ge("person_hover"),"icon_mouseover"),img.onmouseout=_hitch(_ge("person_hover"),"icon_mouseout")}function get_img_src(el){var defer_src=el.getAttribute("data-defer-src");return src=defer_src||el.src,src}function personmenu_init(freal,go){if(go){freal&&F.decorate(_ge("person_hover"),F._person_hover).hover_go_go_go();function is_it_an_icon(el){if(Y.U.Dom.hasClass(el,"xBuddyIcon"))return!1;if(Y.U.Dom.hasClass(el,"xBuddyIconH"))return!1;if(Y.U.Dom.hasClass(el,"xBuddyIconX"))return!1;if(Y.U.Dom.hasClass(el,"person_hover_img"))return!1;if(Y.U.Dom.hasClass(el,"gn-buddyicon"))return!1;if(Y.U.Dom.hasClass(el,"cover-img"))return!1;var hash=get_img_src(el).split("#")[1];return!!hash&&(el.nsid=hash,!0)}for(var iconsA=[],imgs=document.getElementsByTagName("IMG"),i=0;i<imgs.length;i++){var el=imgs[i];freal&&is_it_an_icon(el)&&(iconsA.push(el),setTimeout(function(){personmenu_process_img(iconsA.pop())},1*i))}if(freal){(icon_ccbgdiv=_ge("global-dialog-background")).style.backgroundColor="#000",icon_ccbgdiv.style.opacity=.35,icon_ccbgdiv.style.MozOpacity=.35,icon_ccbgdiv.style.filter="alpha(opacity=35)",icon_ccdiv=_ge("contactChangerPopup"),iframeify(icon_ccbgdiv)}}else setTimeout(function(){personmenu_init(freal,1)},50)}function BuddyData(xml){var docElem=xml.documentElement,node=docElem.getElementsByTagName("person").item(0);this.nsid=node.getAttribute("nsid"),this.is_contact="1"===node.getAttribute("contact"),this.is_friend="1"===node.getAttribute("friend"),this.is_family="1"===node.getAttribute("family"),this.is_rev_contact="1"===node.getAttribute("revcontact"),this.is_rev_friend="1"===node.getAttribute("revfriend"),this.is_rev_family="1"===node.getAttribute("revfamily"),this.is_blocked="1"===node.getAttribute("ignored"),this.has_collections=node.getAttribute("hascollections")&&"1"===node.getAttribute("hascollections"),this.forum_blocked=node.getAttribute("forum_blocked")&&"1"===node.getAttribute("forum_blocked"),this.gender=node.getAttribute("gender"),this.name=this.nsid;try{this.name=docElem.getElementsByTagName("username").item(0).firstChild.nodeValue.escape_for_display()}catch(e){}this.photos_url="/photos/"+this.nsid+"/",this.profile_url="/people/"+this.nsid+"/";try{this.photos_url=docElem.getElementsByTagName("photosurl").item(0).firstChild.nodeValue}catch(e){}try{this.profile_url=docElem.getElementsByTagName("profileurl").item(0).firstChild.nodeValue}catch(e){}var iconserver=node.getAttribute("iconserver"),farm=Math.ceil(iconserver/1e3);if(iconserver&&"0"!=iconserver){var root=_photo_root.replace_global("http://farm","http://farm"+farm);this.icon_url=root+iconserver+"/buddyicons/"+this.nsid+".jpg"}else this.icon_url=_images_root+"/buddyicon.gif";F.config.flickr.is_secure&&(this.icon_url=this.icon_url.replace("http:","https:"))}F._person_hover=new Object,F._person_hover.hover_go_go_go=function(){this.hover_persons={},this.hover_showing=0,this.hover_menu_showing=0,this.hover_show_timer=null,this.hover_hide_timer=null,this.hover_anim_timer=null,this.hover_over=0,this.hover_curr_img=null,F.decorate(_ge("personmenu_button_bar"),F._personmenu_button_bar).bar_go_go_go(),F.is_ie&&(_ge("person_hover_inner").style.width="79px",_ge("person_hover_inner").style.height="58px"),this.onmouseover=_hitch(this,"hover_mouseover"),this.onmouseout=_hitch(this,"hover_mouseout")},F._person_hover.hover_add_img=function(img){var id="hover_img"+img.nsid;if(!_ge(id)){var new_img=document.createElement("IMG");new_img.id=id,new_img.nsid=img.nsid,new_img.deferred_src=get_img_src(img),new_img.className="person_hover_img",_ge("person_hover_link").appendChild(new_img)}},F._person_hover.hover_mouseover=function(e){clearTimeout(this.hover_hide_timer),this.hover_over=1},F._person_hover.hover_mouseout=function(e){this.hover_over=0,this.hover_menu_showing||(this.hover_hide_timer=setTimeout(function(){var hover=_ge("person_hover");hover.hover_over||hover.hover_hide()},500))},F._person_hover.icon_mouseover=function(e){if(!this.hover_menu_showing&&(clearTimeout(this.hover_hide_timer),this.hover_icon=_get_event_src(e),this.hover_showing&&this.hover_place_and_show(),this.hover_curr_img&&this.hover_curr_img.nsid!=this.hover_icon.nsid&&(this.hover_curr_img.style.display="none",this.hover_curr_img.style.visibility="hidden"),this.hover_curr_img=_ge("hover_img"+this.hover_icon.nsid),this.hover_curr_img.src||(this.hover_curr_img.src=this.hover_curr_img.deferred_src),this.hover_curr_img.style.display="block",this.hover_curr_img.style.visibility="visible",_ge("person_hover_link").href=this.hover_icon.parentNode.href?this.hover_icon.parentNode.href:"/photos/"+this.hover_icon.nsid+"/",!this.hover_showing)){var icon=this.hover_icon;this.hover_show_timer=setTimeout(function(){var hover=_ge("person_hover");icon==hover.hover_icon&&hover.hover_place_and_show()},100)}},F._person_hover.hover_go_away=function(){this.hover_menu_showing=0,clearTimeout(this.hover_show_timer),clearTimeout(this.hover_hide_timer),clearTimeout(this.hover_anim_timer),this.hover_over=0,this.hover_hide_menu(),this.hover_hide()},F._person_hover.icon_mouseout=function(e){this.hover_showing||clearTimeout(this.hover_show_timer)},F._person_hover.hover_hide=function(){this.hover_showing=0,this.style.display="none",Y.U.Event.removeListener(window,"resize",this.window_resize),Y.U.Event.removeListener(window,"scroll",this.window_scroll)},F._person_hover.window_mousedown=function(e,self){for(var curParent=_get_event_src(e);curParent;){if("person_hover"==curParent.id||"personmenu_down_button"==curParent.id)return;curParent=curParent.parentNode}self.hover_go_away()},F._person_hover.window_resize=function(e,self){self.hover_place()},F._person_hover.window_scroll=function(e,self){self.hover_place()},F._person_hover.hover_place_and_show=function(){this.hover_place(),this.hover_show_hover()},F._person_hover.hover_show_hover=function(){this.hover_showing=1,this.style.display="block",Y.U.Event.addListener(window,"resize",this.window_resize,this),Y.U.Event.addListener(window,"scroll",this.window_scroll,this)},F._person_hover.hover_place=function(){var x=Y.U.Dom.getX(this.hover_icon),y=Y.U.Dom.getY(this.hover_icon);x-=_pi((48-this.hover_icon.width)/2),y-=_pi((48-this.hover_icon.height)/2),this.style.left=x-6+"px",this.style.top=y-5+"px"},F._person_hover.hover_toggle_menu=function(){this.hover_menu_showing?this.hover_hide_menu():this.hover_show_menu()},F._person_hover.hover_add_contact=function(){icon_windowOpenFromHover(this.hover_icon.nsid)},F._person_hover.hover_hide_menu=function(){this.hover_menu_showing=0,_ge("person_hover_shadow").className="shadowLight",_ge("personmenu_down_button").button_hide_menu(),_ge("personmenu_down_button").button_set_img_srcs_and_change("personmenu_down"),Y.U.Event.removeListener(window,"mousedown",this.window_mousedown)},F._person_hover.hover_actually_show_menu=function(){clearTimeout(this.hover_anim_timer),_ge("personmenu_down_button").button_show_menu(),_ge("person_hover_pulser_img").style.display="none",_ge("person_hover_link").style.display="block",F.scroll_this_el_into_view("personmenu_down_menu")},F._person_hover.hover_show_menu=function(should_have){this.hover_menu_showing=1,_ge("person_hover_shadow").className="shadowDark";var nsid,down_button=_ge("personmenu_down_button"),uniqueId=getUniqueId();if(down_button.button_hide_menu(),down_button.button_set_img_srcs_and_change("personmenu_up"),this.hover_icon.nsid==global_nsid)Y.U.Event.addListener(document.body,"mousedown",this.window_mousedown,this),_ge("person_menu_other_div").style.display="none",_ge("person_menu_you_div").style.display="block",_ge("personmenu_relationship_p").innerHTML=F.output.get("personmenu_hiyou"),_ge("personmenu_relationship_p").style.display="block",this.hover_actually_show_menu();else{_ge("person_menu_you_div").style.display="none",_ge("person_menu_other_div").style.display="block";var user_data=this.hover_persons[this.hover_icon.nsid];if(user_data){Y.U.Event.addListener(document.body,"mousedown",this.window_mousedown,this);var html=user_data.getRelationshipHTML(uniqueId);if(html)_ge("personmenu_relationship_p").innerHTML=html,_ge("personmenu_contact_link").style.display="none",_ge("personmenu_relationship_p").style.display="block";else if(html=F.output.get("personmenu_add_as_contact",user_data.name),_ge("personmenu_contact_link").innerHTML=html,_ge("personmenu_contact_link").href="/relationship.gne?id="+user_data.nsid,_ge("personmenu_relationship_p").style.display="none",_ge("personmenu_contact_link").style.display="block","undefined"!=typeof _is_beehive&&1==_is_beehive){var o=_ge("personmenu_contact_link"),oNext=o.parentNode.getElementsByTagName("div")[0],sClass="menu_item_line_above";oNext&&YAHOO.util.Dom.hasClass(oNext,sClass)&&YAHOO.util.Dom.removeClass(oNext,sClass),o.style.display="none"}var elem=document.getElementById("changeRelationship"+user_data.nsid+uniqueId);elem&&elem.addEventListener("click",(nsid=user_data.nsid,listeners[nsid]||(listeners[nsid]=function(e){e.preventDefault(),icon_windowOpenFromHover(nsid)}),listeners[nsid]),!1),user_data.has_collections?_ge("personmenu_collections_link")&&(_ge("personmenu_collections_link").style.display="block"):_ge("personmenu_collections_link")&&(_ge("personmenu_collections_link").style.display="none"),_ge("personmenu_photos_link").href=user_data.getphotos_url(),_ge("personmenu_profile_link").href=user_data.getprofile_url(),_ge("personmenu_sets_link").href=user_data.getphotos_url()+"sets/",_ge("personmenu_galleries_link").href=user_data.getphotos_url()+"galleries/",_ge("personmenu_collections_link")&&(_ge("personmenu_collections_link").href=user_data.getphotos_url()+"collections/"),_ge("personmenu_tags_link").href=user_data.getTagsUrl(),_ge("personmenu_archives_link").href=user_data.getArchivesUrl(),_ge("personmenu_map_link")&&(_ge("personmenu_map_link").href=user_data.getMapUrl()),_ge("personmenu_faves_link").href=user_data.getFavoritesUrl(),_ge("personmenu_contacts_link").href=user_data.getContactsUrl(),_ge("personmenu_photosof_link")&&(_ge("personmenu_photosof_link").href=user_data.getPhotosOfUrl()),_ge("personmenu_mail_link").href=user_data.getSendMailUrl();var blocked_str=user_data.is_blocked?F.output.get("personmenu_unblock"):F.output.get("personmenu_block");_ge("personmenu_block_link").innerHTML=blocked_str,_ge("personmenu_block_link").href="/ignore.gne?id="+user_data.nsid,this.hover_actually_show_menu()}else should_have||(this.hover_anim_timer=setTimeout(function(){_ge("person_hover_link").style.display="none",_ge("person_hover_pulser_img").style.display="block"},1e3),F.API.callMethod("flickr.people.getInfo",{user_id:this.hover_icon.nsid},this,null,null,null,0,0))}},F._person_hover.flickr_people_getInfo_onLoad=function(success,responseXML,responseText){var nsid=responseXML.documentElement.getElementsByTagName("person")[0].getAttribute("nsid");this.hover_persons[nsid]=new BuddyData(responseXML),this.hover_menu_showing&&this.hover_show_menu(1)},BuddyData.prototype={isMe:function(){return!!global_nsid&&this.nsid==global_nsid},getYourRecentActivityUrl:function(){return"/recent_activity.gne"},getYourFlickrMailUrl:function(){return"/mail/"},getYourAccountUrl:function(){return"/account/"},getYourBuddyIconEditUrl:function(){return"/iconbuilder/"},getphotos_url:function(){return this.photos_url},getprofile_url:function(){return this.profile_url},getTagsUrl:function(){return this.photos_url+"tags/"},getArchivesUrl:function(){return this.photos_url+"archives/"},getMapUrl:function(){return this.photos_url+"map/"},getFavoritesUrl:function(){return this.photos_url+"favorites/"},getContactsUrl:function(){return this.profile_url+"contacts/"},getPhotosOfUrl:function(){return this.profile_url+"photosof/"},getSendMailUrl:function(){return"/mail/write/?to="+this.nsid},getRelationshipHTML:function(uniqueId){var changeLink='<a id="changeRelationship'+this.nsid+uniqueId+'" href="/relationship.gne?id='+this.nsid+'" role="menuitem">'+F.output.get("personmenu_change")+"</a>";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<items.length;i++){var item=items[i];Y.U.Event.addListener(item,"click",function(){_ge("person_hover").hover_menu_showing&&_ge("person_hover").hover_go_away()})}F._personmenu_button._decotype.button_go_go_go.apply(this)},button_get_menu:function(){return _ge("personmenu_down_menu")},button_hide_menu:function(){this.button_get_menu().style.display="none"},button_show_menu:function(){var menu=this.button_get_menu();menu.style.visibility="hidden",menu.style.display="block";var x=F.get_local_X(this),y=F.get_local_Y(this);x+menu.offsetWidth>_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<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.11.0",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-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<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/[^a-z0-9_]+/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c,global:Function("return this")()},h&&!h.getElementById(o)?(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',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<i.length;e++)r[i[e]]&&n.push(i[e]);t._attach(["yui-base"]),t._attach(n),t.Loader&&w(t)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(
t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i,s=n.Env,o=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(i=e[r++])if(!s._attached[i]){o=!1;break}if(o)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o=this,u=YUI.Env,a=u.mods,f=o.Env,l=f._used,c=u.aliases,h=u._loaderQueue,p=e[0],d=o.Array,v=o.config,m=v.bootstrap,g=[],y,b=[],E=!0,S=v.fetchCSS,x=function(e,t){var r=0,i=[],s,o,f,h,p;if(!e.length)return;if(c){o=e.length;for(r=0;r<o;r++)c[e[r]]&&!a[e[r]]?i=[].concat(i,c[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||b.push(s);if(l[s])continue;f=a[s],h=null,p=null,f?(l[s]=!0,h=f.details.requires,p=f.details.use):u._loaded[n][s]?l[s]=!0:g.push(s),h&&h.length&&x(h),p&&p.length&&x(p,1)}},T=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,u=!0,a=r.data;o._loading=!1,a&&(s=g,g=[],b=[],x(a),i=g.length,i&&[].concat(g).sort().join()==s.sort().join()&&(i=!1)),i&&a?(o._loading=!0,o._use(g,function(){o._attach(a)&&o._notify(t,r,a)})):(a&&(u=o._attach(a)),u&&o._notify(t,r,e)),o._useQueue&&o._useQueue.size()&&!o._loading&&o._use.apply(o,o._useQueue.next())};if(p==="*"){e=[];for(y in a)a.hasOwnProperty(y)&&e.push(y);return E=o._attach(e),E&&T(),o}return(a.loader||a["loader-base"])&&!o.Loader&&o._attach(["loader"+(a.loader?"":"-base")]),m&&o.Loader&&e.length&&(i=w(o),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,S?null:"js"),e=i.sorted,i._boot=!1),x(e),r=g.length,r&&(g=d.dedupe(g),r=g.length),m&&r&&o.Loader?(o._loading=!0,i=w(o),i.onEnd=T,i.context=o,i.data=e,i.ignoreRegistered=!1,i.require(g),i.insert(null,S?null:"js")):m&&r&&o.Get&&!f.bootstrapped?(o._loading=!0,s=function(){o._loading=!1,h.running=!1,f.bootstrapped=!0,u._bootstrapping=!1,o._attach(["loader"])&&o._use(e,t)},u._bootstrapping?h.add(s):(u._bootstrapping=!0,o.Get.script(v.base+v.loaderPath,{onEnd:s}))):(E=o._attach(e),E&&T()),o},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI,YUI.setLoadHook=function(e){YUI._getLoadHook=e},YUI._getLoadHook=null)})(),YUI.add("yui-base",function(e,t){function m(e,t,n){var r,i;t||(t=0);if(n||m.test(e))try{return d.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function g(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u="	\n\f\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff",a="[	-\r \u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+",f=new RegExp("^"+a),l=new RegExp(a+"$"),c=new RegExp(f.source+"|"+l.source,"g"),h=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&h.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=n._isNative(r.trim)&&!u.trim()?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(c,"")}catch(t){return e}},n.trimLeft=n._isNative(r.trimLeft)&&!u.trimLeft()?function(e){return e.trimLeft()}:function(
e){return e.replace(f,"")},n.trimRight=n._isNative(r.trimRight)&&!u.trimRight()?function(e){return e.trimRight()}:function(e){return e.replace(l,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var p=e.Lang,d=Array.prototype,v=Object.prototype.hasOwnProperty;e.Array=m,m.dedupe=p._isNative(Object.create)?function(e){var t=Object.create(null),n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],t[i]||(t[i]=1,n.push(i));return n}:function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],v.call(t,i)||(t[i]=1,n.push(i));return n},m.each=m.forEach=p._isNative(d.forEach)?function(t,n,r){return d.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},m.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&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(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},m.numericSort=function(e,t){return e-t},m.some=p._isNative(d.some)?function(e,t,n){return d.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},m.test=function(e){var t=0;if(p.isArray(e))t=1;else if(p.isObject(e))try{"length"in e&&!e.tagName&&(!e.scrollTo||!e.document)&&!e.apply&&(t=2)}catch(n){}return t},g.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=g,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new g;var y="__",v=Object.prototype.hasOwnProperty,b=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?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<t;++e){i=arguments[e];for(r in i)v.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,c,h,p;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,p=s===1||s===4?t.prototype:t;if(!f||!p)return t}else f=n,p=t;u=r&&!o;if(i)for(l=0,h=i.length;l<h;++l){c=i[l];if(!v.call(f,c))continue;a=u?!1:c in p;if(o&&a&&b(p[c],!0)&&b(f[c],!0))e.mix(p[c],f[c],r,null,0,o);else if(r||!a)p[c]=f[c]}else{for(c in f){if(!v.call(f,c))continue;a=u?!1:c in p;if(o&&a&&b(p[c],!0)&&b(f[c],!0))e.mix(p[c],f[c],r,null,0,o);else if(r||!a)p[c]=f[c]}e.Object._hasEnumBug&&e.mix(p,f,r,e.Object._forceEnum,s,o)}return t};var p=e.Lang,v=Object.prototype.hasOwnProperty,w,E=e.Object=p._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),S=E._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],x=E._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),T=E._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),N=E.owns=function(e,t){return!!e&&v.call(e,t)};E.hasKey=N,E.keys=p._isNative(Object.keys)&&!T?Object.keys:function(e){if(!p.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(T&&typeof e=="function")for(r in e)N(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)N(e,r)&&t.push(r);if(x)for(n=0,i=S.length;n<i;++n)r=S[n],N(e,r)&&t.push(r);return t},E.values=function(e){var t=E.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},E.size=function(e){try{return E.keys(e).length}catch(t){return 0}},E.hasValue=function(t,n){return e.Array.indexOf(E.values(t),n)>-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<s;r++)t=t[i[r]];return t},E.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==w&&i<o;i++)u=u[s[i]];if(u===w)return w;u[s[i]]=r}return t},E.isEmpty=function(e){return!E.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++===1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0,winjs:typeof Windows!="undefined"&&!!Windows.System,touchEnabled:!1},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||
(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/OPR\/(\d+\.\d+)/),f&&f[1]?s.opera=n(f[1]):(f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0])))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE ([^;]*)|Trident.*; rv ([0-9.]+)/),f&&(f[1]||f[2])?s.ie=n(f[1]||f[2]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]),/Mobile|Tablet/.test(o)&&(s.mobile="ffos"))))))),r&&i&&!(s.chrome&&s.chrome<6)&&(s.touchEnabled="ontouchstart"in r||"msMaxTouchPoints"in i&&i.msMaxTouchPoints>0),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);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)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<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=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<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var s;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,n._onFinish=i._onTransactionFinish,this._env||this._getEnv(),s=this._getTransaction(t,n),this._queue.push({callback:r,transaction:s}),this._next(),s},_onTransactionFinish:function(){i._pending=null,i._next()},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(e.callback))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-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<s;++i)u=n[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r),t._onFinish&&t._onFinish()},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,o=e.stamp(n),(r=s[o])?r:(r=n.getElementsByTagName("base")[0])?s[o]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[o]=r.lastChild):s[o]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(a.ie>=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<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=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;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){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]<p&&(a=1)),a||(v.useBrowserConsole&&(c=o?o+": "+e:e,d.Lang.isFunction(v.logFn)?v.logFn.call(d,e,t,o):typeof console!==i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!==i&&opera.postError(c)),m&&!u&&(m===d&&!m.getEvent(r)&&m.publish(r,{broadcast:2}),m.fire(r,{msg:e,cat:t,src:o})))),d},n.message=function(){return n.log.apply(n,arguments)}},"3.11.0",{requires:["yui-base"]}),YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:
l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.11.0",{requires:["yui-base"]}),YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+"/",i=e.Env.base,s="gallery-2013.07.03-22-52",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-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<s.length;n++)if(this._requires(e,s[n]))return!0;s=o[e]&&o[e].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(t,s[n]))return!1;return r&&t in r?!0:a.ext&&a.type===u&&!f.ext&&f.type===u?!0:!1},_config:function(t){var n,r,i,s,o,u,a,f=this,l=[],c;if(t)for(n in t)if(t.hasOwnProperty(n)){i=t[n];if(n==="require")f.require(i);else if(n==="skin")typeof i=="string"&&(f.skin.defaultSkin=t.skin,i={defaultSkin:i}),e.mix(f.skin,i,!0);else if(n==="groups"){for(r in i)if(i.hasOwnProperty(r)){a=r,u=i[r],f.addGroup(u,a);if(u.aliases)for(s in u.aliases)u.aliases.hasOwnProperty(s)&&f.addAlias(u.aliases[s],s)}}else if(n==="modules")for(r in i)i.hasOwnProperty(r)&&f.addModule(i[r],r);else if(n==="aliases")for(r in i)i.hasOwnProperty(r)&&f.addAlias(i[r],r);else n==="gallery"?this.groups.gallery.update&&this.groups.gallery.update(i,t):n==="yui2"||n==="2in3"?this.groups.yui2.update&&this.groups.yui2.update(t["2in3"],t.yui2,t):f[n]=i}o=f.filter,b.isString(o)&&(o=o.toUpperCase(),f.filterName=o,f.filter=f.FILTER_DEFS[o],o==="DEBUG"&&f.require("yui-log","dump"));if(f.filterName&&f.coverage&&f.filterName==="COVERAGE"&&b.isArray(f.coverage)&&f.coverage.length){for(n=0;n<f.coverage.length;n++)c=f.coverage[n],f.moduleInfo[c]&&f.moduleInfo[c].use?l=[].concat(l,f.moduleInfo[c].use):l.push(c);f.filters=f.filters||{},e.Array.each(l,function(e){f.filters[e]=f.FILTER_DEFS.COVERAGE}),f.filterName="RAW",f.filter=f.FILTER_DEFS[f.filterName]}},formatSkin:function(e,t){var n=y+e;return t&&(n=n+"-"+t),n},_addSkin:function(e,t,n){var r,i,s,o,u=this.moduleInfo,a=this.skin,f=u[t]&&u[t].ext;return t&&(s=this.formatSkin(e,t),u[s]||(r=u[t],i=r.pkg||t,o={skin:!0,name:s,group:r.group,type:"css",after:a.after,path:(n||i)+"/"+a.base+e+"/"+t+".css",ext:f},r.base&&(o.base=r.base),r.configFn&&(o.configFn=r.configFn),this.addModule(o,s))),s},addAlias:function(e,t){YUI.Env.aliases[t]=e,this.addModule({name:t,use:e})},addGroup:function(e,t){var n=e.modules,r=this,i,s;t=t||e.name,e.name=t,r.groups[t]=e;if(e.patterns
)for(i in e.patterns)e.patterns.hasOwnProperty(i)&&(e.patterns[i].group=t,r.patterns[i]=e.patterns[i]);if(n)for(i in n)n.hasOwnProperty(i)&&(s=n[i],typeof s=="string"&&(s={name:i,fullpath:s}),s.group=t,r.addModule(s,i))},addModule:function(t,n){n=n||t.name,typeof t=="string"&&(t={name:n,fullpath:t});var r,i,o,f,l,c,p,d,m,g,y,b,w,E,x,T,N,C,k,L,A,O,M=this.conditions,_;this.moduleInfo[n]&&this.moduleInfo[n].temp&&(t=e.merge(this.moduleInfo[n],t)),t.name=n;if(!t||!t.name)return null;t.type||(t.type=a,O=t.path||t.fullpath,O&&this.REGEX_CSS.test(O)&&(t.type=u)),!t.path&&!t.fullpath&&(t.path=S(n,n,t.type)),t.supersedes=t.supersedes||t.use,t.ext="ext"in t?t.ext:this._internal?!1:!0,r=t.submodules,this.moduleInfo[n]=t,t.requires=t.requires||[];if(this.requires)for(i=0;i<this.requires.length;i++)t.requires.push(this.requires[i]);if(t.group&&this.groups&&this.groups[t.group]){A=this.groups[t.group];if(A.requires)for(i=0;i<A.requires.length;i++)t.requires.push(A.requires[i])}t.defaults||(t.defaults={requires:t.requires?[].concat(t.requires):null,supersedes:t.supersedes?[].concat(t.supersedes):null,optional:t.optional?[].concat(t.optional):null}),t.skinnable&&t.ext&&t.temp&&(k=this._addSkin(this.skin.defaultSkin,n),t.requires.unshift(k)),t.requires.length&&(t.requires=this.filterRequires(t.requires)||[]);if(!t.langPack&&t.lang){y=v(t.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b))}if(r){l=t.supersedes||[],o=0;for(i in r)if(r.hasOwnProperty(i)){c=r[i],c.path=c.path||S(n,i,t.type),c.pkg=n,c.group=t.group,c.supersedes&&(l=l.concat(c.supersedes)),p=this.addModule(c,i),l.push(i);if(p.skinnable){t.skinnable=!0,C=this.skin.overrides;if(C&&C[i])for(g=0;g<C[i].length;g++)k=this._addSkin(C[i][g],i,n),l.push(k);k=this._addSkin(this.skin.defaultSkin,i,n),l.push(k)}if(c.lang&&c.lang.length){y=v(c.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),w=this.getLangPackName(T,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),E=E||v.hash(p.supersedes),w in E||p.supersedes.push(w),t.lang=t.lang||[],x=x||v.hash(t.lang),T in x||t.lang.push(T),b=this.getLangPackName(h,n),w=this.getLangPackName(h,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),w in E||p.supersedes.push(w)}o++}t.supersedes=v.dedupe(l),this.allowRollup&&(t.rollup=o<4?o:Math.min(o-1,4))}d=t.plugins;if(d)for(i in d)d.hasOwnProperty(i)&&(m=d[i],m.pkg=n,m.path=m.path||S(n,i,t.type),m.requires=m.requires||[],m.group=t.group,this.addModule(m,i),t.skinnable&&this._addSkin(this.skin.defaultSkin,i,n));if(t.condition){f=t.condition.trigger,YUI.Env.aliases[f]&&(f=YUI.Env.aliases[f]),e.Lang.isArray(f)||(f=[f]);for(i=0;i<f.length;i++)_=f[i],L=t.condition.when,M[_]=M[_]||{},M[_][n]=t.condition,L&&L!=="after"?L==="instead"&&(t.supersedes=t.supersedes||[],t.supersedes.push(_)):(t.after=t.after||[],t.after.push(_))}return t.supersedes&&(t.supersedes=this.filterRequires(t.supersedes)),t.after&&(t.after=this.filterRequires(t.after),t.after_map=v.hash(t.after)),t.configFn&&(N=t.configFn(t),N===!1&&(delete this.moduleInfo[n],delete s._renderedMods[n],t=null)),t&&(s._renderedMods||(s._renderedMods={}),s._renderedMods[n]=e.mix(s._renderedMods[n]||{},t),s._conditions=M),t},require:function(t){var n=typeof t=="string"?v(arguments):t;this.dirty=!0,this.required=e.merge(this.required,v.hash(this.filterRequires(n))),this._explodeRollups()},_explodeRollups:function(){var e=this,t,n,r,i,s,o,u,a=e.required;if(!e.allowRollup){for(r in a)if(a.hasOwnProperty(r)){t=e.getModule(r);if(t&&t.use){o=t.use.length;for(i=0;i<o;i++){n=e.getModule(t.use[i]);if(n&&n.use){u=n.use.length;for(s=0;s<u;s++)a[n.use[s]]=!0}else a[t.use[i]]=!0}}}e.required=a}},filterRequires:function(t){if(t){e.Lang.isArray(t)||(t=[t]),t=e.Array(t);var n=[],r,i,s,o;for(r=0;r<t.length;r++){i=this.getModule(t[r]);if(i&&i.use)for(s=0;s<i.use.length;s++)o=this.getModule(i.use[s]),o&&o.use&&o.name!==i.name?n=e.Array.dedupe([].concat(n,this.filterRequires(o.use))):n.push(i.use[s]);else n.push(t[r])}t=n}return t},getRequires:function(t){if(!t)return r;if(t._parsed)return t.expanded||r;var n,i,s,o,u,a,l=this.testresults,c=t.name,m,g=w[c]&&w[c].details,y,b,E,S,x,T,N,C,k,L,A=t.lang||t.intl,O=this.moduleInfo,M=e.Features&&e.Features.tests.load,_,D;t.temp&&g&&(x=t,t=this.addModule(g,c),t.group=x.group,t.pkg=x.pkg,delete t.expanded),D=!!this.lang&&t.langCache!==this.lang||t.skinCache!==this.skin.defaultSkin;if(t.expanded&&!D)return t.expanded;y=[],_={},S=this.filterRequires(t.requires),t.lang&&(y.unshift("intl"),S.unshift("intl"),A=!0),T=this.filterRequires(t.optional),t._parsed=!0,t.langCache=this.lang,t.skinCache=this.skin.defaultSkin;for(n=0;n<S.length;n++)if(!_[S[n]]){y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}S=this.filterRequires(t.supersedes);if(S)for(n=0;n<S.length;n++)if(!_[S[n]]){t.submodules&&y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}if(T&&this.loadOptional)for(n=0;n<T.length;n++)if(!_[T[n]]){y.push(T[n]),_[T[n]]=!0,i=O[T[n]];if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}m=this.conditions[c];if(m){t._parsed=!1;if(l&&M)d(l,function(e,t){var n=M[t].name;!_[n]&&M[t].trigger===c&&e&&M[t]&&(_[n]=!0,y.push(n))});else for(n in m)if(m.hasOwnProperty(n)&&!_[n]){E=m[n],b=E&&(!E.ua&&!E.test||E.ua&&e.UA[E.ua]||E.test&&E.test(e,S));if(b){_[n]=!0,y.push(n),i=this.getModule(n);if(i){o=this.getRequires(i);for(s=0;s<o.length;s++)y.push(o[s])}}}}if(t.skinnable){C=this.skin.overrides;for(n in YUI.Env.aliases)YUI.Env.aliases.hasOwnProperty(n)&&e.Array.indexOf(YUI.Env.aliases[n],c)>-1&&(k=n);if(C&&(C[c]||k&&C[k])){L=c,C[k]&&(L=k);for(n=0;n<C[L].length;n++)N=this._addSkin(C[L][n],c),this.isCSSLoaded(N,this._boot)||y.push(N)}else N=this._addSkin(this.skin.defaultSkin,c),this.isCSSLoaded
(N,this._boot)||y.push(N)}return t._parsed=!1,A&&(t.lang&&!t.langPack&&e.Intl&&(a=e.Intl.lookupBestLang(this.lang||h,t.lang),u=this.getLangPackName(a,c),u&&y.unshift(u)),y.unshift(f)),t.expanded_map=v.hash(y),t.expanded=p.keys(t.expanded_map),t.expanded},isCSSLoaded:function(t,n){if(!t||!YUI.Env.cssStampEl||!n&&this.ignoreRegistered)return!1;var r=YUI.Env.cssStampEl,i=!1,s=YUI.Env._cssLoaded[t],o=r.currentStyle;return s!==undefined?s:(r.className=t,o||(o=e.config.doc.defaultView.getComputedStyle(r,null)),o&&o.display==="none"&&(i=!0),r.className="",YUI.Env._cssLoaded[t]=i,i)},getProvides:function(t){var r=this.getModule(t),i,s;return r?(r&&!r.provides&&(i={},s=r.supersedes,s&&v.each(s,function(t){e.mix(i,this.getProvides(t))},this),i[t]=!0,r.provides=i),r.provides):n},calculate:function(e,t){if(e||t||this.dirty)e&&this._config(e),this._init||this._setup(),this._explode(),this.allowRollup?this._rollup():this._explodeRollups(),this._reduce(),this._sort()},_addLangPack:function(t,n,r){var i=n.name,s,o,u=this.moduleInfo[r];return u||(s=S(n.pkg||i,r,a,!0),o={path:s,intl:!0,langPack:!0,ext:n.ext,group:n.group,supersedes:[]},n.root&&(o.root=n.root),n.base&&(o.base=n.base),n.configFn&&(o.configFn=n.configFn),this.addModule(o,r),t&&(e.Env.lang=e.Env.lang||{},e.Env.lang[t]=e.Env.lang[t]||{},e.Env.lang[t][i]=!0)),this.moduleInfo[r]},_setup:function(){var t=this.moduleInfo,n,r,i,o,u,a;for(n in t)t.hasOwnProperty(n)&&(o=t[n],o&&(o.requires=v.dedupe(o.requires),o.lang&&(a=this.getLangPackName(h,n),this._addLangPack(null,o,a))));u={},this.ignoreRegistered||e.mix(u,s.mods),this.ignore&&e.mix(u,v.hash(this.ignore));for(i in u)u.hasOwnProperty(i)&&e.mix(u,this.getProvides(i));if(this.force)for(r=0;r<this.force.length;r++)this.force[r]in u&&delete u[this.force[r]];e.mix(this.loaded,u),this._init=!0},getLangPackName:function(e,t){return"lang/"+t+(e?"_"+e:"")},_explode:function(){var t=this.required,n,r,i={},s=this,o,u;s.dirty=!1,s._explodeRollups(),t=s.required;for(o in t)t.hasOwnProperty(o)&&(i[o]||(i[o]=!0,n=s.getModule(o),n&&(u=n.expound,u&&(t[u]=s.getModule(u),r=s.getRequires(t[u]),e.mix(t,v.hash(r))),r=s.getRequires(n),e.mix(t,v.hash(r)))))},_patternTest:function(e,t){return e.indexOf(t)>-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;n<r.length;n++)r[n]in e&&delete e[r[n]]}return e},_finish:function(e,t){m.running=!1;var n=this.onEnd;n&&n.call(this.context,{msg:e,data:this.data,success:t}),this._continue()},_onSuccess:function(){var t=this,n=e.merge(t.skipped),r,i=[],s=t.requireRegistration,o,u,f,l;for(f in n)n.hasOwnProperty(f)&&delete t.inserted[f];t.skipped={};for(f in t.inserted)t.inserted.hasOwnProperty(f)&&(l=t.getModule(f),!l||!s||l.type!==a||f in YUI.Env.mods?e.mix(t.loaded,t.getProvides(f)):i.push(f));r=t.onSuccess,u=i.length?"notregistered":"success",o=!i.length,r&&r.call(t.context,{msg:u,data:t.data,success:o,failed:i,skipped:n}),t._finish(u,o)},_onProgress:function(e){var t=this,n;if(e.data&&e.data.length)for(n=0;n<e.data.length;n++)e.data[n]=t.getModule(e.data[n].name);t.onProgress&&t.onProgress.call(t.context,{name:e.url,data:e.data})},_onFailure:function(e){var t=this.onFailure,n=[],r=0,i=e.errors.length;for(r;r<i;r++)n.push(e.errors[r].error);n=n.join(","),t&&t.call(this.context,{msg:n,data:this.data,success:!1}),this._finish(n,!1)},_onTimeout:function(e){var t=this.onTimeout;t&&t.call(this.context,{msg:"timeout",data:this.data,success:!1,transaction:e})},_sort:function(){var e=p.keys(this.required),t={},n=0,r,i,s,o,u,a,f;for(;;){r=e.length,a=!1;for(o=n;o<r;o++){i=e[o];for(u=o+1;u<r;u++){f=i+e[u];if(!t[f]&&this._requires(i,e[u])){s=e.splice(u,1),e.splice(o,0,s[0]),t[f]=!0,a=!0;break}}if(a)break;n++}if(!a)break}this.sorted=e},_insert:function(t,n,r,i){t&&this._config(t);var s=this.resolve(!i),o=this,f=0,l=0,c={},h,p;o._refetch=[],r&&(s[r===a?u:a]=[]),o.fetchCSS||(s.css=[]),s.js.length&&f++,s.css.length&&f++,p=function(t){l++;var n={},r=0,i=0,s="",u,a,p;if(t&&t.errors)for(r=0;r<t.errors.length;r++)t.errors[r].request?s=t.errors[r].request.url:s=t.errors[r],n[s]=s;if(t&&t.data&&t.data.length&&t.type==="success")for(r=0;r<t.data.length;r++){o.inserted[t.data[r].name]=!0;if(t.data[r].lang||t.data[r].skinnable)delete o.inserted[t.data[r].name],o._refetch.push(t.data[r].name)}if(l===f){o._loading=null;if(o._refetch.length){for(r=0;r<o._refetch.length;r++){h=o.getRequires(o.getModule(o._refetch[r]));for(i=0;i<h.length;i++)o.inserted[h[i]]||(c[h[i]]=h[i])}c=e.Object.keys(c);if(c.length){o.require(c),p=o.resolve(!0);if(p.cssMods.length){for(r=0;r<p.cssMods.length;r++)a=p.cssMods[r].name,delete YUI.Env._cssLoaded[a],o.isCSSLoaded(a)&&(o.inserted[a]=!0,delete o.required[a]);o.sorted=[],o._sort()}t=null,o._insert()}}t&&t.fn&&(u=t.fn,delete t.fn,u.call(o,t))}},this._loading=!0;if(!s.js.length&&!s.css.length){l=-1,p({fn:o._onSuccess});return}s.css.length&&e.Get.css(s.css,{data:s.cssMods,attributes:o.cssAttributes,insertBefore:o.insertBefore,charset:o.charset,timeout:o.timeout,context:o,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}}),s.js.length&&e.Get.js(s.js,{data:s.jsMods,insertBefore:o.insertBefore,attributes:o.jsAttributes,charset:o.charset
,timeout:o.timeout,autopurge:!1,context:o,async:o.async,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}})},_continue:function(){!m.running&&m.size()>0&&(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;s<r;s++){v=y,o=C.getModule(t[s]),h=o&&o.group,c=C.groups[h];if(h&&c){if(!c.combine||o.fullpath){D(o);continue}o.combine=!0,c.comboBase&&(v=c.comboBase),"root"in c&&b.isValue(c.root)&&(o.root=c.root),o.comboSep=c.comboSep||C.comboSep,o.maxURLLength=c.maxURLLength||C.maxURLLength}else if(!C.combine){D(o);continue}m[v]=m[v]||[],m[v].push(o)}for(p in m)if(m.hasOwnProperty(p)){N[p]=N[p]||{js:[],jsMods:[],css:[],cssMods:[]},f=p,g=m[p],r=g.length;if(r)for(s=0;s<r;s++){if(O[g[s]])continue;o=g[s],o&&(o.combine||!o.ext)?(N[p].comboSep=o.comboSep,N[p].group=o.group,N[p].maxURLLength=o.maxURLLength,d=(b.isValue(o.root)?o.root:C.root)+(o.path||o.fullpath),d=C._filter(d,o.name),N[p][o.type].push(d),N[p][o.type+"Mods"].push(o)):g[s]&&D(g[s])}}for(p in N)if(N.hasOwnProperty(p)){w=p,k=N[w].comboSep||C.comboSep,A=N[w].maxURLLength||C.maxURLLength;for(_ in N[w])if(_===a||_===u){E=N[w][_],g=N[w][_+"Mods"],r=E.length,x=w+E.join(k),T=x.length,A<=w.length&&(A=i);if(r)if(T>A){S=[];for(t=0;t<r;t++)S.push(E[t]),x=w+S.join(k),x.length>A&&(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<r.length;t++){f=o[r[t]];if(this.loaded[r[t]]&&!this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type===f.type){a++,s=a>=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"]});
