dom-style-min.js revision 45f27cabd6196774234000850bbe9a5f70c64f9b
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",K="clientLeft",a="hasLayout",M="px",N="filter",B="filters",W="opacity",O="auto",H="borderWidth",L="borderTopWidth",S="borderRightWidth",Z="borderBottomWidth",I="borderLeftWidth",J="width",Q="height",T="transparent",V="visible",D="getComputedStyle",c=undefined,b=document.documentElement,U=/^width|height$/,R=/^(\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;},P={CUSTOM_STYLES:{},get:function(Y,e){var d="",f;if(Y){f=F(Y)[e];if(e===W){d=E.DOM.CUSTOM_STYLES[W].get(Y);}else{if(!f||(f.indexOf&&f.indexOf(M)>-1)){d=f;}else{if(E.DOM.IE.COMPUTED[e]){d=E.DOM.IE.COMPUTED[e](Y,e);}else{if(R.test(f)){d=P.getPixel(Y,e)+M;}else{d=f;}}}}}return d;},sizeOffsets:{width:["Left","Right"],height:["Top","Bottom"],top:["Top"],bottom:["Bottom"]},getOffset:function(e,k){var g=F(e)[k],Y=k.charAt(0).toUpperCase()+k.substr(1),j="offset"+Y,d="pixel"+Y,h=P.sizeOffsets[k],f="";if(g===O||g.indexOf("%")>-1){f=e["offset"+Y];if(h[0]){f-=P.getPixel(e,"padding"+h[0]);f-=P.getBorderWidth(e,"border"+h[0]+"Width",1);}if(h[1]){f-=P.getPixel(e,"padding"+h[1]);f-=P.getBorderWidth(e,"border"+h[1]+"Width",1);}}else{if(!e.style[d]&&!e.style[k]){e.style[k]=g;}f=e.style[d];}return f+M;},borderMap:{thin:"2px",medium:"4px",thick:"6px"},getBorderWidth:function(d,f,Y){var e=Y?"":M,g=d.currentStyle[f];if(g.indexOf(M)<0){if(P.borderMap[g]){g=P.borderMap[g];}else{}}return(Y)?parseFloat(g):g;},getPixel:function(e,Y){var g=null,d=F(e),h=d.right,f=d[Y];e.style.right=f;g=e.style.pixelRight;e.style.right=h;return g;},getMargin:function(e,Y){var f,d=F(e);if(d[Y]==O){f=0;}else{f=P.getPixel(e,Y);}return f+M;},getVisibility:function(d,Y){var e;while((e=d.currentStyle)&&e[Y]=="inherit"){d=d.parentNode;}return(e)?e[Y]:V;},getColor:function(d,Y){var e=F(d)[Y];if(!e||e===T){E.DOM.elementByAxis(d,"parentNode",null,function(f){e=F(f)[Y];if(e&&e!==T){d=f;return true;}});}return E.Color.toRGB(e);},getBorderColor:function(d,Y){var e=F(d),f=e[Y]||e.color;return E.Color.toRGB(E.Color.toHex(f));}},G={};if(b.style[W]===c&&b[B]){E.DOM.CUSTOM_STYLES[W]={get:function(d){var g=100;try{g=d[B]["DXImageTransform.Microsoft.Alpha"][W];}catch(f){try{g=d[B]("alpha")[W];}catch(Y){}}return g/100;},set:function(d,g,Y){var f,e;if(g===""){e=F(d);f=(W in e)?e[W]:1;g=f;}if(typeof Y[N]=="string"){Y[N]="alpha("+W+"="+g*100+")";if(!d.currentStyle||!d.currentStyle[a]){Y.zoom=1;}}}};}try{document.createElement("div").style.height="-1px";}catch(X){E.DOM.CUSTOM_STYLES.height={set:function(e,f,d){var Y=parseFloat(f);if(isNaN(Y)||Y>=0){d.height=f;}else{}}};E.DOM.CUSTOM_STYLES.width={set:function(e,f,d){var Y=parseFloat(f);if(isNaN(Y)||Y>=0){d.width=f;}else{}}};}G[J]=G[Q]=P.getOffset;G.color=G.backgroundColor=P.getColor;G[H]=G[L]=G[S]=G[Z]=G[I]=P.getBorderWidth;G.marginTop=G.marginRight=G.marginBottom=G.marginLeft=P.getMargin;G.visibility=P.getVisibility;G.borderColor=G.borderTopColor=G.borderRightColor=G.borderBottomColor=G.borderLeftColor=P.getBorderColor;if(!E.config.win[D]){E.DOM[D]=P.get;}E.namespace("DOM.IE");E.DOM.IE.COMPUTED=G;E.DOM.IE.ComputedStyle=P;})(A);},"@VERSION@",{skinnable:false,requires:["dom-base"]});