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