<!--
PIE: CSS3 rendering for IE
Version 1.0beta2
http://css3pie.com
Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2.

NOTE:
This file differs from the released version as it has been modified by Terabyte to not show VML in IE print preview/print styles
For more information see this thread: http://css3pie.com/forum/viewtopic.php?f=3&t=162&start=0&hilit=print
Modified by Pat O'Callaghan (pat@terabyte.co.nz) 20th September 2010
-->
<PUBLIC:COMPONENT lightWeight="true">
    <PUBLIC:ATTACH EVENT="onresize" FOR="element" ONEVENT="update()" />
    <PUBLIC:ATTACH EVENT="onresize" FOR="window" ONEVENT="update()" />
    <PUBLIC:ATTACH EVENT="onmove" FOR="element" ONEVENT="update()" />
    <PUBLIC:ATTACH EVENT="onpropertychange" FOR="element" ONEVENT="propChanged()" />
    <PUBLIC:ATTACH EVENT="onmouseenter" FOR="element" ONEVENT="mouseEntered()" />
    <PUBLIC:ATTACH EVENT="onmouseleave" FOR="element" ONEVENT="mouseLeft()" />
    <PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="update()" />
    <PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="update()" />
    <PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" />

    <script type="text/javascript">
    	var PIE = window.PIE; if (!PIE) { PIE = window.PIE = { CSS_PREFIX: "-pie-", STYLE_PREFIX: "Pie", CLASS_PREFIX: "pie_" }; if (!window.XMLHttpRequest) { PIE.isIE6 = true; PIE.CSS_PREFIX = PIE.CSS_PREFIX.replace(/^-/, "") } PIE.ie8DocMode = element.document.documentMode; PIE.isIE8 = !!PIE.ie8DocMode; if (PIE.ie8DocMode === 8) { PIE.ie8Poller = { fns: {}, add: function (a) { var b = a.id || (a.id = "" + new Date().getTime() + Math.random()); this.fns[b] = a }, remove: function (a) { delete this.fns[a.id] }, fire: function () { var a = this.fns, b; for (b in a) { if (a.hasOwnProperty(b)) { a[b]() } } } }; setInterval(function () { PIE.ie8Poller.fire() }, 250) } PIE.Util = { createVmlElement: function (a) { var b = "css3vml", c = PIE._vmlCreatorDoc; if (!c) { c = PIE._vmlCreatorDoc = element.document.createDocumentFragment(); c.namespaces.add(b, "urn:schemas-microsoft-com:vml") } vmlContainer = c.createElement(b + ":" + a); vmlContainer.print = "false"; return vmlContainer }, merge: function (f) { var d, a, e, b, c = arguments; for (d = 1, a = c.length; d < a; d++) { b = c[d]; for (e in b) { if (b.hasOwnProperty(e)) { f[e] = b[e] } } } return f }, withImageSize: function (f, e, a) { var d = PIE._imgSizes || (PIE._imgSizes = {}), c = d[f], b; if (c) { e.call(a, c) } else { b = new Image(); b.onload = function () { c = d[f] = { w: b.width, h: b.height }; e.call(a, c); b.onload = null }; b.src = f } } }; PIE.Length = (function () { function a(b) { this.val = b } a.prototype = { unitRE: /(px|em|ex|mm|cm|in|pt|pc|%)$/, getNumber: function () { var b = this._number; if (b === undefined) { b = this._number = parseFloat(this.val) } return b }, getUnit: function () { var c = this._unit, b; if (!c) { b = this.val.match(this.unitRE); c = this._unit = (b && b[0]) || "px" } return c }, isPercentage: function () { return this.getUnit() === "%" }, pixels: function (c, e) { var b = this.getNumber(), d = this.getUnit(); switch (d) { case "px": return b; case "%": return b * (typeof e === "function" ? e() : e) / 100; case "em": return b * this.getEmPixels(c); case "ex": return b * this.getEmPixels(c) / 2; default: return b * a.conversions[d] } }, getEmPixels: function (f) { var b = f.currentStyle.fontSize, c, e, d; if (b.indexOf("px") > 0) { return parseFloat(b) } else { c = this._tester; if (!c) { c = this._tester = f.document.createElement("length-calc"); e = c.style; e.width = "1em"; e.position = "absolute"; e.top = e.left = -9999 } f.appendChild(c); d = c.offsetWidth; f.removeChild(c); return d } } }; a.conversions = (function () { var c = ["mm", "cm", "in", "pt", "pc"], j = {}, g = element.parentNode, d = 0, b = c.length, h, f, e; for (; d < b; d++) { h = c[d]; f = element.document.createElement("length-calc"); e = f.style; e.position = "absolute"; e.top = e.left = -9999; e.width = "100" + h; g.appendChild(f); j[h] = f.offsetWidth / 100; g.removeChild(f) } return j })(); a.ZERO = new a("0"); return a })(); PIE.BgPosition = (function () { function a(b) { this.tokens = b } a.prototype = { getValues: function () { if (!this._values) { var i = this.tokens, g = i.length, f = PIE.Length.ZERO, m = new PIE.Length("50%"), c = PIE.Tokenizer.Type.IDENT, e = PIE.Tokenizer.Type.LENGTH, d = PIE.Tokenizer.Type.PERCENT, j, l, b = { top: 1, center: 1, bottom: 1 }, h = { left: 1, center: 1, right: 1 }, k = ["left", f, "top", f]; if (g === 1) { i.push({ type: c, value: "center" }); g++ } if (g === 2) { if (c & (i[0].type | i[1].type) && i[0].value in b && i[1].value in h) { i.push(i.shift()) } if (i[0].type & c) { if (i[0].value === "center") { k[1] = m } else { k[0] = i[0].value } } else { if (i[0].isLengthOrPercent()) { k[1] = new PIE.Length(i[0].value) } } if (i[1].type & c) { if (i[1].value === "center") { k[3] = m } else { k[2] = i[1].value } } else { if (i[1].isLengthOrPercent()) { k[3] = new PIE.Length(i[1].value) } } } else { } this._values = k } return this._values }, coords: function (e, d, c) { var f = this.getValues(), b = f[1].pixels(e, d), g = f[3].pixels(e, c); return { x: Math.round(f[0] === "right" ? d - b : b), y: Math.round(f[2] === "bottom" ? c - g : g)} } }; return a })(); PIE.Angle = (function () { function a(b) { this.val = b } a.prototype = { unitRE: /[a-z]+$/i, getUnit: function () { return this._unit || (this._unit = this.val.match(this.unitRE)[0].toLowerCase()) }, degrees: function () { var c = this._deg, b, d; if (c === undefined) { b = this.getUnit(); d = parseFloat(this.val, 10); c = this._deg = (b === "deg" ? d : b === "rad" ? d / Math.PI * 180 : b === "grad" ? d / 400 * 360 : b === "turn" ? d * 360 : 0) } return c } }; return a })(); PIE.Color = (function () { function a(b) { this.val = b } a.rgbaRE = /\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/; a.prototype = { parse: function () { if (!this._color) { var c = this.val, b = c.match(a.rgbaRE); if (b) { this._color = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")"; this._alpha = parseFloat(b[4]) } else { this._color = c; this._alpha = 1 } } }, value: function (b) { this.parse(); return this._color === "currentColor" ? b.currentStyle.color : this._color }, alpha: function () { this.parse(); return this._alpha } }; return a })(); PIE.Tokenizer = (function () { function b(c) { this.css = c; this.ch = 0; this.tokens = []; this.tokenIndex = 0 } var a = b.Type = { ANGLE: 1, CHARACTER: 2, COLOR: 4, DIMEN: 8, FUNCTION: 16, IDENT: 32, LENGTH: 64, NUMBER: 128, OPERATOR: 256, PERCENT: 512, STRING: 1024, URL: 2048 }; b.Token = function (c, d) { this.type = c; this.value = d }; b.Token.prototype = { isLength: function () { return this.type & a.LENGTH || (this.type & a.NUMBER && this.value === "0") }, isLengthOrPercent: function () { return this.isLength() || this.type & a.PERCENT } }; b.prototype = { whitespace: /\s/, number: /^[\+\-]?(\d*\.)?\d+/, url: /^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i, ident: /^\-?[_a-z][\w-]*/i, string: /^("([^"]*)"|'([^']*)')/, operator: /^[\/,]/, hash: /^#[\w]+/, hashColor: /^#([\da-f]{6}|[\da-f]{3})/i, unitTypes: { px: a.LENGTH, em: a.LENGTH, ex: a.LENGTH, mm: a.LENGTH, cm: a.LENGTH, "in": a.LENGTH, pt: a.LENGTH, pc: a.LENGTH, deg: a.ANGLE, rad: a.ANGLE, grad: a.ANGLE }, colorNames: { aqua: 1, black: 1, blue: 1, fuchsia: 1, gray: 1, green: 1, lime: 1, maroon: 1, navy: 1, olive: 1, purple: 1, red: 1, silver: 1, teal: 1, white: 1, yellow: 1, currentColor: 1 }, colorFunctions: { rgb: 1, rgba: 1, hsl: 1, hsla: 1 }, next: function (e) { var k, d, p, j, n, g, m = this; function l(r, s) { var q = new b.Token(r, s); if (!e) { m.tokens.push(q); m.tokenIndex++ } return q } function f() { m.tokenIndex++; return null } if (this.tokenIndex < this.tokens.length) { return this.tokens[this.tokenIndex++] } while (this.whitespace.test(this.css.charAt(this.ch))) { this.ch++ } if (this.ch >= this.css.length) { return f() } d = this.ch; k = this.css.substring(this.ch); p = k.charAt(0); switch (p) { case "#": if (j = k.match(this.hashColor)) { this.ch += j[0].length; return l(a.COLOR, j[0]) } break; case '"': case "'": if (j = k.match(this.string)) { this.ch += j[0].length; return l(a.STRING, j[2] || j[3] || "") } break; case "/": case ",": this.ch++; return l(a.OPERATOR, p); case "u": if (j = k.match(this.url)) { this.ch += j[0].length; return l(a.URL, j[2] || j[3] || j[4] || "") } } if (j = k.match(this.number)) { g = j[0]; this.ch += g.length; if (k.charAt(g.length) === "%") { this.ch++; return l(a.PERCENT, g + "%") } if (j = k.substring(g.length).match(this.ident)) { g += j[0]; this.ch += j[0].length; return l(this.unitTypes[j[0].toLowerCase()] || a.DIMEN, g) } return l(a.NUMBER, g) } if (j = k.match(this.ident)) { g = j[0]; this.ch += g.length; if (g.toLowerCase() in this.colorNames) { return l(a.COLOR, g) } if (k.charAt(g.length) === "(") { this.ch++; if (g.toLowerCase() in this.colorFunctions) { function h(q) { return q && q.type & a.NUMBER } function c(q) { return q && (q.type & (a.NUMBER | a.PERCENT)) } function o(q, r) { return q && q.value === r } function i() { return m.next(1) } if ((g.charAt(0) === "r" ? c(i()) : h(i())) && o(i(), ",") && c(i()) && o(i(), ",") && c(i()) && (g === "rgb" || g === "hsa" || (o(i(), ",") && h(i()))) && o(i(), ")")) { return l(a.COLOR, this.css.substring(d, this.ch)) } return f() } return l(a.FUNCTION, g + "(") } return l(a.IDENT, g) } this.ch++; return l(a.CHARACTER, p) }, hasNext: function () { var c = this.next(); this.prev(); return !!c }, prev: function () { return this.tokens[this.tokenIndex-- - 2] }, all: function () { while (this.next()) { } return this.tokens }, until: function (e, c) { var g = [], d, f; while (d = this.next()) { if (e(d)) { f = true; this.prev(); break } g.push(d) } return c && !f ? null : g } }; return b })(); PIE.StyleInfoBase = { newStyleInfo: function (a) { function b(c) { this.element = c } PIE.Util.merge(b.prototype, PIE.StyleInfoBase, a); return b }, getProps: function () { if (this.changed()) { this._props = this.parseCss(this._css = this.getCss()) } return this._props }, getCss: function () { var d = this.element, c = d.style, b = d.currentStyle, e = this.cssProperty, a = this.styleProperty, f = this._prefixedCssProp || (this._prefixedCssProp = PIE.CSS_PREFIX + e), g = this._prefixedStyleProp || (this._prefixedStyleProp = PIE.STYLE_PREFIX + a.charAt(0).toUpperCase() + a.substring(1)); return c[g] || b.getAttribute(f) || c[a] || b.getAttribute(e) }, isActive: function () { return !!this.getProps() }, changed: function () { return this._css !== this.getCss() } }; PIE.BackgroundStyleInfo = PIE.StyleInfoBase.newStyleInfo({ cssProperty: PIE.CSS_PREFIX + "background", styleProperty: PIE.STYLE_PREFIX + "Background", attachIdents: { scroll: 1, fixed: 1, local: 1 }, repeatIdents: { "repeat-x": 1, "repeat-y": 1, repeat: 1, "no-repeat": 1 }, originIdents: { "padding-box": 1, "border-box": 1, "content-box": 1 }, clipIdents: { "padding-box": 1, "border-box": 1 }, positionIdents: { top: 1, right: 1, bottom: 1, left: 1, center: 1 }, sizeIdents: { contain: 1, cover: 1 }, parseCss: function (h) { var b = this.element, d = b.currentStyle, g = b.runtimeStyle, k, f, l, o = PIE.Tokenizer.Type, n = o.OPERATOR, p = o.IDENT, r = o.COLOR, j, s, i = this.positionIdents, a, q, c = null; function m(t) { return t.isLengthOrPercent() || (t.type & p && t.value in i) } function e(t) { return (t.isLengthOrPercent() && new PIE.Length(t.value)) || (t.value === "auto" && "auto") } if (this.getCss3()) { k = new PIE.Tokenizer(h); c = { images: [] }; l = {}; while (f = k.next()) { j = f.type; s = f.value; if (!l.type && j & o.FUNCTION && s === "linear-gradient(") { a = { stops: [], type: "linear-gradient" }; q = {}; while (f = k.next()) { j = f.type; s = f.value; if (j & o.CHARACTER && s === ")") { if (q.color) { a.stops.push(q) } if (a.stops.length > 1) { PIE.Util.merge(l, a) } break } if (j & r) { if (a.angle || a.gradientStart) { f = k.prev(); if (f.type !== n) { break } k.next() } q = { color: new PIE.Color(s) }; f = k.next(); if (f.isLengthOrPercent()) { q.offset = new PIE.Length(f.value) } else { k.prev() } } else { if (j & o.ANGLE && !a.angle && !q.color && !a.stops.length) { a.angle = new PIE.Angle(f.value) } else { if (m(f) && !a.gradientStart && !q.color && !a.stops.length) { k.prev(); a.gradientStart = new PIE.BgPosition(k.until(function (u) { return !m(u) }, false)) } else { if (j & n && s === ",") { if (q.color) { a.stops.push(q); q = {} } } else { break } } } } } } else { if (!l.type && j & o.URL) { l.url = s; l.type = "image" } else { if (m(f) && !l.size) { k.prev(); l.position = new PIE.BgPosition(k.until(function (u) { return !m(u) }, false)) } else { if (j & p) { if (s in this.repeatIdents) { l.repeat = s } else { if (s in this.originIdents) { l.origin = s; if (s in this.clipIdents) { l.clip = s } } else { if (s in this.attachIdents) { l.attachment = s } } } } else { if (j & r && !c.color) { c.color = new PIE.Color(s) } else { if (j & n) { if (s === "/") { f = k.next(); j = f.type; s = f.value; if (j & p && s in this.sizeIdents) { l.size = s } else { if (s = e(f)) { l.size = { w: s, h: e(k.next()) || (k.prev() && s)} } } } else { if (s === "," && l.type) { c.images.push(l); l = {} } } } else { return null } } } } } } } if (l.type) { c.images.push(l) } } else { this.withActualBg(function () { var w = d.backgroundPositionX, v = d.backgroundPositionY, u = d.backgroundImage, t = d.backgroundColor; c = {}; if (t !== "transparent") { c.color = new PIE.Color(t) } if (u !== "none") { c.images = [{ type: "image", url: new PIE.Tokenizer(u).next().value, repeat: d.backgroundRepeat, position: new PIE.BgPosition(new PIE.Tokenizer(w + " " + v).all())}] } }) } return c }, withActualBg: function (d) { var a = this.element.runtimeStyle, c = a.backgroundImage, e = a.backgroundColor, b; a.backgroundImage = a.backgroundColor = ""; b = d.call(this); a.backgroundImage = c; a.backgroundColor = e; return b }, getCss: function () { var a = this.element.currentStyle; return this.getCss3() || this.withActualBg(function () { return a.backgroundColor + " " + a.backgroundImage + " " + a.backgroundRepeat + " " + a.backgroundPositionX + " " + a.backgroundPositionY }) }, getCss3: function () { var a = this.element; return a.style[this.styleProperty] || a.currentStyle.getAttribute(this.cssProperty) }, isActive: function () { return this.getCss3() && !!this.getProps() } }); PIE.BorderStyleInfo = PIE.StyleInfoBase.newStyleInfo({ sides: ["Top", "Right", "Bottom", "Left"], namedWidths: { thin: "1px", medium: "3px", thick: "5px" }, parseCss: function (d) { var a = {}, f = {}, i = {}, g = false, e = true, b = true, h = true; this.withActualBorder(function () { var n = this.element, r = n.currentStyle, q = 0, k, p, l, c, o, j, s, m; for (; q < 4; q++) { s = this.sides[q]; m = s.charAt(0).toLowerCase(); k = f[m] = r["border" + s + "Style"]; p = r["border" + s + "Color"]; l = r["border" + s + "Width"]; if (q > 0) { if (k !== c) { b = false } if (p !== o) { e = false } if (l !== j) { h = false } } c = k; o = p; j = l; i[m] = new PIE.Color(p); l = a[m] = new PIE.Length(f[m] === "none" ? "0" : (this.namedWidths[l] || l)); if (l.pixels(this.element) > 0) { g = true } } }); return g ? { widths: a, styles: f, colors: i, widthsSame: h, colorsSame: e, stylesSame: b} : null }, getCss: function () { var c = this.element, b = c.currentStyle, a; this.withActualBorder(function () { a = b.borderWidth + "|" + b.borderStyle + "|" + b.borderColor }); return a }, withActualBorder: function (e) { var c = this.element.runtimeStyle, b = c.borderWidth, a = c.borderStyle, f = c.borderColor, d; c.borderWidth = c.borderStyle = c.borderColor = ""; d = e.call(this); c.borderWidth = b; c.borderStyle = a; c.borderColor = f; return d } }); (function () { PIE.BorderRadiusStyleInfo = PIE.StyleInfoBase.newStyleInfo({ cssProperty: "border-radius", styleProperty: "borderRadius", parseCss: function (h) { var c = null, k, i, l, g, d, j = false; function f(m) { return new PIE.Length(m) } if (h) { l = new PIE.Tokenizer(h); function e() { var m = [], n; while ((g = l.next()) && g.isLengthOrPercent()) { d = f(g.value); n = d.getNumber(); if (n < 0) { return null } if (n > 0) { j = true } m.push(d) } return m.length > 0 && m.length < 5 ? { tl: m[0], tr: m[1] || m[0], br: m[2] || m[0], bl: m[3] || m[1] || m[0]} : null } if (k = e()) { if (g) { if (g.type & PIE.Tokenizer.Type.OPERATOR && g.value === "/") { i = e() } } else { i = k } if (j && k && i) { c = { x: k, y: i} } } } return c } }); var a = PIE.Length.ZERO, b = { tl: a, tr: a, br: a, bl: a }; PIE.BorderRadiusStyleInfo.ALL_ZERO = { x: b, y: b} })(); PIE.BorderImageStyleInfo = PIE.StyleInfoBase.newStyleInfo({ cssProperty: "border-image", styleProperty: "borderImage", repeatIdents: { stretch: 1, round: 1, repeat: 1, space: 1 }, parseCss: function (k) { var n = null, m, h, e, q, a, j, t, g = 0, f, i = PIE.Tokenizer.Type, c = i.IDENT, l = i.NUMBER, r = i.LENGTH, b = i.PERCENT; if (k) { m = new PIE.Tokenizer(k); n = {}; function s(p) { return p && (p.type & i.OPERATOR) && (p.value === "/") } function u(p) { return p && (p.type & c) && (p.value === "fill") } function o() { a = m.until(function (p) { return !(p.type & (l | b)) }); if (u(m.next()) && !n.fill) { n.fill = true } else { m.prev() } if (s(m.next())) { g++; j = m.until(function (p) { return !(h.type & (l | b | r)) && !((h.type & c) && h.value === "auto") }); if (s(m.next())) { g++; t = m.until(function (p) { return !(h.type & (l | r)) }) } } else { m.prev() } } while (h = m.next()) { e = h.type; q = h.value; if (e & (l | b) && !a) { m.prev(); o() } else { if (u(h) && !n.fill) { n.fill = true; o() } else { if ((e & c) && this.repeatIdents[q] && !n.repeat) { n.repeat = { h: q }; if (h = m.next()) { if ((h.type & c) && this.repeatIdents[h.value]) { n.repeat.v = h.value } else { m.prev() } } } else { if ((e & i.URL) && !n.src) { n.src = q } else { return null } } } } } if (!n.src || !a || a.length < 1 || a.length > 4 || (j && j.length > 4) || (g === 1 && j.length < 1) || (t && t.length > 4) || (g === 2 && t.length < 1)) { return null } if (!n.repeat) { n.repeat = { h: "stretch"} } if (!n.repeat.v) { n.repeat.v = n.repeat.h } function d(v, p) { return { t: p(v[0]), r: p(v[1] || v[0]), b: p(v[2] || v[0]), l: p(v[3] || v[1] || v[0])} } n.slice = d(a, function (p) { return new PIE.Length((p.type & l) ? p.value + "px" : p.value) }); n.width = j && j.length > 0 ? d(j, function (p) { return p.type & (r | b) ? new PIE.Length(p.value) : p.value }) : (f = this.element.currentStyle) && { t: new PIE.Length(f.borderTopWidth), r: new PIE.Length(f.borderRightWidth), b: new PIE.Length(f.borderBottomWidth), l: new PIE.Length(f.borderLeftWidth) }; n.outset = d(t || [0], function (p) { return p.type & r ? new PIE.Length(p.value) : p.value }) } return n } }); PIE.BoxShadowStyleInfo = PIE.StyleInfoBase.newStyleInfo({ cssProperty: "box-shadow", styleProperty: "boxShadow", parseCss: function (c) { var f, e = PIE.Length, b = PIE.Tokenizer.Type, d; if (c) { d = new PIE.Tokenizer(c); f = { outset: [], inset: [] }; function a() { var j, k, l, i, m, h, g; while (j = d.next()) { l = j.value; k = j.type; if (k & b.OPERATOR && l === ",") { break } else { if (j.isLength() && !m) { d.prev(); m = d.until(function (n) { return !n.isLength() }) } else { if (k & b.COLOR && !i) { i = l } else { if (k & b.IDENT && l === "inset" && !h) { h = true } else { return false } } } } } g = m && m.length; if (g > 1 && g < 5) { (h ? f.inset : f.outset).push({ xOffset: new e(m[0].value), yOffset: new e(m[1].value), blur: new e(m[2] ? m[2].value : "0"), spread: new e(m[3] ? m[3].value : "0"), color: new PIE.Color(i || "currentColor") }); return true } return false } while (a()) { } } return f && (f.inset.length || f.outset.length) ? f : null } }); PIE.VisibilityStyleInfo = PIE.StyleInfoBase.newStyleInfo({ getCss: function () { var a = this.element.currentStyle; return a.visibility + "|" + a.display }, parseCss: function () { var d = this.element, b = d.runtimeStyle, c = d.currentStyle, a = b.visibility, e; b.visibility = ""; e = c.visibility; b.visibility = a; return { visible: e !== "hidden", displayed: c.display !== "none"} }, isActive: function () { return false } }); PIE.RendererBase = { newRenderer: function (a) { function b(e, c, d) { this.element = e; this.styleInfos = c; this.parent = d } PIE.Util.merge(b.prototype, PIE.RendererBase, a); return b }, needsUpdate: function () { return false }, updateProps: function () { }, updatePos: function () { }, updateSize: function () { }, addLayer: function (b, e) { this.removeLayer(b); for (var f = this._layers || (this._layers = []), d = b + 1, a = f.length, c; d < a; d++) { c = f[d]; if (c) { break } } f[b] = e; this.getBox().insertBefore(e, c || null) }, getLayer: function (a) { var b = this._layers; return b && b[a] || null }, removeLayer: function (a) { var b = this.getLayer(a), c = this._box; if (b && c) { c.removeChild(b); this._layers[a] = null } }, getShape: function (c, g, e, f) { var a = this._shapes || (this._shapes = {}), b = a[c], d; if (!b) { b = a[c] = PIE.Util.createVmlElement("shape"); if (g) { b.appendChild(b[g] = PIE.Util.createVmlElement(g)) } if (f) { e = this.getLayer(f); if (!e) { this.addLayer(f, this.element.document.createElement("group" + f)); e = this.getLayer(f) } } e.appendChild(b); d = b.style; d.position = "absolute"; d.left = d.top = 0; d.behavior = "url(#default#VML)" } return b }, deleteShape: function (c) { var a = this._shapes, b = a && a[c]; if (b) { b.parentNode.removeChild(b); delete a[c] } return !!b }, getRadiiPixels: function (b) { var a = this.element, m = a.offsetWidth, c = a.offsetHeight, l, j, g, e, k, i, o, n, d; l = b.x.tl.pixels(a, m); j = b.y.tl.pixels(a, c); g = b.x.tr.pixels(a, m); e = b.y.tr.pixels(a, c); k = b.x.br.pixels(a, m); i = b.y.br.pixels(a, c); o = b.x.bl.pixels(a, m); n = b.y.bl.pixels(a, c); d = Math.min(m / (l + g), c / (e + i), m / (o + k), c / (j + n)); if (d < 1) { l *= d; j *= d; g *= d; e *= d; k *= d; i *= d; o *= d; n *= d } return { x: { tl: l, tr: g, br: k, bl: o }, y: { tl: j, tr: e, br: i, bl: n}} }, getBoxPath: function (q, l, t) { l = l || 1; var s, u, f = this.element, o = f.offsetWidth * l, z = f.offsetHeight * l, x = this.styleInfos.borderRadiusInfo, y = Math.floor, b = Math.ceil, m = q ? q.t * l : 0, n = q ? q.r * l : 0, v = q ? q.b * l : 0, p = q ? q.l * l : 0, c, a, i, e, k, j, g, d; if (t || x.isActive()) { s = this.getRadiiPixels(t || x.getProps()); c = s.x.tl * l; a = s.y.tl * l; i = s.x.tr * l; e = s.y.tr * l; k = s.x.br * l; j = s.y.br * l; g = s.x.bl * l; d = s.y.bl * l; u = "m" + y(p) + "," + y(a) + "qy" + y(c) + "," + y(m) + "l" + b(o - i) + "," + y(m) + "qx" + b(o - n) + "," + y(e) + "l" + b(o - n) + "," + b(z - j) + "qy" + b(o - k) + "," + b(z - v) + "l" + y(g) + "," + b(z - v) + "qx" + y(p) + "," + b(z - d) + " x e" } else { u = "m" + y(p) + "," + y(m) + "l" + b(o - n) + "," + y(m) + "l" + b(o - n) + "," + b(z - v) + "l" + y(p) + "," + b(z - v) + "xe" } return u }, getBox: function () { var b = this.parent.getLayer(this.zIndex), a; if (!b) { b = this.element.document.createElement(this.boxName); a = b.style; a.position = "absolute"; a.top = a.left = 0; this.parent.addLayer(this.zIndex, b) } return b }, destroy: function () { this.parent.removeLayer(this.zIndex); delete this._shapes; delete this._layers } }; PIE.RootRenderer = PIE.RendererBase.newRenderer({ isActive: function () { var b = this.styleInfos; for (var a in b) { if (b.hasOwnProperty(a) && b[a].isActive()) { return true } } return false }, needsUpdate: function () { return this.styleInfos.visibilityInfo.changed() }, updatePos: function () { if (this.isActive()) { var b = this.element, e = b, a, f, d, i = this.getBox().style, c, h = 0, g = 0; do { e = e.offsetParent } while (e && e.currentStyle.position === "static"); f = b.getBoundingClientRect(); if (e) { d = e.getBoundingClientRect(); c = e.currentStyle; h = f.left - d.left - (parseFloat(c.borderLeftWidth) || 0); g = f.top - d.top - (parseFloat(c.borderTopWidth) || 0) } else { a = b.document.documentElement; h = f.left + a.scrollLeft - a.clientLeft; g = f.top + a.scrollTop - a.clientTop } i.left = h; i.top = g; i.zIndex = b.currentStyle.position === "static" ? -1 : b.currentStyle.zIndex } }, updateSize: function () { }, updateVisibility: function () { var a = this.styleInfos.visibilityInfo.getProps(); this.getBox().style.display = (a.visible && a.displayed) ? "" : "none" }, updateProps: function () { if (this.isActive()) { this.updateVisibility() } else { this.destroy() } }, getBox: function () { var c = this._box, b, a; if (!c) { b = this.element; c = this._box = b.document.createElement("css3-container"); a = c.style; a.position = b.currentStyle.position === "fixed" ? "fixed" : "absolute"; this.updateVisibility(); b.parentNode.insertBefore(c, b) } return c }, destroy: function () { var a = this._box; if (a && a.parentNode) { a.parentNode.removeChild(a) } delete this._box; delete this._layers } }); PIE.BackgroundRenderer = PIE.RendererBase.newRenderer({ zIndex: 2, boxName: "background", needsUpdate: function () { var a = this.styleInfos; return a.backgroundInfo.changed() || a.borderRadiusInfo.changed() }, isActive: function () { var a = this.styleInfos, b = this.element; return b.offsetWidth && b.offsetHeight && (a.borderImageInfo.isActive() || a.borderRadiusInfo.isActive() || a.backgroundInfo.isActive() || (a.boxShadowInfo.isActive() && a.boxShadowInfo.getProps().inset)) }, updateSize: function () { if (this.isActive()) { this.draw() } }, updateProps: function () { this.destroy(); if (this.isActive()) { this.draw() } }, draw: function () { this.drawBgColor(); this.drawBgImages() }, drawBgColor: function () { var g = this.styleInfos.backgroundInfo.getProps(), f = this.element, c = g && g.color && g.color.value(f), b, a, e, d, i; if (c && c !== "transparent") { this.hideBackground(); b = this.getShape("bgColor", "fill", this.getBox(), 1); a = f.offsetWidth; e = f.offsetHeight; b.stroked = false; b.coordsize = a * 2 + "," + e * 2; b.coordorigin = "1,1"; b.path = this.getBoxPath(null, 2); d = b.style; d.width = a; d.height = e; b.fill.color = c; i = g.color.alpha(); if (i < 1) { b.fill.opacity = i } } else { this.deleteShape("bgColor") } }, drawBgImages: function () { var f = this.styleInfos.backgroundInfo.getProps(), g = f && f.images, c, a, e, j, d, k, b; if (g) { this.hideBackground(); a = this.element; j = a.offsetWidth, d = a.offsetHeight, b = g.length; while (b--) { c = g[b]; e = this.getShape("bgImage" + b, "fill", this.getBox(), 2); e.stroked = false; e.fill.type = "tile"; e.fillcolor = "none"; e.coordsize = j * 2 + "," + d * 2; e.coordorigin = "1,1"; e.path = this.getBoxPath(0, 2); k = e.style; k.width = j; k.height = d; if (c.type === "linear-gradient") { this.addLinearGradient(e, c) } else { e.fill.src = c.url; this.positionBgImage(e, b) } } } b = g ? g.length : 0; while (this.deleteShape("bgImage" + b++)) { } }, positionBgImage: function (a, b) { PIE.Util.withImageSize(a.fill.src, function (m) { var p = a.fill, c = this.element, r = c.offsetWidth, e = c.offsetHeight, g = c.currentStyle, u = this.styleInfos, o = u.borderInfo.getProps(), s = o && o.widths, w = s ? s.t.pixels(c) : 0, y = s ? s.r.pixels(c) : 0, i = s ? s.b.pixels(c) : 0, d = s ? s.l.pixels(c) : 0, f = u.backgroundInfo.getProps().images[b], j = f.position ? f.position.coords(c, r - m.w - d - y, e - m.h - w - i) : { x: 0, y: 0 }, k = f.repeat, v, t, l = 0, q = 0, n = r + 1, x = e + 1, h = PIE.isIE8 ? 0 : 1; v = j.x + d + 0.5; t = j.y + w + 0.5; p.position = (v / r) + "," + (t / e); if (k && k !== "repeat") { if (k === "repeat-x" || k === "no-repeat") { l = t + 1; x = t + m.h + h } if (k === "repeat-y" || k === "no-repeat") { q = v + 1; n = v + m.w + h } a.style.clip = "rect(" + l + "px," + n + "px," + x + "px," + q + "px)" } }, this) }, addLinearGradient: function (s, L) { var K = this.element, D = K.offsetWidth, J = K.offsetHeight, n = s.fill, r = L.angle, c = L.gradientStart, z = L.stops, B = z.length, d = Math.PI, y, v, f, e, O, N, k, g, t, a, o, m, l, G, F, b, E, I, H, A, C; function x(j, T, w, h, S) { if (w === 0 || w === 180) { return [h, T] } else { if (w === 90 || w === 270) { return [j, S] } else { var p = Math.tan(-w * d / 180), Q = p * j - T, i = -1 / p, P = i * h - S, R = i - p, V = (P - Q) / R, U = (p * P - i * Q) / R; return [V, U] } } } function q() { O = (r >= 90 && r < 270) ? D : 0; N = r < 180 ? J : 0; k = D - O; g = J - N } function M() { if (r < 0) { r += 360 } r = r % 360 } function u(p, j) { var i = j[0] - p[0], h = j[1] - p[1]; return Math.abs(i === 0 ? h : h === 0 ? i : Math.sqrt(i * i + h * h)) } if (c) { c = c.coords(K, D, J); y = c.x; v = c.y } if (r) { r = r.degrees(); M(); q(); if (!c) { y = O; v = N } E = x(y, v, r, k, g); f = E[0]; e = E[1] } else { if (c) { f = D - y; e = J - v } else { y = v = f = 0; e = J } } m = f - y; l = e - v; if (r === undefined) { r = -Math.atan2(l, m) / d * 180; M(); q() } t = Math.atan2(m * D / J, l) / d * 180; t += 180; t = t % 360; G = u([y, v], [f, e]); a = u([O, N], x(O, N, r, k, g)); o = []; b = u([y, v], x(y, v, r, O, N)) / a * 100; F = []; for (I = 0; I < B; I++) { F.push(z[I].offset ? z[I].offset.pixels(K, G) : I === 0 ? 0 : I === B - 1 ? G : null) } for (I = 1; I < B; I++) { if (F[I] === null) { A = F[I - 1]; H = I; do { C = F[++H] } while (C === null); F[I] = A + (C - A) / (H - I + 1) } F[I] = Math.max(F[I], F[I - 1]) } for (I = 0; I < B; I++) { o.push((b + (F[I] / a * 100)) + "% " + z[I].color.value(K)) } n.angle = t; n.type = "gradient"; n.method = "sigma"; n.color = z[0].color.value(K); n.color2 = z[B - 1].color.value(K); n.colors.value = o.join(",") }, hideBackground: function () { var a = this.element.runtimeStyle; a.backgroundImage = "url(about:blank)"; a.backgroundColor = "transparent" }, destroy: function () { PIE.RendererBase.destroy.call(this); var a = this.element.runtimeStyle; a.backgroundImage = a.backgroundColor = "" } }); PIE.BorderRenderer = PIE.RendererBase.newRenderer({ zIndex: 4, boxName: "border", needsUpdate: function () { var a = this.styleInfos; return a.borderInfo.changed() || a.borderRadiusInfo.changed() }, isActive: function () { var a = this.styleInfos; return a.borderImageInfo.isActive() || a.borderRadiusInfo.isActive() || a.backgroundInfo.isActive() }, updateSize: function () { if (this.isActive()) { this.drawBorder() } }, updateProps: function () { this.destroy(); if (this.isActive()) { this.drawBorder() } }, drawBorder: function () { var a = this.element, j = a.currentStyle, n = a.offsetWidth, f = a.offsetHeight, m = this.styleInfos.borderInfo.getProps(), l, k, p, b, r, o, q, e, c, d, g; if (m) { this.hideBorder(); e = this.getBorderSegments(2); for (d = 0, g = e.length; d < g; d++) { c = e[d]; k = this.getShape("borderPiece" + d, c.stroke ? "stroke" : "fill", this.getBox()); k.coordsize = n * 2 + "," + f * 2; k.coordorigin = "1,1"; k.path = c.path; q = k.style; q.width = n; q.height = f; k.filled = !!c.fill; k.stroked = !!c.stroke; if (c.stroke) { p = k.stroke; p.weight = c.weight + "px"; p.color = c.color.value(a); p.dashstyle = c.stroke === "dashed" ? "2 2" : c.stroke === "dotted" ? "1 1" : "solid"; p.linestyle = c.stroke === "double" && c.weight > 2 ? "ThinThin" : "Single" } else { k.fill.color = c.fill.value(a) } } while (this.deleteShape("borderPiece" + d++)) { } } }, hideBorder: function () { var b = this.element, f = b.currentStyle, d = b.runtimeStyle, j = b.tagName, c, g, e; if (j === "BUTTON" || (j === "INPUT" && b.type in { submit: 1, button: 1, reset: 1 })) { d.borderWidth = ""; c = this.styleInfos.borderInfo.sides; for (e = c.length; e--; ) { g = c[e]; d["padding" + g] = ""; d["padding" + g] = parseInt(f["padding" + g]) + parseInt(f["border" + g + "Width"]) + (!PIE.isIE8 && e % 2 ? 1 : 0) } d.borderWidth = 0 } else { if (PIE.isIE6) { if (b.childNodes.length !== 1 || b.firstChild.tagName !== "ie6-mask") { var k = b.document.createElement("ie6-mask"), h = k.style, a; h.visibility = "visible"; h.zoom = 1; while (a = b.firstChild) { k.appendChild(a) } b.appendChild(k); d.visibility = "hidden" } } else { d.borderColor = "transparent" } } }, getBorderSegments: function (f) { var b = this.element, s, d, q = this.styleInfos.borderInfo, o = [], t, a, p, r, c, v, k, u, n, i, g, h; if (q.isActive()) { k = q.getProps(); i = k.widths; g = k.styles; h = k.colors; if (k.widthsSame && k.stylesSame && k.colorsSame) { p = i.t.pixels(b); r = p / 2; o.push({ path: this.getBoxPath({ t: r, r: r, b: r, l: r }, f), stroke: g.t, color: h.t, weight: p }) } else { f = f || 1; s = b.offsetWidth; d = b.offsetHeight; p = i.t.pixels(b); r = i.r.pixels(b); c = i.b.pixels(b); v = i.l.pixels(b); var l = { t: p, r: r, b: c, l: v }; u = this.styleInfos.borderRadiusInfo; if (u.isActive()) { n = this.getRadiiPixels(u.getProps()) } t = Math.floor; a = Math.ceil; function e(y, x) { return n ? n[y][x] : 0 } function m(G, E, D, A, H, C) { var z = e("x", G), x = e("y", G), y = 65535, F = G.charAt(1) === "r", B = G.charAt(0) === "b"; return (z > 0 && x > 0) ? (C ? "al" : "ae") + (F ? a(s - z) : t(z)) * f + "," + (B ? a(d - x) : t(x)) * f + "," + (t(z) - E) * f + "," + (t(x) - D) * f + "," + (A * y) + "," + (45 * y * (H ? 1 : -1)) : ((C ? "m" : "l") + (F ? s - E : E) * f + "," + (B ? d - D : D) * f) } function j(A, z, y, B) { var C = (A === "t" ? t(e("x", "tl")) * f + "," + a(z) * f : A === "r" ? a(s - z) * f + "," + t(e("y", "tr")) * f : A === "b" ? a(s - e("x", "br")) * f + "," + t(d - z) * f : t(z) * f + "," + a(d - e("y", "bl")) * f), x = (A === "t" ? a(s - e("x", "tr")) * f + "," + a(z) * f : A === "r" ? a(s - z) * f + "," + a(d - e("y", "br")) * f : A === "b" ? t(e("x", "bl")) * f + "," + t(d - z) * f : t(z) * f + "," + t(e("y", "tl")) * f); return y ? (B ? "m" + x : "") + "l" + C : (B ? "m" + C : "") + "l" + x } function w(F, B, z, G, H, E) { var D = F === "l" || F === "r", C = l[F], x, I, A, y; if (C > 0 && g[F] !== "none") { x = l[D ? F : B]; I = l[D ? B : F]; A = l[D ? F : z]; y = l[D ? z : F]; if (g[F] === "dashed" || g[F] === "dotted") { o.push({ path: m(G, x, I, E + 45, 0, 1) + m(G, 0, 0, E, 1, 0), fill: h[F] }); o.push({ path: j(F, C / 2, 0, 1), stroke: g[F], weight: C, color: h[F] }); o.push({ path: m(H, A, y, E, 0, 1) + m(H, 0, 0, E - 45, 1, 0), fill: h[F] }) } else { o.push({ path: m(G, x, I, E + 45, 0, 1) + j(F, C, 0, 0) + m(H, A, y, E, 0, 0) + (g[F] === "double" && C > 2 ? m(H, A - t(A / 3), y - t(y / 3), E - 45, 1, 0) + j(F, a(C / 3 * 2), 1, 0) + m(G, x - t(x / 3), I - t(I / 3), E, 1, 0) + "x " + m(G, t(x / 3), t(I / 3), E + 45, 0, 1) + j(F, t(C / 3), 1, 0) + m(H, t(A / 3), t(y / 3), E, 0, 0) : "") + m(H, 0, 0, E - 45, 1, 0) + j(F, 0, 1, 0) + m(G, 0, 0, E, 1, 0), fill: h[F] }) } } } w("t", "l", "r", "tl", "tr", 90); w("r", "t", "b", "tr", "br", 0); w("b", "r", "l", "br", "bl", -90); w("l", "b", "t", "bl", "tl", -180) } } return o }, destroy: function () { PIE.RendererBase.destroy.call(this); this.element.runtimeStyle.borderColor = "" } }); PIE.BorderImageRenderer = PIE.RendererBase.newRenderer({ zIndex: 5, pieceNames: ["t", "tr", "r", "br", "b", "bl", "l", "tl", "c"], needsUpdate: function () { var a = this.styleInfos; return a.borderImageInfo.changed() || a.borderImageInfo.changed() }, isActive: function () { return this.styleInfos.borderImageInfo.isActive() }, updateSize: function () { if (this.isActive()) { var b = this.styleInfos.borderImageInfo.getProps(), d = this.getBox(), a = this.element, c = this.pieces; PIE.Util.withImageSize(b.src, function (o) { var m = a.offsetWidth, g = a.offsetHeight, j = b.width, n = j.t.pixels(a), p = j.r.pixels(a), k = j.b.pixels(a), s = j.l.pixels(a), q = b.slice, e = q.t.pixels(a), i = q.r.pixels(a), r = q.b.pixels(a), l = q.l.pixels(a); function f(A, u, z, t, B) { var v = c[A].style; v.width = u; v.height = z; v.left = t; v.top = B } f("tl", s, n, 0, 0); f("t", m - s - p, n, s, 0); f("tr", p, n, m - p, 0); f("r", p, g - n - k, m - p, n); f("br", p, k, m - p, g - k); f("b", m - s - p, k, s, g - k); f("bl", s, k, 0, g - k); f("l", s, g - n - k, 0, n); f("c", m - s - p, g - n - k, s, n); function h(w, v, x) { for (var u = 0, t = w.length; u < t; u++) { c[w[u]]["imagedata"][v] = x } } h(["tl", "t", "tr"], "cropBottom", (o.h - e) / o.h); h(["tl", "l", "bl"], "cropRight", (o.w - l) / o.w); h(["bl", "b", "br"], "cropTop", (o.h - r) / o.h); h(["tr", "r", "br"], "cropLeft", (o.w - i) / o.w); if (b.repeat.v === "stretch") { h(["l", "r", "c"], "cropTop", e / o.h); h(["l", "r", "c"], "cropBottom", r / o.h) } if (b.repeat.h === "stretch") { h(["t", "b", "c"], "cropLeft", l / o.w); h(["t", "b", "c"], "cropRight", i / o.w) } c.c.style.display = b.fill ? "" : "none" }, this) } else { this.destroy() } }, updateProps: function () { this.destroy(); if (this.isActive()) { this.updateSize() } }, getBox: function () { var f = this._box, e, d, c, b = this.pieceNames, a = b.length; if (!f) { f = this._box = this.element.document.createElement("border-image"); e = f.style; e.position = "absolute"; this.pieces = {}; for (c = 0; c < a; c++) { d = this.pieces[b[c]] = PIE.Util.createVmlElement("rect"); d.appendChild(PIE.Util.createVmlElement("imagedata")); e = d.style; e.behavior = "url(#default#VML)"; e.position = "absolute"; e.top = e.left = 0; d.imagedata.src = this.styleInfos.borderImageInfo.getProps().src; d.stroked = false; d.filled = false; f.appendChild(d) } this.parent.addLayer(this.zIndex, f) } return f } }); PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer({ zIndex: 1, boxName: "outset-box-shadow", needsUpdate: function () { var a = this.styleInfos; return a.boxShadowInfo.changed() || a.borderRadiusInfo.changed() }, isActive: function () { var a = this.styleInfos.boxShadowInfo; return a.isActive() && a.getProps().outset[0] }, updateSize: function () { if (this.isActive()) { var J = this, c = this.element, l = this.getBox(), G = this.styleInfos, F = G.boxShadowInfo.getProps().outset, q = G.borderRadiusInfo.getProps(), D = F.length, C = D, B, m = c.offsetWidth, E = c.offsetHeight, g = PIE.isIE8 ? 1 : 0, t = ["tl", "tr", "br", "bl"], k, u, b, A, x, d, f, K, z, n, y, e, p, o, I, v, s, H, a; function r(j, M, O, L, i, h, Q) { var w = J.getShape("shadow" + j + M, "fill", l, D - j), P = w.style, N = w.fill; P.left = O; P.top = L; w.coordsize = m * 2 + "," + E * 2; w.coordorigin = "1,1"; w.stroked = false; w.filled = true; N.color = i.value(c); if (h) { N.type = "gradienttitle"; N.color2 = N.color; N.opacity = 0 } w.path = Q; P.width = m; P.height = E; return w } while (C--) { u = F[C]; d = u.xOffset.pixels(c); f = u.yOffset.pixels(c); K = u.spread.pixels(c), z = u.blur.pixels(c); y = u.color; n = -K - z; if (!q && z) { q = PIE.BorderRadiusStyleInfo.ALL_ZERO } p = this.getBoxPath({ t: n, r: n, b: n, l: n }, 2, q); if (z) { o = (K + z) * 2 + m; I = (K + z) * 2 + E; v = z * 2 / o; s = z * 2 / I; if (z - K > m / 2 || z - K > E / 2) { for (B = 4; B--; ) { k = t[B]; H = k.charAt(0) === "b"; a = k.charAt(1) === "r"; b = r(C, k, d, f, y, z, p); A = b.fill; A.focusposition = (a ? 1 - v : v) + "," + (H ? 1 - s : s); A.focussize = "0,0"; b.style.clip = "rect(" + ((H ? I / 2 : 0) + g) + "px," + (a ? o : o / 2) + "px," + (H ? I : I / 2) + "px," + ((a ? o / 2 : 0) + g) + "px)" } } else { b = r(C, "", d, f, y, z, p); A = b.fill; A.focusposition = v + "," + s; A.focussize = (1 - v * 2) + "," + (1 - s * 2) } } else { b = r(C, "", d, f, y, z, p); e = y.alpha(); if (e < 1) { b.fill.opacity = e } } } } else { this.destroy() } }, updateProps: function () { this.destroy(); this.updateSize() } }); PIE.BoxShadowInsetRenderer = PIE.RendererBase.newRenderer({ zIndex: 3, boxName: "inset-box-shadow", needsUpdate: function () { var a = this.styleInfos; return a.boxShadowInfo.changed() || a.borderRadiusInfo.changed() }, isActive: function () { var a = this.styleInfos.boxShadowInfo; return a.isActive() && a.getProps().inset[0] }, updateSize: function () { }, updateProps: function () { } }) } var lastW, lastH, lastX, lastY, renderers, styleInfos, ancestors; function update() { init(); var f = element.getBoundingClientRect(), b = f.left, g = f.top, c = f.right - b, e = f.bottom - g, d, a; if (b !== lastX || g !== lastY) { for (d = 0, a = renderers.length; d < a; d++) { renderers[d].updatePos() } lastX = b; lastY = g } if (c !== lastW || e !== lastH) { for (d = 0, a = renderers.length; d < a; d++) { renderers[d].updateSize() } lastW = c; lastH = e } } function propChanged() { init(); var c, a, b = []; for (c = 0, a = renderers.length; c < a; c++) { if (renderers[c].needsUpdate()) { b.push(renderers[c]) } } for (c = 0, a = b.length; c < a; c++) { b[c].updateProps() } } function mouseEntered() { var a = event.srcElement; a.className += " " + PIE.CLASS_PREFIX + "hover"; setTimeout(propChanged, 0) } function mouseLeft() { var a = event.srcElement; a.className = a.className.replace(new RegExp("\\b" + PIE.CLASS_PREFIX + "hover\\b", "g"), ""); setTimeout(propChanged, 0) } function ancestorPropChanged() { var a = event.propertyName; if (a === "className" || a === "id") { propChanged() } } function cleanup() { var b, a; if (renderers) { for (b = 0, a = renderers.length; b < a; b++) { renderers[b].destroy() } renderers = null } styleInfos = null; if (ancestors) { for (b = 0, a = ancestors.length; b < a; b++) { ancestors[b].detachEvent("onpropertychange", ancestorPropChanged); ancestors[b].detachEvent("onmouseenter", mouseEntered); ancestors[b].detachEvent("onmouseleave", mouseLeft) } ancestors = null } if (PIE.ie8DocMode === 8) { PIE.ie8Poller.remove(update) } } function initAncestorPropChangeListeners() { var d = element, e = d.currentStyle.getAttribute(PIE.CSS_PREFIX + "watch-ancestors"), c, b; if (e) { ancestors = []; e = parseInt(e, 10); c = 0; b = d.parentNode; while (b && (e === "NaN" || c++ < e)) { ancestors.push(b); b.attachEvent("onpropertychange", ancestorPropChanged); b.attachEvent("onmouseenter", mouseEntered); b.attachEvent("onmouseleave", mouseLeft); b = b.parentNode } } } function init() { if (!renderers) { var b = element; b.runtimeStyle.zoom = 1; styleInfos = { backgroundInfo: new PIE.BackgroundStyleInfo(b), borderInfo: new PIE.BorderStyleInfo(b), borderImageInfo: new PIE.BorderImageStyleInfo(b), borderRadiusInfo: new PIE.BorderRadiusStyleInfo(b), boxShadowInfo: new PIE.BoxShadowStyleInfo(b), visibilityInfo: new PIE.VisibilityStyleInfo(b) }; var a = new PIE.RootRenderer(b, styleInfos); renderers = [a, new PIE.BoxShadowOutsetRenderer(b, styleInfos, a), new PIE.BackgroundRenderer(b, styleInfos, a), new PIE.BoxShadowInsetRenderer(b, styleInfos, a), new PIE.BorderRenderer(b, styleInfos, a), new PIE.BorderImageRenderer(b, styleInfos, a)]; initAncestorPropChangeListeners(); if (PIE.ie8DocMode === 8) { PIE.ie8Poller.add(update) } } } if (element.readyState === "complete") { update() };
    </script>

</PUBLIC:COMPONENT>
