text: /*
  Copyright (c) 2010, Yahoo! Inc. All rights reserved.
  Code licensed under the BSD License:
  http://developer.yahoo.com/yui/license.html
  version: 3.4.0
  build: nightly
  */
  YUI.add("io-base",function(a){var h=a.Lang,k=["start","complete","end","success","failure"],g=["status","statusText","responseText","responseXML"],b="getAllResponseHeaders",d="getResponseHeader",i=a.config.win,j=i.XMLHttpRequest,e=i.XDomainRequest,f=0;function c(m){var l=this;l._uid="io:"+f++;l._init(m);a.io._map[l._uid]=l;}c.prototype={_id:0,_headers:{"X-Requested-With":"XMLHttpRequest"},_timeout:{},_init:function(n){var m=this,l;m.cfg=n||{};a.augment(m,a.EventTarget);for(l=0;l<5;l++){m.publish("io:"+k[l],a.merge({broadcast:1},n));m.publish("io-trn:"+k[l],n);}},_create:function(v,p){var s=this,r={id:h.isNumber(p)?p:s._id++,uid:s._uid},l=v.xdr,m=l?l.use:v.form&&v.form.upload?"iframe":"xhr",q=(l&&l.use==="native"&&e),n=s._transport;switch(m){case"native":case"xhr":r.c=q?new e():j?new j():new ActiveXObject("Microsoft.XMLHTTP");r.t=q?true:false;break;default:r.c=n?n[m]:{};r.t=true;}return r;},_destroy:function(l){if(i){if(j&&l.t===true){l.c.onreadystatechange=null;}else{if(a.UA.ie){l.c.abort();}}}l.c=null;l=null;},_evt:function(q,m,t){var s=this,u=t["arguments"],v=s.cfg.emitFacade,l=v?[{id:m.id,data:m.c,cfg:t,arguments:u}]:[m.id],n="io:"+q,r="io-trn:"+q;if(!v){if(q===k[0]||q===k[2]){if(u){l.push(u);}}else{u?l.push(m.c,u):l.push(m.c);}}l.unshift(n);s.fire.apply(s,l);if(t.on){l[0]=r;s.once(r,t.on[q],t.context||a);s.fire.apply(s,l);}},start:function(l,m){this._evt(k[0],l,m);},complete:function(l,m){this._evt(k[1],l,m);},end:function(l,m){this._evt(k[2],l,m);this._destroy(l);},success:function(l,m){this._evt(k[3],l,m);this.end(l,m);},failure:function(l,m){this._evt(k[4],l,m);this.end(l,m);},_retry:function(m,l,n){this._destroy(m);n.xdr.use="flash";return this.send(l,n,m.id);},_concat:function(l,m){l+=(l.indexOf("?")===-1?"?":"&")+m;return l;},setHeader:function(m,n){if(n){this._headers[m]=n;}else{delete this._headers[m];}},_setHeaders:function(m,l){l=a.merge(this._headers,l);a.Object.each(l,function(n,o){if(n!=="disable"){m.setRequestHeader(o,l[o]);}});},_startTimeout:function(m,l){var n=this;n._timeout[m.id]=i.setTimeout(function(){n._abort(m,"timeout");},l);},_clearTimeout:function(l){i.clearTimeout(this._timeout[l]);delete this._timeout[l];},_result:function(m,n){var l=m.c.status;if(l>=200&&l<300||l===1223){this.success(m,n);}else{this.failure(m,n);}},_rS:function(l,n){var m=this;if(l.c.readyState===4){if(n.timeout){m._clearTimeout(l.id);}i.setTimeout(function(){m.complete(l,n);m._result(l,n);},0);}},_abort:function(m,l){if(m&&m.c){m.e=l;m.c.abort();}},send:function(p,y,t){var n,q,l,A,x,w=this,z=p;y=y?a.Object(y):{};n=w._create(y,t);q=y.method?y.method.toUpperCase():"GET";A=y.sync;x=y.data;if(h.isObject(x)){x=a.QueryString.stringify(x);}if(y.form){if(y.form.upload){return w.upload(n,p,y);}else{x=w._serialize(y.form,x);}}if(x){switch(q){case"GET":case"HEAD":case"DELETE":z=w._concat(z,x);x="";break;case"POST":case"PUT":y.headers=a.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},y.headers);break;}}if(n.t){return w.xdr(z,n,y);}if(!A){n.c.onreadystatechange=function(){w._rS(n,y);};}try{n.c.open(q,z,A?false:true,y.username||null,y.password||null);w._setHeaders(n.c,y.headers||{});w.start(n,y);if(y.xdr&&y.xdr.credentials){if(!a.UA.ie){n.c.withCredentials=true;}}n.c.send(x);if(A){l=a.mix({id:n.id,"arguments":y["arguments"]},n.c,false,g);l[b]=function(){return n.c[b]();};l[d]=function(m){return n.c[d](m);};w.complete(n,y);w._result(n,y);return l;}}catch(v){if(n.t){return w._retry(n,p,y);}else{w.complete(n,y);w._result(n,y);}}if(y.timeout){w._startTimeout(n,y.timeout);}return{id:n.id,abort:function(){return n.c?w._abort(n,"abort"):false;},isInProgress:function(){return n.c?n.c.readyState!==4&&n.c.readyState!==0:false;},io:w};}};a.io=function(l,n){var m=a.io._map["io:0"]||new c();return m.send.apply(m,[l,n]);};a.IO=c;a.io._map={};},"3.4.0",{requires:["event-custom-base","querystring-stringify-simple"]});