/*
YUI 3.5.1 (build 22)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("event-outside",function(b){var a=["blur","change","click","dblclick","focus","keydown","keypress","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","select","submit"];b.Event.defineOutside=function(e,d){d=d||(e+"outside");var c={on:function(h,f,g){f.handle=b.one("doc").on(e,function(i){if(this.isOutside(h,i.target)){i.currentTarget=h;g.fire(i);}},this);},detach:function(h,f,g){f.handle.detach();},delegate:function(i,g,h,f){g.handle=b.one("doc").delegate(e,function(j){if(this.isOutside(i,j.target)){h.fire(j);}},f,this);},isOutside:function(f,g){return g!==f&&!g.ancestor(function(h){return h===f;});}};c.detachDelegate=c.detach;b.Event.define(d,c);};b.Array.each(a,function(c){b.Event.defineOutside(c);});},"3.5.1",{requires:["event-synthetic"]});