(function(n,c){var i="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color outlineColor".split(" "),f=/^([\-+])=\s*(\d+\.?\d*)/,e=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(o){return[o[1],o[2],o[3],o[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(o){return[2.55*o[1],2.55*o[2],2.55*o[3],o[4]]}},{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,parse:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(o){return[o[1],o[2]/100,o[3]/100,o[4]]}}],d=n.Color=function(p,q,o,r){return new n.Color.fn.parse(p,q,o,r)},h={rgba:{cache:"_rgba",props:{red:{idx:0,type:"byte",empty:true},green:{idx:1,type:"byte",empty:true},blue:{idx:2,type:"byte",empty:true},alpha:{idx:3,type:"percent",def:1}}},hsla:{cache:"_hsla",props:{hue:{idx:0,type:"degrees",empty:true},saturation:{idx:1,type:"percent",empty:true},lightness:{idx:2,type:"percent",empty:true}}}},m={"byte":{floor:true,min:0,max:255},percent:{min:0,max:1},degrees:{mod:360,floor:true}},k=h.rgba.props,l=d.support={},a,j=n.each;h.hsla.props.alpha=k.alpha;function g(q,s,p){var o=m[s.type]||{},r=s.empty||p;if(r&&q==null){return null}if(s.def&&q==null){return s.def}if(o.floor){q=~~q}else{q=parseFloat(q)}if(n.isNaN(q)){return s.def}if(o.mod){q=q%o.mod;return q<0?o.mod+q:q}return o.min>q?o.min:o.max<q?o.max:q}d.fn=d.prototype={constructor:d,parse:function(v,t,o,u){if(v===c){this._rgba=[null,null,null,null];return this}if(v instanceof n||v.nodeType){v=v instanceof n?v.css(t):n(v).css(t);t=c}var s=this,q=n.type(v),p=this._rgba=[],r;if(t!==c){v=[v,t,o,u];q="array"}if(q==="string"){v=v.toLowerCase();j(e,function(B,C){var A=C.re.exec(v),z=A&&C.parse(A),y,x=C.space||"rgba",w=h[x].cache;if(z){y=s[x](z);s[w]=y[w];p=s._rgba=y._rgba;return false}});if(p.length!==0){if(Math.max.apply(Math,p)===0){n.extend(p,a.transparent)}return this}v=a[v]||a._default;return this.parse(v)}if(q==="array"){j(k,function(w,x){p[x.idx]=g(v[x.idx],x)});return this}if(q==="object"){if(v instanceof d){j(h,function(w,x){if(v[x.cache]){s[x.cache]=v[x.cache].slice()}})}else{j(h,function(w,x){j(x.props,function(z,A){var y=x.cache;if(!s[y]&&x.to){if(v[z]==null||z==="alpha"){return}s[y]=x.to(s._rgba)}s[y][A.idx]=g(v[z],A,true)})})}return this}},is:function(q){var p=d(q),r=true,o=this;j(h,function(s,u){var t=p[u.cache],v;if(t){v=o[u.cache]||u.to&&u.to(o._rgba)||[];j(u.props,function(w,x){if(t[x.idx]!=null){r=(t[x.idx]==v[x.idx]);return r}})}return r});return r},_space:function(){var o=[],p=this;j(h,function(q,r){if(p[r.cache]){o.push(q)}});return o.pop()},transition:function(p,u){var q=d(p),r=q._space(),s=h[r],t=this[s.cache]||s.to(this._rgba),o=t.slice();q=q[s.cache];j(s.props,function(y,A){var x=A.idx,w=t[x],v=q[x],z=m[A.type]||{};if(v===null){return}if(w===null){o[x]=v}else{if(z.mod){if(v-w>z.mod/2){w+=z.mod}else{if(w-v>z.mod/2){w-=z.mod}}}o[A.idx]=g((v-w)*u+w,A)}});return this[r](o)},blend:function(r){if(this._rgba[3]===1){return this}var q=this._rgba.slice(),p=q.pop(),o=d(r)._rgba;return d(n.map(q,function(s,t){return(1-p)*o[t]+p*s}))},toRgbaString:function(){var p="rgba(",o=n.map(this._rgba,function(q,r){return q==null?(r>2?1:0):q});if(o[3]===1){o.pop();p="rgb("}return p+o.join(",")+")"},toHslaString:function(){var p="hsla(",o=n.map(this.hsla(),function(q,r){if(q==null){q=r>2?1:0}if(r&&r<3){q=Math.round(q*100)+"%"}return q});if(o[3]==1){o.pop();p="hsl("}return p+o.join(",")+")"},toHexString:function(o){var p=this._rgba.slice(),q=p.pop();if(o){p.push(~~(q*255))}return"#"+n.map(p,function(r,s){r=(r||0).toString(16);return r.length==1?"0"+r:r}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}};d.fn.parse.prototype=d.fn;function b(s,r,o){o=(o+1)%1;if(o*6<1){return s+(r-s)*6*o}if(o*2<1){return r}if(o*3<2){return s+(r-s)*((2/3)-o)*6}return s}h.hsla.to=function(q){if(q[0]==null||q[1]==null||q[2]==null){return[null,null,null,q[3]]}var o=q[0]/255,v=q[1]/255,w=q[2]/255,y=q[3],x=Math.max(o,v,w),t=Math.min(o,v,w),z=x-t,A=x+t,p=A*0.5,u,B;if(t===x){u=0}else{if(o===x){u=(60*(v-w)/z)+360}else{if(v===x){u=(60*(w-o)/z)+120}else{u=(60*(o-v)/z)+240}}}if(p===0||p===1){B=p}else{if(p<=0.5){B=z/A}else{B=z/(2-A)}}return[Math.round(u)%360,B,p,y==null?1:y]};h.hsla.from=function(u){if(u[0]==null||u[1]==null||u[2]==null){return[null,null,null,u[3]]}var x=u[0]/360,B=u[1],w=u[2],A=u[3],t=w<=0.5?w*(1+B):w+B-w*B,v=2*w-t,o,y,z;return[Math.round(b(v,t,x+(1/3))*255),Math.round(b(v,t,x)*255),Math.round(b(v,t,x-(1/3))*255),A]};j(h,function(p,r){var q=r.props,o=r.cache,t=r.to,s=r.from;d.fn[p]=function(y){if(t&&!this[o]){this[o]=t(this._rgba)}if(y===c){return this[o].slice()}var x=n.type(y),u=(x==="array"||x==="object")?y:arguments,w=this[o].slice(),v;j(q,function(z,B){var A=u[x==="object"?z:B.idx];if(A==null){A=w[B.idx]}w[B.idx]=g(A,B)});if(s){v=d(s(w));v[o]=w;return v}else{return d(w)}};j(q,function(u,v){if(d.fn[u]){return}d.fn[u]=function(z){var B=n.type(z),y=(u==="alpha"?(this._hsla?"hsla":"rgba"):p),x=this[y](),A=x[v.idx],w;if(B==="undefined"){return A}if(B==="function"){z=z.call(this,A);B=n.type(z)}if(z==null&&v.empty){return this}if(B==="string"){w=f.exec(z);if(w){z=A+parseFloat(w[2])*(w[1]==="+"?1:-1)}}x[v.idx]=z;return this[y](x)}})});j(i,function(o,p){n.cssHooks[p]={set:function(s,t){t=d(t);if(!l.rgba&&t._rgba[3]!==1){var q,r=p==="backgroundColor"?s.parentNode:s;do{q=n.curCSS(r,"backgroundColor")}while((q===""||q==="transparent")&&(r=r.parentNode)&&r.style);t=t.blend(q&&q!=="transparent"?q:"_default")}t=t.toRgbaString();s.style[p]=t}};n.fx.step[p]=function(q){if(!q.colorInit){q.start=d(q.elem,p);q.end=d(q.end);q.colorInit=true}n.cssHooks[p].set(q.elem,q.start.transition(q.end,q.pos))}});n(function(){var p=document.createElement("div"),o=p.style;o.cssText="background-color:rgba(1,1,1,.5)";l.rgba=o.backgroundColor.indexOf("rgba")>-1});a=n.Color.names={aqua:"#00ffff",azure:"#f0ffff",beige:"#f5f5dc",black:"#000000",blue:"#0000ff",brown:"#a52a2a",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkviolet:"#9400d3",fuchsia:"#ff00ff",gold:"#ffd700",green:"#008000",indigo:"#4b0082",khaki:"#f0e68c",lightblue:"#add8e6",lightcyan:"#e0ffff",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightyellow:"#ffffe0",lime:"#00ff00",magenta:"#ff00ff",maroon:"#800000",navy:"#000080",olive:"#808000",orange:"#ffa500",pink:"#ffc0cb",purple:"#800080",violet:"#800080",red:"#ff0000",silver:"#c0c0c0",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}})(jQuery);

