Sys.ComponentSet=function(n,t,i){this._elementSet=n||(n=new Sys.ElementSet);this._components=this._execute(n,t,i)};Sys.ComponentSet.prototype={__class:!0,setProperties:function(n){return this.each(function(){Sys._set(this,n)})},get:function(n){var t=this._components;return typeof n=="undefined"?Array.apply(null,t):t[n||0]||null},each:function(n){return foreach(this._components,function(t,i){if(n.call(t,i)===!1)return!0}),this},elements:function(){return this._elementSet},_execute:function(n,t,i){function u(n){var i;return n instanceof t||(i=n.constructor)&&(i===t||i.inheritsFrom&&i.inheritsFrom(t)||i.implementsInterface&&i.implementsInterface(t))}var r=[];return t instanceof Array?r.push.apply(r,t):n.each(function(){var n=this.control;n&&(!t||u(n))&&r.push(n);foreach(this._behaviors,function(n){(!t||u(n))&&r.push(n)})}),typeof i!="undefined"&&(r=r[i]?[r[i]]:[]),r}};