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