dom-style-min.js revision f7a78a97fa58e83269b82d26c4a60838bcde29ca
YUI.add("dom-style",function(A){(function(E){var C="documentElement",B="defaultView",D="ownerDocument",L="style",N="float",F="cssFloat",G="styleFloat",J="transparent",H="getComputedStyle",M=E.config.doc,I=undefined,K=/color$/i;E.mix(E.DOM,{CUSTOM_STYLES:{},setStyle:function(R,O,S,Q){Q=Q||R.style;var P=E.DOM.CUSTOM_STYLES;if(Q){if(S===null){S="";}if(O in P){if(P[O].set){P[O].set(R,S,Q);return;}else{if(typeof P[O]==="string"){O=P[O];}}}Q[O]=S;}},getStyle:function(R,O){var Q=R[L],P=E.DOM.CUSTOM_STYLES,S="";if(Q){if(O in P){if(P[O].get){return P[O].get(R,O,Q);}else{if(typeof P[O]==="string"){O=P[O];}}}S=Q[O];if(S===""){S=E.DOM[H](R,O);}}return S;},setStyles:function(P,Q){var O=P.style;E.each(Q,function(R,S){E.DOM.setStyle(P,S,R,O);},E.DOM);},getComputedStyle:function(P,O){var R="",Q=P[D];if(P[L]){R=Q[B][H](P,null)[O];}return R;}});if(M[C][L][F]!==I){E.DOM.CUSTOM_STYLES[N]=F;}else{if(M[C][L][G]!==I){E.DOM.CUSTOM_STYLES[N]=G;}}if(E.UA.opera){E.DOM[H]=function(Q,P){var O=Q[D][B],R=O[H](Q,"")[P];if(K.test(P)){R=E.Color.toRGB(R);}return R;};}if(E.UA.webkit){E.DOM[H]=function(Q,P){var O=Q[D][B],R=O[H](Q,"")[P];if(R==="rgba(0, 0, 0, 0)"){R=J;}return R;};}})(A);(function(E){var D="toString",B=parseInt,C=RegExp;E.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(F){if(!E.Color.re_RGB.test(F)){F=E.Color.toHex(F);}if(E.Color.re_hex.exec(F)){F="rgb("+[B(C.$1,16),B(C.$2,16),B(C.$3,16)].join(", ")+")";}return F;},toHex:function(F){F=E.Color.KEYWORDS[F]||F;if(E.Color.re_RGB.exec(F)){F=[Number(C.$1).toString(16),Number(C.$2).toString(16),Number(C.$3).toString(16)];for(i=0;i<F.length;i++){if(F[i].length<2){F[i]=F[i].replace(E.Color.re_hex3,"$1$1");}}F="#"+F.join("");}if(F.length<6){F=F.replace(E.Color.re_hex3,"$1$1");}if(F!=="transparent"&&F.indexOf("#")<0){F="#"+F;}return F.toLowerCase();}};})(A);(function(E){var C="clientTop",J="clientLeft",Z="hasLayout",L="px",M="filter",B="filters",V="opacity",N="auto",K="borderTopWidth",R="borderRightWidth",X="borderBottomWidth",H="borderLeftWidth",I="width",P="height",S="transparent",U="visible",D="getComputedStyle",b=undefined,a=document.documentElement,T=/^width|height$/,Q=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,F=function(Y){return Y.currentStyle||Y.style;},O={CUSTOM_STYLES:{},get:function(Y,d){var c="",e;if(Y){e=F(Y)[d];if(d===V){c=E.DOM.CUSTOM_STYLES[V].get(Y);}else{if(!e||(e.indexOf&&e.indexOf(L)>-1)){c=e;}else{if(E.DOM.IE.COMPUTED[d]){c=E.DOM.IE.COMPUTED[d](Y,d);}else{if(Q.test(e)){c=O.getPixel(Y,d)+L;}else{c=e;}}}}}return c;},getOffset:function(d,j){var f=F(d)[j],Y=j.charAt(0).toUpperCase()+j.substr(1),g="offset"+Y,c="pixel"+Y,h,e="";if(f===N){h=d[g];if(h===b){e=0;}e=h;if(T.test(j)){d.style[j]=h;if(d[g]>h){e=h-(d[g]-h);}d.style[j]=N;}}else{if(f.indexOf("%")>-1){f=d.clientWidth-O.getPixel(d,"paddingRight")-O.getPixel(d,"paddingLeft");}if(!d.style[c]&&!d.style[j]){d.style[j]=f;}e=d.style[c];}return e+L;},getBorderWidth:function(Y,d){var c=null;if(!Y.currentStyle||!Y.currentStyle[Z]){Y.style.zoom=1;}switch(d){case K:c=Y[C];break;case X:c=Y.offsetHeight-Y.clientHeight-Y[C];break;case H:c=Y[J];break;case R:c=Y.offsetWidth-Y.clientWidth-Y[J];break;}return c+L;},getPixel:function(d,Y){var f=null,c=F(d),g=c.right,e=c[Y];d.style.right=e;f=d.style.pixelRight;d.style.right=g;return f;},getMargin:function(d,Y){var e,c=F(d);if(c[Y]==N){e=0;}else{e=O.getPixel(d,Y);}return e+L;},getVisibility:function(c,Y){var d;while((d=c.currentStyle)&&d[Y]=="inherit"){c=c.parentNode;}return(d)?d[Y]:U;},getColor:function(c,Y){var d=F(c)[Y];if(!d||d===S){E.DOM.elementByAxis(c,"parentNode",null,function(e){d=F(e)[Y];if(d&&d!==S){c=e;return true;}});}return E.Color.toRGB(d);},getBorderColor:function(c,Y){var d=F(c),e=d[Y]||d.color;return E.Color.toRGB(E.Color.toHex(e));}},G={};if(a.style[V]===b&&a[B]){E.DOM.CUSTOM_STYLES[V]={get:function(c){var f=100;try{f=c[B]["DXImageTransform.Microsoft.Alpha"][V];}catch(d){try{f=c[B]("alpha")[V];}catch(Y){}}return f/100;},set:function(c,f,Y){var e,d;if(f===""){d=F(c);e=(V in d)?d[V]:1;f=e;}if(typeof Y[M]=="string"){Y[M]="alpha("+V+"="+f*100+")";if(!c.currentStyle||!c.currentStyle[Z]){Y.zoom=1;}}}};}try{document.createElement("div").style.height="-1px";}catch(W){E.DOM.CUSTOM_STYLES.height={set:function(d,e,c){var Y=parseFloat(e);if(isNaN(Y)||Y>=0){c.height=e;}else{}}};E.DOM.CUSTOM_STYLES.width={set:function(d,e,c){var Y=parseFloat(e);if(isNaN(Y)||Y>=0){c.width=e;}else{}}};}G[I]=G[P]=O.getOffset;G.color=G.backgroundColor=O.getColor;G[K]=G[R]=G[X]=G[H]=O.getBorderWidth;G.marginTop=G.marginRight=G.marginBottom=G.marginLeft=O.getMargin;G.visibility=O.getVisibility;G.borderColor=G.borderTopColor=G.borderRightColor=G.borderBottomColor=G.borderLeftColor=O.getBorderColor;if(!E.config.win[D]){E.DOM[D]=O.get;}E.namespace("DOM.IE");E.DOM.IE.COMPUTED=G;E.DOM.IE.ComputedStyle=O;})(A);},"@VERSION@",{skinnable:false,requires:["dom-base"]});