/*
PIE: CSS3 rendering for IE
Version 1.0beta5
http://css3pie.com
Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2.
2013.04.17 change made to PIE.BackgroundRenderer (hideBackground() and destroy()) to fix a bug related to fill images not loading on objects with rounded corners. Copyright (c) 2013 Adobe Systems Incorporated All Rights Reserved.
*/
(function(){var a=document,b=window.PIE;if(!b){b=window.PIE={CSS_PREFIX:"-pie-",STYLE_PREFIX:"Pie",CLASS_PREFIX:"pie_",tableCellTags:{TD:1,TH:1},childlessElements:{TABLE:1,THEAD:1,TBODY:1,TFOOT:1,TR:1,INPUT:1,TEXTAREA:1,SELECT:1,OPTION:1,IMG:1,HR:1},focusableElements:{A:1,INPUT:1,TEXTAREA:1,SELECT:1,BUTTON:1},inputButtonTypes:{submit:1,button:1,reset:1},emptyFn:function(){}};try{a.execCommand("BackgroundImageCache",!1,!0)}catch(d){}(function(){for(var c=4,f=a.createElement("div"),d=f.getElementsByTagName("i");f.innerHTML=
"<\!--[if gt IE "+ ++c+"]>",d[0];);b.ieVersion=c;if(c===6)b.CSS_PREFIX=b.CSS_PREFIX.replace(/^-/,"");b.ieDocMode=a.documentMode||b.ieVersion;f.innerHTML='';c=f.firstChild;c.style.behavior="url(#default#VML)";b.supportsVML=typeof c.adj==="object"})();(function(){var c,f=0,d={};b.Util={createVmlElement:function(b){c||(c=a.createDocumentFragment(),c.namespaces.add("css3vml","urn:schemas-microsoft-com:vml"));return c.createElement("css3vml:"+b)},getUID:function(c){return c&&
c._pieId||(c._pieId="_"+ ++f)},merge:function(c){var b,a,f,d,g=arguments;b=1;for(a=g.length;b=90&&k<270?a:0;p=k<180?d:0;o=a-n;q=d-p}function j(){for(;k<0;)k+=360;k%=360}var k=i.angle,i=i.gradientStart,l,m,n,p,o,q,r,s;if(i)i=i.coords(c,a,d),l=i.x,m=i.y;k?(k=k.degrees(),j(),h(),i||(l=n,m=p),i=b.GradientUtil.perpendicularIntersect(l,m,k,o,q),c=i[0],i=i[1]):i?(c=a-l,i=d-m):(l=m=c=0,i=d);r=c-l;s=i-m;k===void 0&&(k=!r?s<0?90:270:!s?r<0?180:0:-Math.atan2(s,r)/Math.PI*180,j(),h());return{angle:k,startX:l,startY:m,endX:c,endY:i,startCornerX:n,startCornerY:p,endCornerX:o,endCornerY:q,deltaX:r,deltaY:s,
lineLength:b.GradientUtil.distance(l,m,c,i)}},perpendicularIntersect:function(c,b,a,d,h){return a===0||a===180?[d,b]:a===90||a===270?[c,h]:(a=Math.tan(-a*Math.PI/180),c=a*c-b,b=-1/a,d=b*d-h,h=b-a,[(d-c)/h,(a*d-b*c)/h])},distance:function(c,b,a,d){c=a-c;b=d-b;return Math.abs(c===0?b:b===0?c:Math.sqrt(c*c+b*b))}};b.Observable=function(){this.observers=[];this.indexes={}};b.Observable.prototype={observe:function(c){var a=b.Util.getUID(c),d=this.indexes,i=this.observers;if(!(a in d))d[a]=i.length,i.push(c)},
unobserve:function(c){var c=b.Util.getUID(c),a=this.indexes;c&&c in a&&(delete this.observers[a[c]],delete a[c])},fire:function(){for(var c=this.observers,b=c.length;b--;)c[b]&&c[b]()}};b.Heartbeat=new b.Observable;b.Heartbeat.run=function(){var c=this;if(!c.running)setInterval(function(){c.fire()},250),c.running=1};(function(){function c(){b.OnUnload.fire();window.detachEvent("onunload",c);window.PIE=null}b.OnUnload=new b.Observable;window.attachEvent("onunload",c);b.OnUnload.attachManagedEvent=
function(c,b,a){c.attachEvent(b,a);this.observe(function(){c.detachEvent(b,a)})}})();b.OnResize=new b.Observable;b.OnUnload.attachManagedEvent(window,"onresize",function(){b.OnResize.fire()});(function(){function c(){b.OnScroll.fire()}b.OnScroll=new b.Observable;b.OnUnload.attachManagedEvent(window,"onscroll",c);b.OnResize.observe(c)})();(function(){var c;b.OnUnload.attachManagedEvent(window,"onbeforeprint",function(){c=b.Element.destroyAll()});b.OnUnload.attachManagedEvent(window,"onafterprint",
function(){if(c){for(var a=0,d=c.length;a0?parseFloat(a):c.tagName in b.childlessElements?(i=this,g=c.parentNode,b.getLength(a).pixels(g,function(){return i.getEmPixels(g)})):(c.appendChild(d),a=d.offsetWidth,d.parentNode===c&&c.removeChild(d),a)}};b.getLength=function(b){return l[b]||(l[b]=new c(b))};return c}();b.BgPosition=function(){function c(c){this.tokens=c}var a=b.getLength("50%"),d={top:1,center:1,bottom:1},
i={left:1,center:1,right:1};c.prototype={getValues:function(){if(!this._values){var c=this.tokens,j=c.length,k=b.Tokenizer,l=k.Type,m=b.getLength("0"),l=l.IDENT,m=["left",m,"top",m];j===1&&(c.push(new k.Token(l,"center")),j++);if(j===2)l&(c[0].tokenType|c[1].tokenType)&&c[0].tokenValue in d&&c[1].tokenValue in i&&c.push(c.shift()),c[0].tokenType&l?c[0].tokenValue==="center"?m[1]=a:m[0]=c[0].tokenValue:c[0].isLengthOrPercent()&&(m[1]=b.getLength(c[0].tokenValue)),c[1].tokenType&l?c[1].tokenValue===
"center"?m[3]=a:m[2]=c[1].tokenValue:c[1].isLengthOrPercent()&&(m[3]=b.getLength(c[1].tokenValue));this._values=m}return this._values},coords:function(c,b,a){var d=this.getValues(),f=d[1].pixels(c,b),c=d[3].pixels(c,a);return{x:d[0]==="right"?b-f:f,y:d[2]==="bottom"?a-c:c}}};return c}();b.BgSize=function(){function c(c,b){this.w=c;this.h=b}c.prototype={pixels:function(c,b,a,d,j){var k=this.w,l=this.h,m=b/a;d/=j;k==="contain"?(k=d>m?b:a*d,l=d>m?b/d:a):k==="cover"?(k=d=this.css.length)return h();k=this.ch;j=this.css.substring(this.ch);l=j.charAt(0);switch(l){case "#":if(m=j.match(this.hashColor))return this.ch+=
m[0].length,i(a.COLOR,m[0]);break;case '"':case "'":if(m=j.match(this.string))return this.ch+=m[0].length,i(a.STRING,m[2]||m[3]||"");break;case "/":case ",":return this.ch++,i(a.OPERATOR,l);case "u":if(m=j.match(this.url))return this.ch+=m[0].length,i(a.URL,m[2]||m[3]||m[4]||"")}if(m=j.match(this.number)){l=m[0];this.ch+=l.length;if(j.charAt(l.length)==="%")return this.ch++,i(a.PERCENT,l+"%");if(m=j.substring(l.length).match(this.ident))return l+=m[0],this.ch+=m[0].length,i(this.unitTypes[m[0].toLowerCase()]||
a.DIMEN,l);return i(a.NUMBER,l)}if(m=j.match(this.ident)){l=m[0];this.ch+=l.length;if(l.toLowerCase()in b.Color.names||l==="currentColor"||l==="transparent")return i(a.COLOR,l);if(j.charAt(l.length)==="("){this.ch++;if(l.toLowerCase()in this.colorFunctions){j=function(c){return c&&c.tokenType&a.NUMBER};m=function(c){return c&&c.tokenType&(a.NUMBER|a.PERCENT)};var p=function(c,b){return c&&c.tokenValue===b},o=function(){return n.next(1)};if((l.charAt(0)==="r"?m(o()):j(o()))&&p(o(),",")&&m(o())&&p(o(),
",")&&m(o())&&(l==="rgb"||l==="hsa"||p(o(),",")&&j(o()))&&p(o(),")"))return i(a.COLOR,this.css.substring(k,this.ch));return h()}return i(a.FUNCTION,l)}return i(a.IDENT,l)}this.ch++;return i(a.CHARACTER,l)},hasNext:function(){var c=this.next();this.prev();return!!c},prev:function(){return this.tokens[this.tokenIndex-- -2]},all:function(){for(;this.next(););return this.tokens},until:function(c,b){for(var a=[],d,f;d=this.next();){if(c(d)){f=!0;this.prev();break}a.push(d)}return b&&!f?null:a}};return c}();
b.BoundsInfo=function(c){this.targetElement=c};b.BoundsInfo.prototype={_locked:0,positionChanged:function(){var c=this._lastBounds,b;return!c||(b=this.getBounds())&&(c.x!==b.x||c.y!==b.y)},sizeChanged:function(){var c=this._lastBounds,b;return!c||(b=this.getBounds())&&(c.w!==b.w||c.h!==b.h)},getLiveBounds:function(){var c=this.targetElement,a=c.getBoundingClientRect(),d=b.ieDocMode===9;return{x:a.left,y:a.top,w:d?c.offsetWidth:a.right-a.left,h:d?c.offsetHeight:a.bottom-a.top}},getBounds:function(){return this._locked?
this._lockedBounds||(this._lockedBounds=this.getLiveBounds()):this.getLiveBounds()},hasBeenQueried:function(){return!!this._lastBounds},lock:function(){++this._locked},unlock:function(){if(!--this._locked){if(this._lockedBounds)this._lastBounds=this._lockedBounds;this._lockedBounds=null}}};(function(){function c(c){var a=b.Util.getUID(c);return function(){if(this._locked){var b=this._lockedValues||(this._lockedValues={});return a in b?b[a]:b[a]=c.call(this)}else return c.call(this)}}b.StyleInfoBase=
{_locked:0,newStyleInfo:function(c){function a(c){this.targetElement=c;this._lastCss=this.getCss()}b.Util.merge(a.prototype,b.StyleInfoBase,c);a._propsCache={};return a},getProps:function(){var c=this.getCss(),b=this.constructor._propsCache;return c?c in b?b[c]:b[c]=this.parseCss(c):null},getCss:c(function(){var c=this.targetElement,a=this.constructor,d=c.style,c=c.currentStyle,h=this.cssProperty,j=this.styleProperty,k=a._prefixedCssProp||(a._prefixedCssProp=b.CSS_PREFIX+h),a=a._prefixedStyleProp||
(a._prefixedStyleProp=b.STYLE_PREFIX+j.charAt(0).toUpperCase()+j.substring(1));return d[a]||c.getAttribute(k)||d[j]||c.getAttribute(h)}),isActive:c(function(){return!!this.getProps()}),changed:c(function(){var c=this.getCss(),b=c!==this._lastCss;this._lastCss=c;return b}),cacheWhenLocked:c,lock:function(){++this._locked},unlock:function(){--this._locked||delete this._lockedValues}}})();b.BackgroundStyleInfo=b.StyleInfoBase.newStyleInfo({cssProperty:b.CSS_PREFIX+"background",styleProperty:b.STYLE_PREFIX+
"Background",attachIdents:{scroll:1,fixed:1,local:1},repeatIdents:{"repeat-x":1,"repeat-y":1,repeat:1,"no-repeat":1},originAndClipIdents:{"padding-box":1,"border-box":1,"content-box":1},positionIdents:{top:1,right:1,bottom:1,left:1,center:1},sizeIdents:{contain:1,cover:1},propertyNames:{CLIP:"backgroundClip",COLOR:"backgroundColor",IMAGE:"backgroundImage",ORIGIN:"backgroundOrigin",POSITION:"backgroundPosition",REPEAT:"backgroundRepeat",SIZE:"backgroundSize"},parseCss:function(c){function a(c){return c&&
c.isLengthOrPercent()||c.tokenType&n&&c.tokenValue in s}function d(c){return c&&(c.isLengthOrPercent()&&b.getLength(c.tokenValue)||c.tokenValue==="auto"&&"auto")}var i=this.targetElement.currentStyle,h,j,k,l=b.Tokenizer.Type,m=l.OPERATOR,n=l.IDENT,p=l.COLOR,o,q,r=0,s=this.positionIdents,w,u,v={bgImages:[]};if(this.getCss3()){h=new b.Tokenizer(c);for(k={};j=h.next();)if(o=j.tokenType,q=j.tokenValue,!k.imgType&&o&l.FUNCTION&&q==="linear-gradient"){w={stops:[],imgType:q};for(u={};j=h.next();){o=j.tokenType;
q=j.tokenValue;if(o&l.CHARACTER&&q===")"){u.color&&w.stops.push(u);w.stops.length>1&&b.Util.merge(k,w);break}if(o&p){if(w.angle||w.gradientStart){j=h.prev();if(j.tokenType!==m)break;h.next()}u={color:b.getColor(q)};j=h.next();j.isLengthOrPercent()?u.offset=b.getLength(j.tokenValue):h.prev()}else if(o&l.ANGLE&&!w.angle&&!u.color&&!w.stops.length)w.angle=new b.Angle(j.tokenValue);else if(a(j)&&!w.gradientStart&&!u.color&&!w.stops.length)h.prev(),w.gradientStart=new b.BgPosition(h.until(function(c){return!a(c)},
!1));else if(o&m&&q===",")u.color&&(w.stops.push(u),u={});else break}}else if(!k.imgType&&o&l.URL)k.imgUrl=q,k.imgType="image";else if(a(j)&&!k.bgPosition)h.prev(),k.bgPosition=new b.BgPosition(h.until(function(c){return!a(c)},!1));else if(o&n)if(q in this.repeatIdents&&!k.imgRepeat)k.imgRepeat=q;else if(q in this.originAndClipIdents&&!k.bgOrigin)k.bgOrigin=q,(j=h.next())&&j.tokenType&n&&j.tokenValue in this.originAndClipIdents?k.bgClip=j.tokenValue:(k.bgClip=q,h.prev());else if(q in this.attachIdents&&
!k.bgAttachment)k.bgAttachment=q;else return null;else if(o&p&&!v.color)v.color=b.getColor(q);else if(o&m&&q==="/"&&!k.bgSize&&k.bgPosition)if(j=h.next(),j.tokenType&n&&j.tokenValue in this.sizeIdents)k.bgSize=new b.BgSize(j.tokenValue);else if(j=d(j))o=d(h.next()),o||(o=j,h.prev()),k.bgSize=new b.BgSize(j,o);else return null;else if(o&m&&q===","&&k.imgType)k.origString=c.substring(r,h.ch-1),r=h.ch,v.bgImages.push(k),k={};else return null;if(k.imgType)k.origString=c.substring(r),v.bgImages.push(k)}else this.withActualBg(b.ieDocMode<
9?function(){var c=this.propertyNames,a=i[c.POSITION+"X"],d=i[c.POSITION+"Y"],f=i[c.IMAGE],g=i[c.COLOR];if(g!=="transparent")v.color=b.getColor(g);if(f!=="none")v.bgImages=[{imgType:"image",imgUrl:(new b.Tokenizer(f)).next().tokenValue,imgRepeat:i[c.REPEAT],bgPosition:new b.BgPosition((new b.Tokenizer(a+" "+d)).all())}]}:function(){var c=this.propertyNames,a=/\s*,\s*/,d=i[c.IMAGE].split(a),f=i[c.COLOR],g,h,j,k,l,m;if(f!=="transparent")v.color=b.getColor(f);if((k=d.length)&&d[0]!=="none"){f=i[c.REPEAT].split(a);
g=i[c.POSITION].split(a);h=i[c.ORIGIN].split(a);j=i[c.CLIP].split(a);c=i[c.SIZE].split(a);v.bgImages=[];for(a=0;a8,d=this.propertyNames,i=this.targetElement.runtimeStyle,h=i[d.IMAGE],j=i[d.COLOR],k=i[d.REPEAT],l,m,n,p;h&&(i[d.IMAGE]="");j&&(i[d.COLOR]="");k&&(i[d.REPEAT]="");a&&(l=i[d.CLIP],m=i[d.ORIGIN],p=i[d.POSITION],n=i[d.SIZE],l&&(i[d.CLIP]=""),m&&(i[d.ORIGIN]=""),p&&(i[d.POSITION]=""),n&&(i[d.SIZE]=""));c=c.call(this);h&&(i[d.IMAGE]=h);j&&(i[d.COLOR]=j);k&&(i[d.REPEAT]=k);a&&(l&&(i[d.CLIP]=l),m&&(i[d.ORIGIN]=m),p&&(i[d.POSITION]=p),n&&(i[d.SIZE]=n));return c},getCss:b.StyleInfoBase.cacheWhenLocked(function(){return this.getCss3()||
this.withActualBg(function(){var c=this.targetElement.currentStyle,b=this.propertyNames;return c[b.COLOR]+" "+c[b.IMAGE]+" "+c[b.REPEAT]+" "+c[b.POSITION+"X"]+" "+c[b.POSITION+"Y"]})}),getCss3:b.StyleInfoBase.cacheWhenLocked(function(){var c=this.targetElement;return c.style[this.styleProperty]||c.currentStyle.getAttribute(this.cssProperty)}),isPngFix:function(){var c=0;if(b.ieVersion<7)c=this.targetElement,c=""+(c.style[b.STYLE_PREFIX+"PngFix"]||c.currentStyle.getAttribute(b.CSS_PREFIX+"png-fix"))===
"true";return c},isActive:b.StyleInfoBase.cacheWhenLocked(function(){return(this.getCss3()||this.isPngFix())&&!!this.getProps()})});b.BorderStyleInfo=b.StyleInfoBase.newStyleInfo({sides:["Top","Right","Bottom","Left"],namedWidths:{thin:"1px",medium:"3px",thick:"5px"},parseCss:function(){var c={},a={},d={},i=!1,h=!0,j=!0,k=!0;this.withActualBorder(function(){var f;for(var l=this.targetElement.currentStyle,m=0,n,p,o,q,r,s,w;m<4;m++)o=this.sides[m],w=o.charAt(0).toLowerCase(),n=a[w]=l["border"+o+"Style"],
p=l["border"+o+"Color"],o=l["border"+o+"Width"],m>0&&(n!==q&&(j=!1),p!==r&&(h=!1),o!==s&&(k=!1)),q=n,r=p,s=o,d[w]=b.getColor(p),f=c[w]=b.getLength(a[w]==="none"?"0":this.namedWidths[o]||o),o=f,o.pixels(this.targetElement)>0&&(i=!0)});return i?{widths:c,styles:a,colors:d,widthsSame:k,colorsSame:h,stylesSame:j}:null},getCss:b.StyleInfoBase.cacheWhenLocked(function(){var c=this.targetElement,a=c.currentStyle,d;c.tagName in b.tableCellTags&&c.offsetParent.currentStyle.borderCollapse==="collapse"||this.withActualBorder(function(){d=
a.borderWidth+"|"+a.borderStyle+"|"+a.borderColor});return d}),withActualBorder:function(c){var b=this.targetElement.runtimeStyle,a=b.borderWidth,d=b.borderColor;if(a)b.borderWidth="";if(d)b.borderColor="";c=c.call(this);if(a)b.borderWidth=a;if(d)b.borderColor=d;return c}});(function(){b.BorderRadiusStyleInfo=b.StyleInfoBase.newStyleInfo({cssProperty:"border-radius",styleProperty:"borderRadius",parseCss:function(c){var a=null,d,h,j,k,l=!1;if(c){h=new b.Tokenizer(c);var m=function(){for(var c=[],a;(j=
h.next())&&j.isLengthOrPercent();){k=b.getLength(j.tokenValue);a=k.getNumber();if(a<0)return null;a>0&&(l=!0);c.push(k)}return c.length>0&&c.length<5?{tl:c[0],tr:c[1]||c[0],br:c[2]||c[0],bl:c[3]||c[1]||c[0]}:null};if(c=m())j?j.tokenType&b.Tokenizer.Type.OPERATOR&&j.tokenValue==="/"&&(d=m()):d=c,l&&c&&d&&(a={x:c,y:d})}return a}});var c=b.getLength("0"),c={tl:c,tr:c,br:c,bl:c};b.BorderRadiusStyleInfo.ALL_ZERO={x:c,y:c}})();b.BorderImageStyleInfo=b.StyleInfoBase.newStyleInfo({cssProperty:"border-image",
styleProperty:"borderImage",repeatIdents:{stretch:1,round:1,repeat:1,space:1},parseCss:function(c){var a=null,d,i,h,j,k,l,m=0,n=b.Tokenizer.Type,p=n.IDENT,o=n.NUMBER,q=n.PERCENT;if(c){d=new b.Tokenizer(c);for(var a={},r=function(c){return c&&c.tokenType&n.OPERATOR&&c.tokenValue==="/"},s=function(c){return c&&c.tokenType&p&&c.tokenValue==="fill"},w=function(){j=d.until(function(c){return!(c.tokenType&(o|q))});s(d.next())&&!a.fill?a.fill=!0:d.prev();r(d.next())?(m++,k=d.until(function(c){return!c.isLengthOrPercent()&&
!(c.tokenType&p&&c.tokenValue==="auto")}),r(d.next())&&(m++,l=d.until(function(c){return!c.isLength()}))):d.prev()};c=d.next();)if(i=c.tokenType,h=c.tokenValue,i&(o|q)&&!j)d.prev(),w();else if(s(c)&&!a.fill)a.fill=!0,w();else if(i&p&&this.repeatIdents[h]&&!a.repeat){if(a.repeat={h:h},c=d.next())c.tokenType&p&&this.repeatIdents[c.tokenValue]?a.repeat.v=c.tokenValue:d.prev()}else if(i&n.URL&&!a.src)a.src=h;else return null;if(!a.src||!j||j.length<1||j.length>4||k&&k.length>4||m===1&&k.length<1||l&&
l.length>4||m===2&&l.length<1)return null;if(!a.repeat)a.repeat={h:"stretch"};if(!a.repeat.v)a.repeat.v=a.repeat.h;c=function(c,a){return{t:a(c[0]),r:a(c[1]||c[0]),b:a(c[2]||c[0]),l:a(c[3]||c[1]||c[0])}};a.slice=c(j,function(c){return b.getLength(c.tokenType&o?c.tokenValue+"px":c.tokenValue)});if(k&&k[0])a.widths=c(k,function(c){return c.isLengthOrPercent()?b.getLength(c.tokenValue):c.tokenValue});if(l&&l[0])a.outset=c(l,function(c){return c.isLength()?b.getLength(c.tokenValue):c.tokenValue})}return a}});
b.BoxShadowStyleInfo=b.StyleInfoBase.newStyleInfo({cssProperty:"box-shadow",styleProperty:"boxShadow",parseCss:function(c){var a,d=b.getLength,i=b.Tokenizer.Type,h;if(c){h=new b.Tokenizer(c);a={outset:[],inset:[]};for(c=function(){for(var c,k,l,m,n,p;c=h.next();)if(l=c.tokenValue,k=c.tokenType,k&i.OPERATOR&&l===",")break;else if(c.isLength()&&!n)h.prev(),n=h.until(function(c){return!c.isLength()});else if(k&i.COLOR&&!m)m=l;else if(k&i.IDENT&&l==="inset"&&!p)p=!0;else return!1;c=n&&n.length;if(c>1&&
c<5)return(p?a.inset:a.outset).push({xOffset:d(n[0].tokenValue),yOffset:d(n[1].tokenValue),blur:d(n[2]?n[2].tokenValue:"0"),spread:d(n[3]?n[3].tokenValue:"0"),color:b.getColor(m||"currentColor")}),!0;return!1};c(););}return a&&(a.inset.length||a.outset.length)?a:null}});b.VisibilityStyleInfo=b.StyleInfoBase.newStyleInfo({getCss:b.StyleInfoBase.cacheWhenLocked(function(){var c=this.targetElement.currentStyle;return c.visibility+"|"+c.display}),parseCss:function(){var c=this.targetElement,a=c.runtimeStyle,
c=c.currentStyle,b=a.visibility,d;a.visibility="";d=c.visibility;a.visibility=b;return{visible:d!=="hidden",displayed:c.display!=="none"}},isActive:function(){return!1}});b.RendererBase={newRenderer:function(c){function a(c,b,d,f){this.targetElement=c;this.boundsInfo=b;this.styleInfos=d;this.parent=f}b.Util.merge(a.prototype,b.RendererBase,c);return a},isPositioned:!1,needsUpdate:function(){return!1},prepareUpdate:b.emptyFn,updateProps:function(){this.destroy();this.isActive()&&this.draw()},updatePos:function(){this.isPositioned=
!0},updateSize:function(){this.isActive()?this.draw():this.destroy()},addLayer:function(c,a){this.removeLayer(c);for(var b=this._layers||(this._layers=[]),d=c+1,h=b.length,j;d6)j=k.x,k=k.y,d=i;else{do d=d.offsetParent;while(d&&d.currentStyle.position==="static");d?(g=d.getBoundingClientRect(),d=d.currentStyle,j=k.x-g.left-(parseFloat(d.borderLeftWidth)||
0),k=k.y-g.top-(parseFloat(d.borderTopWidth)||0)):(d=a.documentElement,j=k.x+d.scrollLeft-d.clientLeft,k=k.y+d.scrollTop-d.clientTop);d="absolute"}h.position=d;h.left=j;h.top=k;h.zIndex=i==="static"?-1:c.zIndex;this.isPositioned=!0}},updateSize:b.emptyFn,updateVisibility:function(){var c=this.styleInfos.visibilityInfo.getProps();this.getBox().style.display=c.visible&&c.displayed?"":"none"},updateProps:function(){this.isActive()?this.updateVisibility():this.destroy()},getPositioningElement:function(){var c=
this.targetElement;return c.tagName in b.tableCellTags?c.offsetParent:c},getBox:function(){var c=this._box,b;if(!c)b=this.getPositioningElement(),c=this._box=a.createElement("css3-container"),c.style.direction="ltr",this.updateVisibility(),b.parentNode.insertBefore(c,b);return c},finishUpdate:b.emptyFn,destroy:function(){var c=this._box,a;c&&(a=c.parentNode)&&a.removeChild(c);delete this._box;delete this._layers}});b.BackgroundRenderer=b.RendererBase.newRenderer({boxZIndex:2,boxName:"background",
needsUpdate:function(){var c=this.styleInfos;return c.backgroundInfo.changed()||c.borderRadiusInfo.changed()},isActive:function(){var c=this.styleInfos;return c.borderImageInfo.isActive()||c.borderRadiusInfo.isActive()||c.backgroundInfo.isActive()||c.boxShadowInfo.isActive()&&c.boxShadowInfo.getProps().inset},draw:function(){var c=this.boundsInfo.getBounds();c.w&&c.h&&(this.drawBgColor(),this.drawBgImages())},drawBgColor:function(){var c=this.styleInfos.backgroundInfo.getProps(),a=this.boundsInfo.getBounds(),
b=this.targetElement,d=c&&c.color,h,j;if(d&&d.alpha()>0){if(this.hideBackground(),c=this.getShape("bgColor","fill",this.getBox(),1),h=a.w,a=a.h,c.stroked=!1,c.coordsize=h*2+","+a*2,c.coordorigin="1,1",c.path=this.getBoxPath(null,2),j=c.style,j.width=h,j.height=a,c.fill.color=d.colorValue(b),b=d.alpha(),b<1)c.fill.opacity=b}else this.deleteShape("bgColor")},drawBgImages:function(){var c=this.styleInfos.backgroundInfo.getProps(),a=this.boundsInfo.getBounds(),c=c&&c.bgImages,b,d,h,j,k;if(c){this.hideBackground();
d=a.w;h=a.h;for(k=c.length;k--;)a=c[k],b=this.getShape("bgImage"+k,"fill",this.getBox(),2),b.stroked=!1,b.fill.type="tile",b.fillcolor="none",b.coordsize=d*2+","+h*2,b.coordorigin="1,1",b.path=this.getBoxPath(0,2),j=b.style,j.width=d,j.height=h,a.imgType==="linear-gradient"?this.addLinearGradient(b,a):(b.fill.src=a.imgUrl,this.positionBgImage(b,k))}for(k=c?c.length:0;this.deleteShape("bgImage"+k++););},positionBgImage:function(c,a){var d=this;b.Util.withImageSize(c.fill.src,function(i){var h=d.targetElement,
j=d.boundsInfo.getBounds(),k=j.w,j=j.h;if(k&&j){var l=c.fill,m=d.styleInfos,n=m.borderInfo.getProps(),p=n&&n.widths,n=p?p.t.pixels(h):0,o=p?p.r.pixels(h):0,q=p?p.b.pixels(h):0,p=p?p.l.pixels(h):0,m=m.backgroundInfo.getProps().bgImages[a],h=m.bgPosition?m.bgPosition.coords(h,k-i.w-p-o,j-i.h-n-q):{x:0,y:0},m=m.imgRepeat,q=o=0,r=k+1,s=j+1,w=b.ieVersion===8?0:1,p=Math.round(h.x)+p+0.5,n=Math.round(h.y)+n+0.5;l.position=p/k+","+n/j;if(m&&m!=="repeat"){if(m==="repeat-x"||m==="no-repeat")o=n+1,s=n+i.h+w;
if(m==="repeat-y"||m==="no-repeat")q=p+1,r=p+i.w+w;c.style.clip="rect("+o+"px,"+r+"px,"+s+"px,"+q+"px)"}}})},addLinearGradient:function(c,a){var d=this.targetElement,i=this.boundsInfo.getBounds(),h=i.w,j=i.h,i=c.fill,k=a.stops,l=k.length,m=Math.PI,n=b.GradientUtil,p=n.perpendicularIntersect,o=n.distance,n=n.getGradientMetrics(d,h,j,a),q=n.angle,r=n.startX,s=n.startY,w=n.startCornerX,u=n.startCornerY,v=n.endCornerX,C=n.endCornerY,t=n.deltaX,y=n.deltaY,n=n.lineLength,h=q%90?Math.atan2(t*h/j,y)/m*180:
q+90;h+=180;h%=360;v=p(w,u,q,v,C);j=o(w,u,v[0],v[1]);m=[];v=p(r,s,q,w,u);o=o(r,s,v[0],v[1])/j*100;p=[];for(q=0;q2?"ThinThin":"Single"):h.fill.color=k.fill.colorValue(c);for(;this.deleteShape("borderPiece"+l++););}},getBorderSegments:function(c){var a=
this.targetElement,b,d,h,j=this.styleInfos.borderInfo,k=[],l,m,n,p,o=Math.round,q,r,s;if(j.isActive())if(b=j.getProps(),j=b.widths,r=b.styles,s=b.colors,b.widthsSame&&b.stylesSame&&b.colorsSame)s.t.alpha()>0&&(b=j.t.pixels(a),n=b/2,k.push({path:this.getBoxPath({t:n,r:n,b:n,l:n},c),stroke:r.t,color:s.t,weight:b}));else{c=c||1;b=this.boundsInfo.getBounds();d=b.w;h=b.h;b=o(j.t.pixels(a));n=o(j.r.pixels(a));p=o(j.b.pixels(a));var a=o(j.l.pixels(a)),w={t:b,r:n,b:p,l:a},a=this.styleInfos.borderRadiusInfo;
a.isActive()&&(q=this.getRadiiPixels(a.getProps()));l=Math.floor;m=Math.ceil;var u=function(c,a){return q?q[c][a]:0},v=function(a,b,f,g,j,k){var n=u("x",a),o=u("y",a),q=a.charAt(1)==="r",a=a.charAt(0)==="b";return n>0&&o>0?(k?"al":"ae")+(q?m(d-n):l(n))*c+","+(a?m(h-o):l(o))*c+","+(l(n)-b)*c+","+(l(o)-f)*c+","+g*65535+","+2949075*(j?1:-1):(k?"m":"l")+(q?d-b:b)*c+","+(a?h-f:f)*c},C=function(a,b,f,g){var j=a==="t"?l(u("x","tl"))*c+","+m(b)*c:a==="r"?m(d-b)*c+","+l(u("y","tr"))*c:a==="b"?m(d-u("x","br"))*
c+","+l(h-b)*c:l(b)*c+","+m(h-u("y","bl"))*c,a=a==="t"?m(d-u("x","tr"))*c+","+m(b)*c:a==="r"?m(d-b)*c+","+m(h-u("y","br"))*c:a==="b"?l(u("x","bl"))*c+","+l(h-b)*c:l(b)*c+","+l(u("y","tl"))*c;return f?(g?"m"+a:"")+"l"+j:(g?"m"+j:"")+"l"+a},a=function(c,a,b,d,f,g){var i=c==="l"||c==="r",h=w[c],j,n;h>0&&r[c]!=="none"&&s[c].alpha()>0&&(j=w[i?c:a],a=w[i?a:c],n=w[i?c:b],b=w[i?b:c],r[c]==="dashed"||r[c]==="dotted"?(k.push({path:v(d,j,a,g+45,0,1)+v(d,0,0,g,1,0),fill:s[c]}),k.push({path:C(c,h/2,0,1),stroke:r[c],
weight:h,color:s[c]}),k.push({path:v(f,n,b,g,0,1)+v(f,0,0,g-45,1,0),fill:s[c]})):k.push({path:v(d,j,a,g+45,0,1)+C(c,h,0,0)+v(f,n,b,g,0,0)+(r[c]==="double"&&h>2?v(f,n-l(n/3),b-l(b/3),g-45,1,0)+C(c,m(h/3*2),1,0)+v(d,j-l(j/3),a-l(a/3),g,1,0)+"x "+v(d,l(j/3),l(a/3),g+45,0,1)+C(c,l(h/3),1,0)+v(f,l(n/3),l(b/3),g,0,0):"")+v(f,0,0,g-45,1,0)+C(c,0,1,0)+v(d,0,0,g,1,0),fill:s[c]}))};a("t","l","r","tl","tr",90);a("r","t","b","tr","br",0);a("b","r","l","br","bl",-90);a("l","b","t","bl","tl",-180)}return k},destroy:function(){if(this.finalized||
!this.styleInfos.borderImageInfo.isActive())this.targetElement.runtimeStyle.borderColor="";b.RendererBase.destroy.call(this)}});b.BorderImageRenderer=b.RendererBase.newRenderer({boxZIndex:5,pieceNames:["t","tr","r","br","b","bl","l","tl","c"],needsUpdate:function(){return this.styleInfos.borderImageInfo.changed()},isActive:function(){return this.styleInfos.borderImageInfo.isActive()},draw:function(){this.getBox();var c=this.styleInfos.borderImageInfo.getProps(),a=this.styleInfos.borderInfo.getProps(),
d=this.boundsInfo.getBounds(),i=this.targetElement,h=this.pieces;b.Util.withImageSize(c.src,function(j){function k(c,a,b,d,f){var c=h[c].style,g=Math.max;c.width=g(a,0);c.height=g(b,0);c.left=d;c.top=f}function l(c,a,b){for(var d=0,f=c.length;dp/2||t-m>o/2)for(m=4;m--;)r=q[m],J=r.charAt(0)==="b",K=r.charAt(1)==="r",r=c(l,r,v,C,s,t,y),w=r.fill,w.focusposition=(K?1-F:F)+","+(J?1-E:E),w.focussize="0,0",r.style.clip="rect("+((J?I/2:0)+n)+"px,"+(K?H:H/2)+"px,"+(J?I:I/2)+"px,"+((K?H/2:0)+n)+"px)";else r=c(l,"",v,C,s,t,y),w=r.fill,w.focusposition=F+","+E,w.focussize=1-F*2+","+
(1-E*2);else if(r=c(l,"",v,C,s,t,y),v=s.alpha(),v<1)r.fill.opacity=v}}});b.ImgRenderer=b.RendererBase.newRenderer({boxZIndex:6,boxName:"imgEl",needsUpdate:function(){var c=this.styleInfos;return this.targetElement.src!==this._lastSrc||c.borderRadiusInfo.changed()},isActive:function(){var c=this.styleInfos;return c.borderRadiusInfo.isActive()||c.backgroundInfo.isPngFix()},draw:function(){this._lastSrc=k;this.hideActualImg();var c=this.getShape("img","fill",this.getBox()),a=c.fill,d=this.boundsInfo.getBounds(),
i=d.w,d=d.h,h=this.styleInfos.borderInfo.getProps(),j=h&&h.widths,h=this.targetElement,k=h.src,l=Math.round,m=h.currentStyle,n=b.getLength;if(!j||b.ieVersion<7)j=b.getLength("0"),j={t:j,r:j,b:j,l:j};c.stroked=!1;a.type="frame";a.src=k;a.position=(i?0.5/i:0)+","+(d?0.5/d:0);c.coordsize=i*2+","+d*2;c.coordorigin="1,1";c.path=this.getBoxPath({t:l(j.t.pixels(h)+n(m.paddingTop).pixels(h)),r:l(j.r.pixels(h)+n(m.paddingRight).pixels(h)),b:l(j.b.pixels(h)+n(m.paddingBottom).pixels(h)),l:l(j.l.pixels(h)+n(m.paddingLeft).pixels(h))},
2);c=c.style;c.width=i;c.height=d},hideActualImg:function(){this.targetElement.runtimeStyle.filter="alpha(opacity=0)"},destroy:function(){b.RendererBase.destroy.call(this);this.targetElement.runtimeStyle.filter=""}});b.IE9RootRenderer=b.RendererBase.newRenderer({updatePos:b.emptyFn,updateSize:b.emptyFn,updateVisibility:b.emptyFn,updateProps:b.emptyFn,outerCommasRE:/^,+|,+$/g,innerCommasRE:/,+/g,setBackgroundLayer:function(c,a){(this._bgLayers||(this._bgLayers=[]))[c]=a||void 0},finishUpdate:function(){var c=
this._bgLayers,a;if(c&&(a=c.join(",").replace(this.outerCommasRE,"").replace(this.innerCommasRE,","))!==this._lastBg)this._lastBg=this.targetElement.runtimeStyle.background=a},destroy:function(){this.targetElement.runtimeStyle.background="";delete this._bgLayers}});b.IE9BackgroundRenderer=b.RendererBase.newRenderer({bgLayerZIndex:1,needsUpdate:function(){return this.styleInfos.backgroundInfo.changed()},isActive:function(){var c=this.styleInfos;return c.backgroundInfo.isActive()||c.borderImageInfo.isActive()},
draw:function(){var c=this.styleInfos.backgroundInfo.getProps(),a,d,i=0,h,j;if(c){a=[];if(d=c.bgImages)for(;h=d[i++];)h.imgType==="linear-gradient"?(j=this.getBgAreaSize(h.bgOrigin),j=(h.bgSize||b.BgSize.DEFAULT).pixels(this.targetElement,j.w,j.h,j.w,j.h),a.push("url(data:image/svg+xml,"+escape(this.getGradientSvg(h,j.w,j.h))+") "+this.bgPositionToString(h.bgPosition)+" / "+j.w+"px "+j.h+"px "+(h.bgAttachment||"")+" "+(h.bgOrigin||"")+" "+(h.bgClip||""))):a.push(h.origString);c.color&&a.push(c.color.val);
this.parent.setBackgroundLayer(this.bgLayerZIndex,a.join(","))}},bgPositionToString:function(c){return c?c.tokens.map(function(c){return c.tokenValue}).join(" "):"0 0"},getBgAreaSize:function(c){var a=this.targetElement,d=this.boundsInfo.getBounds(),i=d.w,d=d.h,h;if(c!=="border-box"&&(h=this.styleInfos.borderInfo.getProps())&&(h=h.widths))i-=h.l.pixels(a)+h.l.pixels(a),d-=h.t.pixels(a)+h.b.pixels(a);if(c==="content-box")c=b.getLength,h=a.currentStyle,i-=c(h.paddingLeft).pixels(a)+c(h.paddingRight).pixels(a),
d-=c(h.paddingTop).pixels(a)+c(h.paddingBottom).pixels(a);return{w:i,h:d}},getGradientSvg:function(c,a,d){var i=this.targetElement,h=c.stops,j=h.length,k=b.GradientUtil.getGradientMetrics(i,a,d,c),c=k.startX,l=k.startY,m=k.endX,n=k.endY,k=k.lineLength,p,o,q,r,s;p=[];for(o=0;o'];for(o=0;o');a.push('');return a.join("")},destroy:function(){this.parent.setBackgroundLayer(this.bgLayerZIndex)}});b.IE9BorderImageRenderer=b.RendererBase.newRenderer({REPEAT:"repeat",STRETCH:"stretch",ROUND:"round",bgLayerZIndex:0,
needsUpdate:function(){return this.styleInfos.borderImageInfo.changed()},isActive:function(){return this.styleInfos.borderImageInfo.isActive()},draw:function(){var c=this,a=c.styleInfos.borderImageInfo.getProps(),d=c.styleInfos.borderInfo.getProps(),i=c.boundsInfo.getBounds(),h=a.repeat,j=h.h,k=h.v,l=c.targetElement,m=0;b.Util.withImageSize(a.src,function(h){function p(c,a,b,d,f,g,i,h,l,m){N.push('');O.push('');L++}var o=i.w,q=i.h,r=h.w,s=h.h,w=c.imageToDataURI(a.src,r,s),u=c.REPEAT,v=c.STRETCH,h=c.ROUND,C=Math.ceil,t=b.getLength("0"),y=a.widths||(d?d.widths:{t:t,r:t,b:t,l:t}),t=y.t.pixels(l),
H=y.r.pixels(l),I=y.b.pixels(l),y=y.l.pixels(l),F=a.slice,E=F.t.pixels(l),J=F.r.pixels(l),K=F.b.pixels(l),F=F.l.pixels(l),G=o-y-H,M=q-t-I,B=r-F-J,x=s-E-K,A=j===v?G:B*t/E,z=k===v?M:x*H/J,D=j===v?G:B*I/K,v=k===v?M:x*y/F,N=[],O=[],L=0;j===h&&(A-=(A-(G%A||A))/C(G/A),D-=(D-(G%D||D))/C(G/D));k===h&&(z-=(z-(M%z||z))/C(M/z),v-=(v-(M%v||v))/C(M/v));h=['");c.parent.setBackgroundLayer(c.bgLayerZIndex,"url(data:image/svg+xml,"+escape(h.join(""))+") no-repeat border-box border-box");m&&c.parent.finishUpdate()},c);m=1},imageToDataURI:function(){var c={};return function(b,d,i){var h=c[b],
j;if(!h)h=new Image,j=a.createElement("canvas"),h.src=b,j.width=d,j.height=i,j.getContext("2d").drawImage(h,0,0),h=c[b]=j.toDataURL();return h}}(),prepareUpdate:b.BorderImageRenderer.prototype.prepareUpdate,destroy:function(){var c=this.targetElement.runtimeStyle;this.parent.setBackgroundLayer(this.bgLayerZIndex);c.borderColor=c.borderStyle=c.borderWidth=""}});b.Element=function(){function c(c){var a=q.slice.call(arguments,1),b=a.length;setTimeout(function(){for(;b--;)c.className+=" "+a[b]},0)}function d(c){var a=
q.slice.call(arguments,1),b=a.length;setTimeout(function(){for(;b--;){var d=c,f=a[b],f=o[f]||(o[f]=RegExp("\\b"+f+"\\b","g"));d.className=d.className.replace(f,"")}},0)}function g(g){function i(){if(!O){var c,d,f=b.ieDocMode,k=g.currentStyle,l=k.getAttribute(h)==="true";S=k.getAttribute(j);S=f>7?S!=="false":S==="true";if(!N){N=1;g.runtimeStyle.zoom=1;for(var k=g,m=1;k=k.previousSibling;)if(k.nodeType===1){m=0;break}m&&(g.className+=" "+n)}A.lock();if(l&&(d=A.getBounds())&&(c=a.documentElement||a.body)&&
(d.y>c.clientHeight||d.x>c.clientWidth||d.y+d.h<0||d.x+d.w<0))R||(R=1,b.OnScroll.observe(i));else{O=1;R=N=0;b.OnScroll.unobserve(i);f===9?(z={backgroundInfo:new b.BackgroundStyleInfo(g),borderImageInfo:new b.BorderImageStyleInfo(g),borderInfo:new b.BorderStyleInfo(g)},D=[z.backgroundInfo,z.borderImageInfo],x=new b.IE9RootRenderer(g,A,z),c=[new b.IE9BackgroundRenderer(g,A,z,x),new b.IE9BorderImageRenderer(g,A,z,x)]):(z={backgroundInfo:new b.BackgroundStyleInfo(g),borderInfo:new b.BorderStyleInfo(g),
borderImageInfo:new b.BorderImageStyleInfo(g),borderRadiusInfo:new b.BorderRadiusStyleInfo(g),boxShadowInfo:new b.BoxShadowStyleInfo(g),visibilityInfo:new b.VisibilityStyleInfo(g)},D=[z.backgroundInfo,z.borderInfo,z.borderImageInfo,z.borderRadiusInfo,z.boxShadowInfo,z.visibilityInfo],x=new b.RootRenderer(g,A,z),c=[new b.BoxShadowOutsetRenderer(g,A,z,x),new b.BackgroundRenderer(g,A,z,x),new b.BorderRenderer(g,A,z,x),new b.BorderImageRenderer(g,A,z,x)],g.tagName==="IMG"&&c.push(new b.ImgRenderer(g,
A,z,x)),x.childRenderers=c);B=[x].concat(c);if(c=g.currentStyle.getAttribute(b.CSS_PREFIX+"watch-ancestors")){c=parseInt(c,10);d=0;for(l=g.parentNode;l&&(c==="NaN"||d++