]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - jssource/src_files/include/javascript/yui3/build/compat/compat.js
Release 6.5.0
[Github/sugarcrm.git] / jssource / src_files / include / javascript / yui3 / build / compat / compat.js
1 /*
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
5 version: 3.3.0
6 build: 3167
7 */
8 YUI.add('compat', function(Y) {
9
10
11 /*global YAHOO*/
12 /*global YUI*/
13 /*global YUI_config*/
14
15 var COMPAT_ARG = '~yui|2|compat~', o, L;
16
17
18 if (window.YAHOO != YUI) {
19
20     // get any existing YAHOO obj props
21     o = (window.YAHOO) ? YUI.merge(window.YAHOO) : null;
22
23     // Make the YUI global the YAHOO global
24     window.YAHOO = YUI;
25
26     // augment old YAHOO props
27     if (o) {
28         Y.mix(Y, o);
29     }
30 }
31
32 // add old namespaces
33 Y.namespace("util", "widget", "example");
34
35 // case/location change
36 Y.env = (Y.env) ? Y.mix(Y.env, Y.Env) : Y.Env;
37 Y.lang = (Y.lang) ? Y.mix(Y.lang, Y.Lang) : Y.Lang;
38 Y.env.ua = Y.UA;
39
40 // support Y.register
41 Y.mix(Y.env, {
42         modules: [],
43         listeners: [],
44         getVersion: function(name) {
45             return this.Env.modules[name] || null;
46         }
47 });
48
49 L = Y.lang;
50
51 // add old lang properties
52 Y.mix(L, {
53
54     augmentObject: function(r, s) {
55         var a = arguments, wl = (a.length > 2) ? Y.Array(a, 2, true) : null,
56             ov = (wl), args = [r, s, ov];
57
58         if (wl && wl[0] !== true) {
59             args.push(wl);
60         }
61
62         return Y.mix.apply(Y, args);
63     },
64
65     augmentProto: function(r, s) {
66         var a = arguments, wl = (a.length > 2) ? Y.Array(a, 2, true) : null,
67             ov = (wl), args = [r, s, ov];
68         return Y.augment.apply(Y, args);
69     },
70
71     // extend: Y.bind(Y.extend, Y),
72     extend: Y.extend,
73     // merge: Y.bind(Y.merge, Y)
74     merge: Y.merge
75 }, true);
76
77 L.augment = L.augmentProto;
78
79 L.hasOwnProperty = function(o, k) {
80     return (o.hasOwnProperty(k));
81 };
82
83 Y.augmentProto = L.augmentProto;
84
85 // add register function
86 Y.mix(Y, {
87     register: function(name, mainClass, data) {
88         var mods = Y.Env.modules;
89         if (!mods[name]) {
90             mods[name] = { versions:[], builds:[] };
91         }
92         var m=mods[name],v=data.version,b=data.build,ls=Y.Env.listeners;
93         m.name = name;
94         m.version = v;
95         m.build = b;
96         m.versions.push(v);
97         m.builds.push(b);
98         m.mainClass = mainClass;
99         // fire the module load listeners
100         for (var i=0;i<ls.length;i=i+1) {
101             ls[i](m);
102         }
103         // label the main class
104         if (mainClass) {
105             mainClass.VERSION = v;
106             mainClass.BUILD = b;
107         } else {
108         }
109     }
110 });
111
112 // add old load listeners
113 if ("undefined" != typeof YAHOO_config) {
114     var l=YAHOO_config.listener,ls=Y.Env.listeners,unique=true,i;
115     if (l) {
116         // if YAHOO is loaded multiple times we need to check to see if
117         // this is a new config object.  If it is, add the new component
118         // load listener to the stack
119         for (i=0;i<ls.length;i=i+1) {
120             if (ls[i]==l) {
121                 unique=false;
122                 break;
123             }
124         }
125         if (unique) {
126             ls.push(l);
127         }
128     }
129 }
130
131 // add old registration for yahoo
132 Y.register("yahoo", Y, {version: "3.3.0", build: "3167"});
133
134 if (Y.Event) {
135
136     o = {
137
138         /**
139          * Safari detection
140          * @property isSafari
141          * @private
142          * @static
143          * @deprecated use Y.Env.UA.webkit
144          */
145         isSafari: Y.UA.webkit,
146
147         /**
148          * webkit version
149          * @property webkit
150          * @type string
151          * @private
152          * @static
153          * @deprecated use Y.Env.UA.webkit
154          */
155         webkit: Y.UA.webkit,
156
157         /**
158          * Normalized keycodes for webkit/safari
159          * @property webkitKeymap
160          * @type {int: int}
161          * @private
162          * @static
163          * @final
164          */
165         webkitKeymap: {
166             63232: 38, // up
167             63233: 40, // down
168             63234: 37, // left
169             63235: 39, // right
170             63276: 33, // page up
171             63277: 34, // page down
172             25: 9      // SHIFT-TAB (Safari provides a different key code in
173                        // this case, even though the shiftKey modifier is set)
174         },
175
176         /**
177          * IE detection
178          * @property isIE
179          * @private
180          * @static
181          * @deprecated use Y.Env.UA.ie
182          */
183         isIE: Y.UA.ie,
184
185         /**
186          * Returns scrollLeft
187          * @method _getScrollLeft
188          * @static
189          * @private
190          */
191         _getScrollLeft: function() {
192             return this._getScroll()[1];
193         },
194
195         /**
196          * Returns scrollTop
197          * @method _getScrollTop
198          * @static
199          * @private
200          */
201         _getScrollTop: function() {
202             return this._getScroll()[0];
203         },
204
205         /**
206          * Returns the scrollTop and scrollLeft.  Used to calculate the
207          * pageX and pageY in Internet Explorer
208          * @method _getScroll
209          * @static
210          * @private
211          */
212         _getScroll: function() {
213             var d = Y.config.doc, dd = d.documentElement, db = d.body;
214             if (dd && (dd.scrollTop || dd.scrollLeft)) {
215                 return [dd.scrollTop, dd.scrollLeft];
216             } else if (db) {
217                 return [db.scrollTop, db.scrollLeft];
218             } else {
219                 return [0, 0];
220             }
221         },
222
223         /**
224          * Returns the event's pageX
225          * @method getPageX
226          * @param {Event} ev the event
227          * @return {int} the event's pageX
228          * @static
229          */
230         getPageX: function(ev) {
231             var x = ev.pageX;
232             if (!x && 0 !== x) {
233                 x = ev.clientX || 0;
234
235                 if ( Y.UA.ie ) {
236                     x += this._getScrollLeft();
237                 }
238             }
239
240             return x;
241         },
242
243         /**
244          * Returns the charcode for an event
245          * @method getCharCode
246          * @param {Event} ev the event
247          * @return {int} the event's charCode
248          * @static
249          */
250         getCharCode: function(ev) {
251             var code = ev.keyCode || ev.charCode || 0;
252
253             // webkit normalization
254             if (Y.UA.webkit && (code in Y.Event.webkitKeymap)) {
255                 code = Y.Event.webkitKeymap[code];
256             }
257             return code;
258         },
259
260         /**
261          * Returns the event's pageY
262          * @method getPageY
263          * @param {Event} ev the event
264          * @return {int} the event's pageY
265          * @static
266          */
267         getPageY: function(ev) {
268             var y = ev.pageY;
269             if (!y && 0 !== y) {
270                 y = ev.clientY || 0;
271
272                 if ( Y.UA.ie ) {
273                     y += this._getScrollTop();
274                 }
275             }
276
277
278             return y;
279         },
280
281         /**
282          * Returns the pageX and pageY properties as an indexed array.
283          * @method getXY
284          * @param {Event} ev the event
285          * @return {[x, y]} the pageX and pageY properties of the event
286          * @static
287          */
288         getXY: function(ev) {
289             return [this.getPageX(ev), this.getPageY(ev)];
290         },
291
292         /**
293          * Returns the event's related target
294          * @method getRelatedTarget
295          * @param {Event} ev the event
296          * @return {HTMLElement} the event's relatedTarget
297          * @static
298          */
299         getRelatedTarget: function(ev) {
300             var t = ev.relatedTarget;
301             if (!t) {
302                 if (ev.type == "mouseout") {
303                     t = ev.toElement;
304                 } else if (ev.type == "mouseover") {
305                     t = ev.fromElement;
306                 }
307             }
308
309             return this.resolveTextNode(t);
310         },
311
312         /**
313          * Returns the time of the event.  If the time is not included, the
314          * event is modified using the current time.
315          * @method getTime
316          * @param {Event} ev the event
317          * @return {Date} the time of the event
318          * @static
319          */
320         getTime: function(ev) {
321             if (!ev.time) {
322                 var t = new Date().getTime();
323                 try {
324                     ev.time = t;
325                 } catch(ex) {
326                     this.lastError = ex;
327                     return t;
328                 }
329             }
330
331             return ev.time;
332         },
333
334         /**
335          * Convenience method for stopPropagation + preventDefault
336          * @method stopEvent
337          * @param {Event} ev the event
338          * @static
339          */
340         stopEvent: function(ev) {
341             this.stopPropagation(ev);
342             this.preventDefault(ev);
343         },
344
345         /**
346          * Stops event propagation
347          * @method stopPropagation
348          * @param {Event} ev the event
349          * @static
350          */
351         stopPropagation: function(ev) {
352             if (ev.stopPropagation) {
353                 ev.stopPropagation();
354             } else {
355                 ev.cancelBubble = true;
356             }
357         },
358
359         /**
360          * Prevents the default behavior of the event
361          * @method preventDefault
362          * @param {Event} ev the event
363          * @static
364          */
365         preventDefault: function(ev) {
366             if (ev.preventDefault) {
367                 ev.preventDefault();
368             } else {
369                 ev.returnValue = false;
370             }
371         },
372
373         /**
374          * Returns the event's target element.  Safari sometimes provides
375          * a text node, and this is automatically resolved to the text
376          * node's parent so that it behaves like other browsers.
377          * @method getTarget
378          * @param {Event} ev the event
379          * @param {boolean} resolveTextNode when set to true the target's
380          *                  parent will be returned if the target is a
381          *                  text node.  @deprecated, the text node is
382          *                  now resolved automatically
383          * @return {HTMLElement} the event's target
384          * @static
385          */
386         getTarget: function(ev, resolveTextNode) {
387             var t = ev.target || ev.srcElement;
388             return this.resolveTextNode(t);
389         },
390
391         /**
392          * In some cases, some browsers will return a text node inside
393          * the actual element that was targeted.  This normalizes the
394          * return value for getTarget and getRelatedTarget.
395          * @method resolveTextNode
396          * @param {HTMLElement} node node to resolve
397          * @return {HTMLElement} the normized node
398          * @static
399          */
400         resolveTextNode: function(node) {
401             if (node && 3 == node.nodeType) {
402                 return node.parentNode;
403             } else {
404                 return node;
405             }
406         },
407
408         /**
409          * We cache elements bound by id because when the unload event
410          * fires, we can no longer use document.getElementById
411          * @method getEl
412          * @static
413          * @private
414          * @deprecated Elements are not cached any longer
415          */
416         getEl: function(id) {
417             return Y.one(id);
418         }
419     };
420
421     Y.mix(Y.Event, o);
422
423     /**
424      * Calls Y.Event.attach with the correct argument order
425      * @method removeListener
426      */
427     Y.Event.removeListener = function(el, type, fn, data, override) {
428
429         var context, a=[type, fn, el];
430
431         if (data) {
432
433             if (override) {
434                 context = (override === true) ? data : override;
435             }
436
437             a.push(context);
438             a.push(data);
439         }
440
441         a.push(COMPAT_ARG);
442
443         return Y.Event.detach.apply(Y.Event, a);
444     };
445
446     /**
447      * Calls Y.Event.detach with the correct argument order
448      * @method addListener
449      */
450     Y.Event.addListener = function(el, type, fn, data, override) {
451
452
453         // var a = Y.Array(arguments, 0, true), el = a.shift();
454         // a.splice(2, 0, el);
455         // return Y.Event.attach.apply(Y.Event, a);
456         var context, a=[type, fn, el];
457
458         if (data) {
459
460             if (override) {
461                 context = (override === true) ? data : override;
462             }
463
464             a.push(context);
465             a.push(data);
466         }
467
468         a.push(COMPAT_ARG);
469
470         return Y.Event.attach.apply(Y.Event, a);
471     };
472
473     Y.Event.on = Y.Event.addListener;
474
475     var newOnavail = Y.Event.onAvailable;
476
477     Y.Event.onAvailable = function(id, fn, p_obj, p_override) {
478         return newOnavail(id, fn, p_obj, p_override, false, true);
479     };
480
481     Y.Event.onContentReady = function(id, fn, p_obj, p_override) {
482         return newOnavail(id, fn, p_obj, p_override, true, true);
483     };
484
485     Y.Event.onDOMReady = function() {
486         var a = Y.Array(arguments, 0, true);
487         a.unshift('domready');
488         return Y.on.apply(Y, a);
489     };
490
491     Y.util.Event = Y.Event;
492
493     var CE = function(type, oScope, silent, signature) {
494         //debugger;
495
496         var o = {
497             context: oScope,
498             silent: silent || false
499             // signature: signature || CE.LIST
500         };
501
502         CE.superclass.constructor.call(this, type, o);
503
504         this.signature = signature || CE.LIST;
505     };
506
507     Y.extend(CE, Y.CustomEvent, {
508
509     });
510
511     /**
512      * Subscriber listener sigature constant.  The LIST type returns three
513      * parameters: the event type, the array of args passed to fire, and
514      * the optional custom object
515      * @property YAHOO.util.CustomEvent.LIST
516      * @static
517      * @type int
518      */
519     CE.LIST = 0;
520
521     /**
522      * Subscriber listener sigature constant.  The FLAT type returns two
523      * parameters: the first argument passed to fire and the optional
524      * custom object
525      * @property YAHOO.util.CustomEvent.FLAT
526      * @static
527      * @type int
528      */
529     CE.FLAT = 1;
530
531     Y.util.CustomEvent = CE;
532
533     var EP = function() {
534         //console.log('Compat CustomEvent constructor executed: ' + this._yuid);
535         if (!this._yuievt) {
536             var sub = this.subscribe;
537             Y.EventTarget.apply(this, arguments);
538             this.subscribe = sub;
539             this.__yuiepinit = function() {};
540         }
541     };
542
543     Y.extend(EP, Y.EventTarget, {
544
545         createEvent: function(type, o) {
546             // if (!this._yuievt) {
547             //     Y.EventTarget.call(this);
548             // }
549             o = o || {};
550             o.signature = o.signature || CE.FLAT;
551             return this.publish(type, o);
552         },
553
554         subscribe: function(type, fn, obj, override) {
555             var ce = this._yuievt.events[type] || this.createEvent(type),
556                 a = Y.Array(arguments);
557
558             if (override && true !== override) {
559                 // a[2] = override;
560                 // a[1] = obj;
561             }
562
563             Y.EventTarget.prototype.on.apply(this, a);
564         },
565
566         fireEvent: function(type) {
567             return this.fire.apply(this, arguments);
568         },
569
570         hasEvent: function(type) {
571             if (!this._yuievt) {
572                 Y.EventTarget.call(this);
573             }
574             return this.getEvent(type);
575         }
576     });
577
578     Y.util.EventProvider = EP;
579
580 }
581
582
583 Y.register("event", Y.util.Event, {version: "3.3.0", build: "3167"});
584
585
586 var propertyCache = {};
587 var patterns = {
588     HYPHEN: /(-[a-z])/i, // to normalize get/setStyle
589     ROOT_TAG: /^body|html$/i, // body for quirks mode, html for standards,
590     OP_SCROLL:/^(?:inline|table-row)$/i
591 };
592 var slice = [].slice;
593
594 var hyphenToCamel = function(property) {
595     if ( !patterns.HYPHEN.test(property) ) {
596         return property; // no hyphens
597     }
598
599     if (propertyCache[property]) { // already converted
600         return propertyCache[property];
601     }
602
603     var converted = property;
604
605     while( patterns.HYPHEN.exec(converted) ) {
606         converted = converted.replace(RegExp.$1,
607                 RegExp.$1.substr(1).toUpperCase());
608     }
609
610     propertyCache[property] = converted;
611     return converted;
612     //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug
613 };
614
615 var Dom = {
616     _firstChild: function(node) {
617         return Y.Selector.query('> *', node, true);
618     },
619
620     get: function(el) {
621         if (el) {
622             if (el.nodeType || el.item) { // Node, or NodeList
623                 return el;
624             }
625
626             if (typeof el === 'string') { // id
627                 return document.getElementById(el);
628             }
629
630             if ('length' in el) { // array-like
631                 var c = [];
632                 for (var i = 0, len = el.length; i < len; ++i) {
633                     c[c.length] = Dom.get(el[i]);
634                 }
635
636                 return c;
637             }
638
639             return el; // some other object, just pass it back
640         }
641
642         return null;
643     },
644
645     isAncestor: function(haystack, needle) {
646         return YUI.DOM.contains(Dom.get(haystack), Dom.get(needle));
647     },
648
649     inDocument: function(el) {
650         return Dom.isAncestor(Y.config.doc.documentElement, el);
651     },
652
653     batch: function(el, method, o, override, args) {
654         el = (el && (el.tagName || el.item)) ? el : Dom.get(el); // skip get() when possible
655
656         if (!el || !method) {
657             return false;
658         }
659         if (args) {
660             args = Y.Array(args);
661         }
662         var scope = (override) ? o : window;
663
664         var apply = function(el) {
665             if (args) {
666                 var tmp = slice.call(args);
667                 tmp.unshift(el);
668                 return method.apply(scope, tmp);
669             } else {
670                 return method.call(scope, el, o);
671             }
672         };
673
674         if (el.tagName || el.length === undefined) { // element or not array-like
675             return apply(el);
676         }
677
678         var collection = [];
679
680         for (var i = 0, len = el.length; i < len; ++i) {
681             collection[collection.length] = apply(el[i]);
682         }
683
684         return collection;
685     },
686
687     // 2.x returns false if already present
688     _addClass: function(el, className) {
689         if ( YUI.DOM.hasClass(el, className) ) {
690             return false;
691         }
692
693         YUI.DOM.addClass(el, className);
694         return true;
695     },
696
697     // 2.x returns false if not present
698     _removeClass: function(el, className) {
699         if ( !YUI.DOM.hasClass(el, className) ) {
700             return false;
701         }
702
703         YUI.DOM.removeClass(el, className);
704         return true;
705     },
706
707     // 2.x returns false if no newClass or same as oldClass
708     _replaceClass: function(el, oldClass, newClass) {
709         if (!newClass || oldClass === newClass) {
710             return false;
711         }
712
713         YUI.DOM.replaceClass(el, oldClass, newClass);
714         return true;
715     },
716
717     getElementsByClassName: function(className, tag, root) {
718         tag = tag || '*';
719         root = (root) ? Dom.get(root) : Y.config.doc;
720         var nodes = [];
721         if (root) {
722             nodes = Y.Selector.query(tag + '.' + className, root);
723         }
724         return nodes;
725     },
726
727     getElementsBy: function(method, tag, root) {
728         tag = tag || '*';
729         root = (root) ? Dom.get(root) : null || document;
730
731
732         var nodes = Y.Selector.query(tag, root);
733         return nodes;
734     },
735
736     getViewportWidth: YUI.DOM.winWidth,
737     getViewportHeight: YUI.DOM.winHeight,
738     getDocumentWidth: YUI.DOM.docWidth,
739     getDocumentHeight: YUI.DOM.docHeight,
740     getDocumentScrollTop: YUI.DOM.docScrollY,
741     getDocumentScrollLeft: YUI.DOM.docScrollX,
742
743     _guid: function(el, prefix) {
744         prefix = prefix || 'yui-gen';
745         Dom._id_counter = Dom._id_counter || 0;
746
747         if (el && el.id) { // do not override existing ID
748             return el.id;
749         }
750
751         var id = prefix + Dom._id_counter++;
752
753         if (el) {
754             el.id = id;
755         }
756
757         return id;
758     },
759
760     _region: function(el) {
761         if ( (el.parentNode === null || el.offsetParent === null ||
762                 YUI.DOM.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) {
763             return false;
764         }
765
766         return YUI.DOM.region(el);
767
768     },
769
770     _ancestorByClass: function(element, className) {
771         return YUI.DOM.ancestor(element, function(el) {
772             return YUI.DOM.hasClass(el, className);
773         });
774     },
775
776     _ancestorByTag: function(element, tag) {
777         tag = tag.toUpperCase();
778         return YUI.DOM.ancestor(element, function(el) {
779             return el.tagName.toUpperCase() === tag;
780         });
781     }
782 };
783
784
785 var wrap = function(fn, name) {
786     Dom[name] = function() {
787         var args = slice.call(arguments);
788         args[0] = Dom.get(args[0]);
789         return fn.apply(Dom, args);
790     };
791 };
792
793 var wrapped = {
794     getAncestorBy: YUI.DOM.ancestor,
795     getAncestorByClassName: Dom._ancestorByClass,
796     getAncestorByTagName: Dom._ancestorByTag,
797     getPreviousSiblingBy: YUI.DOM.previous,
798     getPreviousSibling: YUI.DOM.previous,
799     getNextSiblingBy: YUI.DOM.next,
800     getNextSibling: YUI.DOM.next,
801     getFirstChildBy: Dom._firstChild,
802     getFirstChild: Dom._firstChild,
803     getLastChildBy: YUI.DOM.lastChild,
804     getLastChild: YUI.DOM.lastChild,
805     getChildrenBy: YUI.DOM.children,
806     getChildren: YUI.DOM.children,
807     insertBefore: function(newNode, refNode) {
808         YUI.DOM.insertBefore(Dom.get(newNode), Dom.get(refNode));
809     },
810     insertAfter: function(newNode, refNode) {
811         YUI.DOM.insertAfter(Dom.get(newNode), Dom.get(refNode));
812     }
813 };
814
815 Y.each(wrapped, wrap);
816
817 var batched = {
818     getStyle: YUI.DOM.getStyle,
819     setStyle: YUI.DOM.setStyle,
820     getXY: YUI.DOM.getXY,
821     setXY: YUI.DOM.setXY,
822     getX: YUI.DOM.getX,
823     getY: YUI.DOM.getY,
824     setX: YUI.DOM.setX,
825     setY: YUI.DOM.setY,
826     getRegion: Dom._region,
827     hasClass: YUI.DOM.hasClass,
828     addClass: Dom._addClass,
829     removeClass: Dom._removeClass,
830     replaceClass: Dom._replaceClass,
831     generateId: Dom._guid
832 };
833
834 Y.each(batched, function(v, n) {
835     Dom[n] = function(el) {
836         var args = slice.call(arguments, 1);
837         return Dom.batch(el, v, null, null, args);
838     };
839 });
840
841 Y.util.Dom = Dom;
842
843 YAHOO.util.Region = function(t, r, b, l) {
844     this.top = t;
845     this[1] = t;
846     this.right = r;
847     this.bottom = b;
848     this.left = l;
849     this[0] = l;
850 };
851
852 YAHOO.util.Region.prototype.contains = function(region) {
853     return ( region.left   >= this.left   &&
854              region.right  <= this.right  &&
855              region.top    >= this.top    &&
856              region.bottom <= this.bottom    );
857
858 };
859
860 YAHOO.util.Region.prototype.getArea = function() {
861     return ( (this.bottom - this.top) * (this.right - this.left) );
862 };
863
864 YAHOO.util.Region.prototype.intersect = function(region) {
865     var t = Math.max( this.top,    region.top    );
866     var r = Math.min( this.right,  region.right  );
867     var b = Math.min( this.bottom, region.bottom );
868     var l = Math.max( this.left,   region.left   );
869
870     if (b >= t && r >= l) {
871         return new YAHOO.util.Region(t, r, b, l);
872     } else {
873         return null;
874     }
875 };
876
877 YAHOO.util.Region.prototype.union = function(region) {
878     var t = Math.min( this.top,    region.top    );
879     var r = Math.max( this.right,  region.right  );
880     var b = Math.max( this.bottom, region.bottom );
881     var l = Math.min( this.left,   region.left   );
882
883     return new YAHOO.util.Region(t, r, b, l);
884 };
885
886 YAHOO.util.Region.prototype.toString = function() {
887     return ( "Region {"    +
888              "top: "       + this.top    +
889              ", right: "   + this.right  +
890              ", bottom: "  + this.bottom +
891              ", left: "    + this.left   +
892              "}" );
893 };
894
895 YAHOO.util.Region.getRegion = function(el) {
896     return YUI.DOM.region(el);
897 };
898
899 YAHOO.util.Point = function(x, y) {
900    if (YAHOO.lang.isArray(x)) { // accept input from Dom.getXY, Event.getXY, etc.
901       y = x[1]; // dont blow away x yet
902       x = x[0];
903    }
904
905     this.x = this.right = this.left = this[0] = x;
906     this.y = this.top = this.bottom = this[1] = y;
907 };
908
909 YAHOO.util.Point.prototype = new YAHOO.util.Region();
910
911 YAHOO.register("dom", YAHOO.util.Dom, {version: "3.3.0", build: "3167"});
912
913
914
915 }, '3.3.0' ,{requires:['dom','dom-style-ie','event-base','dump','substitute']});
916 YUI._setup(); YUI.use('compat');