dom-screen-min.js revision 931e86d9347e296b2faa2e896a679f787f0edba6
YUI.add("dom-screen",function(A){(function(F){var D="documentElement",Q="compatMode",O="position",C="fixed",M="relative",G="left",H="top",I="BackCompat",P="medium",E="borderLeftWidth",B="borderTopWidth",R="getBoundingClientRect",K="getComputedStyle",L=F.DOM,N=/^t(?:able|d|h)$/i,J;if(F.UA.ie){if(F.config.doc[Q]!=="quirks"){J=D;}else{J="body";}}F.mix(L,{winHeight:function(T){var S=L._getWinSize(T).height;return S;},winWidth:function(T){var S=L._getWinSize(T).width;return S;},docHeight:function(T){var S=L._getDocSize(T).height;return Math.max(S,L._getWinSize(T).height);},docWidth:function(T){var S=L._getDocSize(T).width;return Math.max(S,L._getWinSize(T).width);},docScrollX:function(U,V){V=V||(U)?L._getDoc(U):F.config.doc;var T=V.defaultView,S=(T)?T.pageXOffset:0;return Math.max(V[D].scrollLeft,V.body.scrollLeft,S);},docScrollY:function(U,V){V=V||(U)?L._getDoc(U):F.config.doc;var T=V.defaultView,S=(T)?T.pageYOffset:0;return Math.max(V[D].scrollTop,V.body.scrollTop,S);},getXY:function(){if(F.config.doc[D][R]){return function(W){var d=null,X,T,Y,b,a,S,V,Z,c,U;if(W&&W.tagName){c=W.ownerDocument;U=c[D];if(U.contains){inDoc=U.contains(W);}else{inDoc=F.DOM.contains(U,W);}if(inDoc){X=(J)?c[J].scrollLeft:L.docScrollX(W,c);T=(J)?c[J].scrollTop:L.docScrollY(W,c);Y=W[R]();d=[Y.left,Y.top];if(F.UA.ie){b=2;a=2;Z=c[Q];S=L[K](c[D],E);V=L[K](c[D],B);if(F.UA.ie===6){if(Z!==I){b=0;a=0;}}if((Z==I)){if(S!==P){b=parseInt(S,10);}if(V!==P){a=parseInt(V,10);}}d[0]-=b;d[1]-=a;}if((T||X)){if(!F.UA.ios){d[0]+=X;d[1]+=T;}}}else{d=L._getOffset(W);}}return d;};}else{return function(T){var W=null,V,S,Y,U,X;if(T){if(L.inDoc(T)){W=[T.offsetLeft,T.offsetTop];V=T.ownerDocument;S=T;Y=((F.UA.gecko||F.UA.webkit>519)?true:false);while((S=S.offsetParent)){W[0]+=S.offsetLeft;W[1]+=S.offsetTop;if(Y){W=L._calcBorders(S,W);}}if(L.getStyle(T,O)!=C){S=T;while((S=S.parentNode)){U=S.scrollTop;X=S.scrollLeft;if(F.UA.gecko&&(L.getStyle(S,"overflow")!=="visible")){W=L._calcBorders(S,W);}if(U||X){W[0]-=X;W[1]-=U;}}W[0]+=L.docScrollX(T,V);W[1]+=L.docScrollY(T,V);}else{W[0]+=L.docScrollX(T,V);W[1]+=L.docScrollY(T,V);}}else{W=L._getOffset(T);}}return W;};}}(),getX:function(S){return L.getXY(S)[0];},getY:function(S){return L.getXY(S)[1];},setXY:function(T,W,Z){var U=L.setStyle,Y,X,S,V;if(T&&W){Y=L.getStyle(T,O);X=L._getOffset(T);if(Y=="static"){Y=M;U(T,O,Y);}V=L.getXY(T);if(W[0]!==null){U(T,G,W[0]-V[0]+X[0]+"px");}if(W[1]!==null){U(T,H,W[1]-V[1]+X[1]+"px");}if(!Z){S=L.getXY(T);if(S[0]!==W[0]||S[1]!==W[1]){L.setXY(T,W,true);}}}else{}},setX:function(T,S){return L.setXY(T,[S,null]);},setY:function(S,T){return L.setXY(S,[null,T]);},swapXY:function(T,S){var U=L.getXY(T);L.setXY(T,L.getXY(S));L.setXY(S,U);},_calcBorders:function(U,V){var T=parseInt(L[K](U,B),10)||0,S=parseInt(L[K](U,E),10)||0;if(F.UA.gecko){if(N.test(U.tagName)){T=0;S=0;}}V[0]+=S;V[1]+=T;return V;},_getWinSize:function(V,X){X=X||(V)?L._getDoc(V):F.config.doc;var W=X.defaultView||X.parentWindow,Y=X[Q],U=W.innerHeight,T=W.innerWidth,S=X[D];if(Y&&!F.UA.opera){if(Y!="CSS1Compat"){S=X.body;}U=S.clientHeight;T=S.clientWidth;}return{height:U,width:T};},_getDocSize:function(T){var U=(T)?L._getDoc(T):F.config.doc,S=U[D];if(U[Q]!="CSS1Compat"){S=U.body;}return{height:S.scrollHeight,width:S.scrollWidth};}});})(A);(function(G){var D="top",C="right",H="bottom",B="left",F=function(L,K){var N=Math.max(L[D],K[D]),O=Math.min(L[C],K[C]),I=Math.min(L[H],K[H]),J=Math.max(L[B],K[B]),M={};M[D]=N;M[C]=O;M[H]=I;M[B]=J;return M;},E=G.DOM;G.mix(E,{region:function(J){var K=E.getXY(J),I=false;if(J&&K){I=E._getRegion(K[1],K[0]+J.offsetWidth,K[1]+J.offsetHeight,K[0]);}return I;},intersect:function(K,I,M){var J=M||E.region(K),L={},O=I,N;if(O.tagName){L=E.region(O);}else{if(G.Lang.isObject(I)){L=I;}else{return false;}}N=F(L,J);return{top:N[D],right:N[C],bottom:N[H],left:N[B],area:((N[H]-N[D])*(N[C]-N[B])),yoff:((N[H]-N[D])),xoff:(N[C]-N[B]),inRegion:E.inRegion(K,I,false,M)};},inRegion:function(L,I,J,N){var M={},K=N||E.region(L),P=I,O;if(P.tagName){M=E.region(P);}else{if(G.Lang.isObject(I)){M=I;}else{return false;}}if(J){return(K[B]>=M[B]&&K[C]<=M[C]&&K[D]>=M[D]&&K[H]<=M[H]);}else{O=F(M,K);if(O[H]>=O[D]&&O[C]>=O[B]){return true;}else{return false;}}},inViewportRegion:function(J,I,K){return E.inRegion(J,E.viewportRegion(J),I,K);},_getRegion:function(K,L,I,J){var M={};M[D]=M[1]=K;M[B]=M[0]=J;M[H]=I;M[C]=L;M.width=M[C]-M[B];M.height=M[H]-M[D];return M;},viewportRegion:function(J){J=J||G.config.doc.documentElement;var I=false,L,K;if(J){L=E.docScrollX(J);K=E.docScrollY(J);I=E._getRegion(K,E.winWidth(J)+L,K+E.winHeight(J),L);}return I;}});})(A);},"@VERSION@",{requires:["dom-base","dom-style","event-base"]});