/*
YUI 3.4.1 (build 4118)
Copyright 2011 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("rls",function(a){a.rls_handleTimeout=function(b){a.Get.abort(b.tId);b.purge();b.message="RLS request timed out, fetching loader";a.rls_failure(b);};a.rls_handleFailure=function(b){b.message="RLS request failed, fetching loader";a.rls_failure(b);};a.rls_failure=function(b){YUI.Env.rls_disabled=true;a.config.use_rls=false;if(b.data){b.data.unshift("loader");a._use(b.data,function(d,c){d._notify(d.rls_callback,c,b.data);d.rls_advance();});}};a.rls_locals=function(i,e,c){if(YUI.Env.rls_disabled){var g={message:"RLS is disabled, moving to loader",data:e};a.rls_failure(g);return;}if(i.config.modules){var b=[],d=a.Array.hash(e),k="fullpath",h,j=i.config.modules;for(h in j){if(j[h][k]){if(d[h]){b.push(j[h][k]);if(j[h].requires){a.Array.each(j[h].requires,function(l){if(!YUI.Env.mods[l]){if(j[l]){if(j[l][k]){b.push(j[l][k]);e.push(l);}}}});}}}}if(b.length){a.Get.script(b,{onEnd:function(f){c(i,e);},data:e});}else{c(i,e);}}else{c(i,e);}};a.rls_needs=function(g,c){var d=c||this,e=d.config,f,b=YUI.Env.aliases[g];if(b){for(f=0;f<b.length;f++){if(a.rls_needs(b[f])){return true;}}return false;}if(!YUI.Env.mods[g]&&!(e.modules&&e.modules[g])){return true;}return false;};a._rls=function(u){var y=a.config,e=y.modules,g=a.Array,b=a.Object,f=y.rls||{m:1,v:a.version,gv:y.gallery,env:1,lang:y.lang,"2in3v":y["2in3"],"2v":y.yui2,filt:y.filter,filts:y.filters,ignore:y.ignore,tests:1},l=y.rls_base||"http://loader.yahooapis.com/v1/load?",n=y.rls_tmpl||function(){var d=[],i;for(i in f){if(i in f&&f[i]){d.push(i+"={"+i+"}");}}return d.join("&");}(),q=[],h={},p,v,z,x,r,k=[],s,t=u.length,c;for(s=0;s<t;s++){x=YUI.Env.aliases[u[s]];if(x){for(r=0;r<x.length;r++){k.push(x[r]);}}else{k.push(u[s]);}}u=k;t=u.length;for(s=0;s<t;s++){h[u[s]]=1;if(a.rls_needs(u[s])){q.push(u[s]);}else{}}if(e){for(s in e){if(h[s]&&e[s].requires&&!e[s].noop){t=e[s].requires.length;for(p=0;p<t;p++){z=e[s].requires[p];if(a.rls_needs(z)){q.push(z);}else{v=YUI.Env.mods[z]||e[z];if(v){v=v.details||v;if(!v.noop){if(v.requires){g.each(v.requires,function(d){if(a.rls_needs(d)){q.push(d);}});}}}}}}}}b.each(YUI.Env.mods,function(d){if(h[d.name]){if(d.details&&d.details.requires){if(!d.noop){g.each(d.details.requires,function(i){if(a.rls_needs(i)){q.push(i);}});}}}});function A(d){if(a.rls_needs(d)){q.unshift(d);}}if(f.filt==="debug"){g.each(["dump","yui-log"],A);}if(a.config.groups){A("loader-base");}q=g.dedupe(q);q=g.dedupe(q);u=g.dedupe(u);if(!q.length){return false;}f.m=q.sort();f.env=[].concat(b.keys(YUI.Env.mods),g.dedupe(YUI._rls_skins)).sort();f.tests=a.Features.all("load",[a]);c=a.Lang.sub(l+n,f);y.rls=f;y.rls_tmpl=n;YUI._rls_active={asked:u,attach:q,inst:a,url:c};return c;};a.rls_oncomplete=function(b){YUI._rls_active.cb=b;};a.rls_advance=function(){var b=YUI.Env;b._rls_in_progress=false;if(b._rls_queue.size()){b._rls_queue.next()();}};a.rls_done=function(b){b.success=true;YUI._rls_active.cb(b);};if(!YUI._rls_active){YUI._rls_active={};}if(!YUI._rls_skins){YUI._rls_skins=[];}if(!YUI.$rls){YUI.$rls=function(e){var g=YUI._rls_active,f=g.inst;if(f){if(e.error){if(!e.missing){e.missing=[];}f.rls_failure({message:e.error,data:[].concat(e.modules,e.missing)});}if(YUI.Env&&YUI.Env.rls_disabled){return;}if(e.css&&f.config.fetchCSS){f.Get.css(g.url+"&css=1");}if(e.modules&&!e.css){if(e.modules.length){var d=f.Array.some(e.modules,function(h){return(h.indexOf("lang")===0);});if(d){e.modules.unshift("intl");}}f.Env.bootstrapped=true;f.Array.each(e.modules,function(h){if(h.indexOf("skin-")>-1){YUI._rls_skins.push(h);}});f._attach([].concat(e.modules,g.asked));var c=e.missing;if(f.config.groups){if(!c){c=[];}c=[].concat(c,g.what);}if(c&&f.Loader){var b=new f.Loader(g.inst.config);b.onEnd=f.rls_done;b.context=f;b.data=c;b.ignoreRegistered=false;b.require(c);b.insert(null,(f.config.fetchCSS)?null:"js");}else{f.rls_done({data:e.modules});}}}};}},"3.4.1",{requires:["get","features"]});