get-min.js revision 363f3227ee1180bc324d66c3bafe1b6d38341e03
YUI.add("get",function(A){(function(){var C=A.UA,B=A.Lang,D=A.guid("yui_");A.Get=function(){var L={},J=0,E=0,S=false,U=function(Y,V,Z){var W=Z||A.config.win,a=W.document,b=a.createElement(Y),X;for(X in V){if(V[X]&&V.hasOwnProperty(X)){b.setAttribute(X,V[X]);}}return b;},R=function(V,W,Y){var X=Y||"utf-8";return U("link",{"id":D+(E++),"type":"text/css","charset":X,"rel":"stylesheet","href":V},W);},Q=function(V,W,Y){var X=Y||"utf-8";return U("script",{"id":D+(E++),"type":"text/javascript","charset":X,"src":V},W);},M=function(c){var Z=L[c],b,V,a,Y,X,W;if(Z){b=Z.nodes;V=b.length;a=Z.win.document;Y=a.getElementsByTagName("head")[0];if(Z.insertBefore){X=K(Z.insertBefore,c);if(X){Y=X.parentNode;}}for(W=0;W<V;W=W+1){Y.removeChild(b[W]);}}Z.nodes=[];},N=function(V,W){return{tId:V.tId,win:V.win,data:V.data,nodes:V.nodes,msg:W,purge:function(){M(this.tId);}};},T=function(Y,X){var V=L[Y],W;if(V.timer){V.timer.cancel();}if(V.onFailure){W=V.context||V;V.onFailure.call(W,N(V,X));}},K=function(V,Y){var W=L[Y],X=(B.isString(V))?W.win.document.getElementById(V):V;if(!X){T(Y,"target node not found: "+V);}return X;},H=function(Y){var V=L[Y],X,W;if(V.timer){V.timer.cancel();}V.finished=true;if(V.aborted){X="transaction "+Y+" was aborted";T(Y,X);return;}if(V.onSuccess){W=V.context||V;V.onSuccess.call(W,N(V));}},O=function(X){var V=L[X],W;if(V.onTimeout){W=V.context||V;V.onTimeout.call(W,N(V));}},G=function(X,a){var W=L[X],Z,e,c,b,Y,V,f;if(W.timer){W.timer.cancel();}if(W.aborted){Z="transaction "+X+" was aborted";T(X,Z);return;}if(a){W.url.shift();if(W.varName){W.varName.shift();}}else{W.url=(B.isString(W.url))?[W.url]:W.url;if(W.varName){W.varName=(B.isString(W.varName))?[W.varName]:W.varName;}}e=W.win;c=e.document;b=c.getElementsByTagName("head")[0];if(W.url.length===0){H(X);return;}V=W.url[0];if(!V){W.url.shift();return G(X);}if(W.timeout){W.timer=B.later(W.timeout,W,O,X);}if(W.type==="script"){Y=Q(V,e,W.charset);}else{Y=R(V,e,W.charset);}I(W.type,Y,X,V,e,W.url.length);W.nodes.push(Y);if(W.insertBefore){f=K(W.insertBefore,X);if(f){f.parentNode.insertBefore(Y,f);}}else{b.appendChild(Y);}if((C.webkit||C.gecko)&&W.type==="css"){G(X,V);}},F=function(){if(S){return;}S=true;var V,W;for(V in L){if(L.hasOwnProperty(V)){W=L[V];if(W.autopurge&&W.finished){M(W.tId);delete L[V];}}}S=false;},P=function(W,V,X){X=X||{};var a="q"+(J++),Y,Z=X.purgethreshold||A.Get.PURGE_THRESH;if(J%Z===0){F();}L[a]=A.merge(X,{tId:a,type:W,url:V,finished:false,nodes:[]});Y=L[a];Y.win=Y.win||A.config.win;Y.context=Y.context||Y;Y.autopurge=("autopurge" in Y)?Y.autopurge:(W==="script")?true:false;B.later(0,Y,G,a);return{tId:a};},I=function(X,c,b,W,a,Z,V){var Y=V||G;if(C.ie){c.onreadystatechange=function(){var d=this.readyState;if("loaded"===d||"complete"===d){c.onreadystatechange=null;Y(b,W);}};}else{if(C.webkit){if(X==="script"){c.addEventListener("load",function(){Y(b,W);});}}else{c.onload=function(){Y(b,W);};c.onerror=function(d){T(b,d+": "+W);};}}};return{PURGE_THRESH:20,_finalize:function(V){B.later(0,null,H,V);},abort:function(W){var X=(B.isString(W))?W:W.tId,V=L[X];if(V){V.aborted=true;}},script:function(V,W){return P("script",V,W);},css:function(V,W){return P("css",V,W);}};}();})();},"@VERSION@");