/*=:project
scalable Inman Flash Replacement (sIFR) version 3, revision 404

=:file
Copyright: 2006 Mark Wubben.
Author: Mark Wubben, <http://novemberborn.net/>

=:history
* IFR: Shaun Inman
* sIFR 1: Mike Davidson, Shaun Inman and Tomas Jogin
* sIFR 2: Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

=:license
This software is licensed and provided under the CC-GNU LGPL.
See <http://creativecommons.org/licenses/LGPL/2.1/>    
*/

var sIFR = new function() { var O = this; var E = { ACTIVE: "sIFR-active", UNLOADING: "sIFR-unloading", REPLACED: "sIFR-replaced", IGNORE: "sIFR-ignore", ALTERNATE: "sIFR-alternate", CLASS: "sIFR-class", LAYOUT: "sIFR-layout", FLASH: "sIFR-flash", FIX_FOCUS: "sIFR-fixfocus", DUMMY: "sIFR-dummy" }; E.IGNORE_CLASSES = [E.REPLACED, E.IGNORE, E.ALTERNATE]; this.MIN_FONT_SIZE = 6; this.MAX_FONT_SIZE = 126; this.FLASH_PADDING_BOTTOM = 5; this.VERSION = "404"; this.isActive = false; this.isEnabled = true; this.fixHover = true; this.autoInitialize = true; this.setPrefetchCookie = true; this.cookiePath = "/"; this.domains = []; this.forceWidth = true; this.fitExactly = false; this.forceTextTransform = true; this.useDomLoaded = true; this.useStyleCheck = false; this.hasFlashClassSet = false; this.repaintOnResize = true; this.replacements = []; var L = 0; var R = false; function Y() { } function D(b) { function c(d) { return d.toLocaleUpperCase() } this.normalize = function(d) { return d.replace(/\n|\r|\xA0/g, D.SINGLE_WHITESPACE).replace(/\s+/g, D.SINGLE_WHITESPACE) }; this.textTransform = function(d, e) { switch (d) { case "uppercase": return e.toLocaleUpperCase(); case "lowercase": return e.toLocaleLowerCase(); case "capitalize": return e.replace(/^\w|\s\w/g, c) } return e }; this.toHexString = function(d) { if (d.charAt(0) != "#" || d.length != 4 && d.length != 7) { return d } d = d.substring(1); return "0x" + (d.length == 3 ? d.replace(/(.)(.)(.)/, "$1$1$2$2$3$3") : d) }; this.toJson = function(f, e) { var d = ""; switch (typeof (f)) { case "string": d = '"' + e(f) + '"'; break; case "number": case "boolean": d = f.toString(); break; case "object": d = []; for (var g in f) { if (f[g] == Object.prototype[g]) { continue } d.push('"' + g + '":' + this.toJson(f[g])) } d = "{" + d.join(",") + "}"; break } return d }; this.convertCssArg = function(d) { if (!d) { return {} } if (typeof (d) == "object") { if (d.constructor == Array) { d = d.join("") } else { return d } } var k = {}; var l = d.split("}"); for (var g = 0; g < l.length; g++) { var h = l[g].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/); if (!h || h.length != 3) { continue } if (!k[h[1]]) { k[h[1]] = {} } var f = h[2].split(";"); for (var e = 0; e < f.length; e++) { var m = f[e].match(/\s*([^:\s]+)\s*\:\s*([^;]+)/); if (!m || m.length != 3) { continue } k[h[1]][m[1]] = m[2].replace(/\s+$/, "") } } return k }; this.extractFromCss = function(f, e, h, d) { var g = null; if (f && f[e] && f[e][h]) { g = f[e][h]; if (d) { delete f[e][h] } } return g }; this.cssToString = function(e) { var f = []; for (var d in e) { var i = e[d]; if (i == Object.prototype[d]) { continue } f.push(d, "{"); for (var h in i) { if (i[h] == Object.prototype[h]) { continue } var g = i[h]; if (D.UNIT_REMOVAL_PROPERTIES[h]) { g = parseInt(g, 10) } f.push(h, ":", g, ";") } f.push("}") } return f.join("") }; this.escape = function(d) { return escape(d).replace(/\+/g, "%2B") }; this.encodeVars = function(d) { return d.join("&").replace(/%/g, "%25") }; this.copyProperties = function(f, e) { for (var d in f) { if (e[d] === undefined) { e[d] = f[d] } } return e }; this.domain = function() { var d = ""; try { d = document.domain } catch (f) { } return d }; this.domainMatches = function(g, f) { if (f == "*" || f == g) { return true } var e = f.lastIndexOf("*"); if (e > -1) { f = f.substr(e + 1); var d = g.lastIndexOf(f); if (d > -1 && (d + f.length) == g.length) { return true } } return false }; this.uriEncode = function(d) { return encodeURI(decodeURIComponent(d)) }; this.delay = function(e, g, f) { var d = Array.prototype.slice.call(arguments, 3); setTimeout(function() { g.apply(f, d) }, e) } } D.UNIT_REMOVAL_PROPERTIES = { leading: true, "margin-left": true, "margin-right": true, "text-indent": true }; D.SINGLE_WHITESPACE = " "; function T(d) { var c = this; function b(f, h, g) { var j = c.getStyleAsInt(f, h, d.ua.ie); if (j == 0) { j = f[g]; for (var e = 3; e < arguments.length; e++) { j -= c.getStyleAsInt(f, arguments[e], true) } } return j } this.getBody = function() { return document.getElementsByTagName("body")[0] || null }; this.querySelectorAll = function(e) { return window.parseSelector(e) }; this.addClass = function(e, f) { if (f) { f.className = ((f.className || "") == "" ? "" : f.className + " ") + e } }; this.removeClass = function(e, f) { if (f) { f.className = f.className.replace(new RegExp("(^|\\s)" + e + "(\\s|$)"), "").replace(/^\s+|(\s)\s+/g, "$1") } }; this.hasClass = function(e, f) { return new RegExp("(^|\\s)" + e + "(\\s|$)").test(f.className) }; this.hasOneOfClassses = function(g, f) { for (var e = 0; e < g.length; e++) { if (this.hasClass(g[e], f)) { return true } } return false }; this.ancestorHasClass = function(f, e) { f = f.parentNode; while (f && f.nodeType == 1) { if (this.hasClass(e, f)) { return true } f = f.parentNode } return false }; this.create = function(e, f) { var g = document.createElementNS ? document.createElementNS(T.XHTML_NS, e) : document.createElement(e); if (f) { g.className = f } return g }; this.getComputedStyle = function(g, h) { var e; if (document.defaultView && document.defaultView.getComputedStyle) { var f = document.defaultView.getComputedStyle(g, null); e = f ? f[h] : null } else { if (g.currentStyle) { e = g.currentStyle[h] } } return e || "" }; this.getStyleAsInt = function(f, h, e) { var g = this.getComputedStyle(f, h); if (e && !/px$/.test(g)) { return 0 } return parseInt(g) || 0 }; this.getWidthFromStyle = function(e) { return b(e, "width", "offsetWidth", "paddingRight", "paddingLeft", "borderRightWidth", "borderLeftWidth") }; this.getHeightFromStyle = function(e) { return b(e, "height", "offsetHeight", "paddingTop", "paddingBottom", "borderTopWidth", "borderBottomWidth") }; this.getDimensions = function(h) { var g = h.offsetWidth; var e = h.offsetHeight; if (g == 0 || e == 0) { for (var f = 0; f < h.childNodes.length; f++) { var j = h.childNodes[f]; if (j.nodeType != 1) { continue } g = Math.max(g, j.offsetWidth); e = Math.max(e, j.offsetHeight) } } return { width: g, height: e} }; this.getViewport = function() { return { width: window.innerWidth || document.documentElement.clientWidth || this.getBody().clientWidth, height: window.innerHeight || document.documentElement.clientHeight || this.getBody().clientHeight} }; this.blurElement = function(g) { try { g.blur(); return } catch (h) { } var f = this.create("input"); f.style.width = "0px"; f.style.height = "0px"; g.parentNode.appendChild(f); f.focus(); f.blur(); f.parentNode.removeChild(f) } } T.XHTML_NS = "http://www.w3.org/1999/xhtml"; function H(l) { var c = navigator.userAgent.toLowerCase(); var k = (navigator.product || "").toLowerCase(); var d = navigator.platform.toLowerCase(); this.parseVersion = function(e) { return e.replace(/(^|\D)(\d)(?=\D|$)/g, "$10000$2") }; this.macintosh = /^mac/.test(d); this.windows = /^win/.test(d); this.quicktime = false; this.opera = /opera/.test(c); this.konqueror = /konqueror/.test(k); this.ie = false/*@cc_on || true@*/; this.ieSupported = this.ie && !/ppc|smartphone|iemobile|msie\s5\.5/.test(c)/*@cc_on && @_jscript_version >= 5.5@*/; this.ieWin = this.ie && this.windows/*@cc_on && @_jscript_version >= 5.1@*/; this.windows = this.windows && (!this.ie || this.ieWin); this.ieMac = this.ie && this.macintosh/*@cc_on && @_jscript_version < 5.1@*/; this.macintosh = this.macintosh && (!this.ie || this.ieMac); this.safari = /safari/.test(c); this.webkit = !this.konqueror && /applewebkit/.test(c); this.khtml = this.webkit || this.konqueror; this.gecko = !this.webkit && k == "gecko"; this.ieVersion = this.ie && /.*msie\s(\d\.\d)/.exec(c) ? this.parseVersion(RegExp.$1) : "0"; this.operaVersion = this.opera && /.*opera(\s|\/)(\d+\.\d+)/.exec(c) ? this.parseVersion(RegExp.$2) : "0"; this.webkitVersion = this.webkit && /.*applewebkit\/(\d+).*/.exec(c) ? this.parseVersion(RegExp.$1) : "0"; this.geckoVersion = this.gecko && /.*rv:\s*([^\)]+)\)\s+gecko/.exec(c) ? this.parseVersion(RegExp.$1) : "0"; this.konquerorVersion = this.konqueror && /.*konqueror\/([\d\.]+).*/.exec(c) ? this.parseVersion(RegExp.$1) : "0"; this.flashVersion = 0; if (this.ieWin) { var g; var j = false; try { g = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7") } catch (h) { try { g = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); this.flashVersion = 6; g.AllowScriptAccess = "always" } catch (h) { j = this.flashVersion == 6 } if (!j) { try { g = new ActiveXObject("ShockwaveFlash.ShockwaveFlash") } catch (h) { } } } if (!j && g) { this.flashVersion = parseFloat(/([\d,?]+)/.exec(g.GetVariable("$version"))[1].replace(/,/g, ".")) } } else { if (navigator.plugins && navigator.plugins["Shockwave Flash"]) { this.flashVersion = parseFloat(/(\d+\.?\d*)/.exec(navigator.plugins["Shockwave Flash"].description)[1]); var f = 0; while (this.flashVersion >= H.MIN_FLASH_VERSION && f < navigator.mimeTypes.length) { var b = navigator.mimeTypes[f]; if (b.type == "application/x-shockwave-flash" && b.enabledPlugin.description.toLowerCase().indexOf("quicktime") > -1) { this.flashVersion = 0; this.quicktime = true } f++ } } } this.flash = this.flashVersion >= H.MIN_FLASH_VERSION; this.transparencySupport = this.macintosh || this.windows; this.computedStyleSupport = this.ie || !!document.defaultView.getComputedStyle; this.requiresPrefetch = this.ieWin || this.khtml; this.fixFocus = this.gecko && this.windows; this.nativeDomLoaded = this.gecko || this.webkit && this.webkitVersion >= this.parseVersion("525") || this.konqueror && this.konquerorMajor > this.parseVersion("03") || this.opera; this.mustCheckStyle = this.khtml || this.opera; this.forcePageLoad = this.webkit && this.webkitVersion < this.parseVersion("523"); this.properDocument = typeof (document.location) == "object"; this.supported = this.flash && this.properDocument && (!this.ie || this.ieSupported) && this.computedStyleSupport && (!this.opera || this.operaVersion >= this.parseVersion("9.50")) && (!this.webkit || this.webkitVersion >= this.parseVersion("412")) && (!this.gecko || this.geckoVersion >= this.parseVersion("1.8.0.12")) && (!this.konqueror) } H.MIN_FLASH_VERSION = 8; function F(b) { this.fix = b.ua.ieWin && window.location.hash != ""; var c; this.cache = function() { c = document.title }; function d() { document.title = c } this.restore = function() { if (this.fix) { setTimeout(d, 0) } } } function S(e) { var i = null; function f() { try { if (e.ua.ie || document.readyState != "loaded" && document.readyState != "complete") { document.documentElement.doScroll("left") } } catch (j) { return setTimeout(f, 10) } b() } function b() { if (e.useStyleCheck) { d() } else { if (!e.ua.mustCheckStyle) { g(null, true) } } } function d() { i = e.dom.create("div", E.DUMMY); e.dom.getBody().appendChild(i); c() } function c() { if (e.dom.getComputedStyle(i, "marginLeft") == "42px") { h() } else { setTimeout(c, 10) } } function h() { if (i && i.parentNode) { i.parentNode.removeChild(i) } i = null; g(null, true) } function g(j, k) { e.initialize(k); if (j && j.type == "load") { if (document.removeEventListener) { document.removeEventListener("DOMContentLoaded", g, false) } if (window.removeEventListener) { window.removeEventListener("load", g, false) } } } this.attach = function() { if (window.addEventListener) { window.addEventListener("load", g, false) } else { window.attachEvent("onload", g) } if (!e.useDomLoaded || e.ua.forcePageLoad || e.ua.ie && window.top != window) { return } if (e.ua.nativeDomLoaded) { document.addEventListener("DOMContentLoaded", b, false) } else { if (e.ua.ie || e.ua.khtml) { f() } } } } var Q = "sifrFetch"; function N(b) { var d = false; this.fetchMovies = function(f) { if (b.setPrefetchCookie && new RegExp(";?" + Q + "=true;?").test(document.cookie)) { return } try { d = true; c(f) } catch (g) { if (b.debug) { throw g } } if (b.setPrefetchCookie) { document.cookie = Q + "=true;path=" + b.cookiePath } }; this.clear = function() { if (!d) { return } try { var f = document.getElementsByTagName("script"); for (var g = f.length - 1; g >= 0; g--) { var h = f[g]; if (h.type == "sifr/prefetch") { h.parentNode.removeChild(h) } } } catch (j) { } }; function c(e) { for (var f = 0; f < e.length; f++) { document.write('<script defer type="sifr/prefetch" src="' + e[f].src + '"><\/script>') } } } function K(c, f, e, b, d) { this.sIFR = c; this.id = f; this.vars = e; this.movie = null; this.__forceWidth = b; this.__events = d; this.__resizing = 0 } K.prototype = { getFlashElement: function() { return document.getElementById(this.id) }, getAlternate: function() { return document.getElementById(this.id + "_alternate") }, getAncestor: function() { var b = this.getFlashElement().parentNode; return !this.sIFR.dom.hasClass(E.FIX_FOCUS, b) ? b : b.parentNode }, available: function() { var b = this.getFlashElement(); return b && b.parentNode }, call: function(b) { if (!this.available()) { return false } var c = this.getFlashElement(); try { Function.prototype.apply.call(c[b], c, Array.prototype.slice.call(arguments, 1)) } catch (d) { if (this.sIFR.debug) { throw d } return false } return true }, updateVars: function(b, d) { for (var c = 0; c < this.vars.length; c++) { if (this.vars[c].split("=")[0] == b) { this.vars[c] = b + "=" + d; break } } var e = this.sIFR.util.encodeVars(this.vars); this.movie.injectVars(this.getFlashElement(), e); this.movie.injectVars(this.movie.html, e) }, storeSize: function(b, c) { this.movie.setSize(b, c); this.updateVars(b, c) }, fireEvent: function(b) { if (this.available() && this.__events[b]) { this.sIFR.util.delay(0, this.__events[b], this, this) } }, resizeFlashElement: function(b, c, d) { if (!this.available()) { return } this.__resizing++; var e = this.getFlashElement(); e.setAttribute("height", b); this.updateVars("renderheight", b); this.storeSize("height", b); if (c !== null) { e.setAttribute("width", c); this.storeSize("width", c) } if (this.__events.onReplacement) { this.sIFR.util.delay(0, this.__events.onReplacement, this, this); delete this.__events.onReplacement } if (d) { this.sIFR.util.delay(0, function() { this.call("scaleMovie"); this.__resizing-- }, this) } else { this.__resizing-- } }, blurFlashElement: function() { if (this.available()) { this.sIFR.dom.blurElement(this.getFlashElement()) } }, resetMovie: function() { this.sIFR.util.delay(0, this.movie.reset, this.movie, this.getFlashElement(), this.getAlternate()) }, resizeAfterScale: function() { if (this.available() && this.__resizing == 0) { this.sIFR.util.delay(0, this.resize, this) } }, resize: function() { if (!this.available()) { return } this.__resizing++; var f = this.getFlashElement(); var e = f.offsetWidth; if (e == 0) { return } var d = f.getAttribute("width"); var k = f.getAttribute("height"); var l = this.getAncestor(); var n = this.sIFR.dom.getHeightFromStyle(l); f.style.width = "1px"; f.style.height = "1px"; l.style.minHeight = n + "px"; var b = this.getAlternate().childNodes; var m = []; for (var j = 0; j < b.length; j++) { var g = b[j].cloneNode(true); m.push(g); l.appendChild(g) } var c = this.sIFR.dom.getWidthFromStyle(l); for (var j = 0; j < m.length; j++) { l.removeChild(m[j]) } f.style.width = f.style.height = l.style.minHeight = ""; f.setAttribute("width", this.__forceWidth ? c : d); f.setAttribute("height", k); if (sIFR.ua.ie) { f.style.display = "none"; var h = f.offsetHeight; f.style.display = "" } if (c != e) { if (this.__forceWidth) { this.storeSize("width", c) } this.call("resize", c) } this.__resizing-- }, replaceText: function(f, h) { var c = this.sIFR.util.escape(f); if (!this.call("replaceText", c)) { return false } this.updateVars("content", c); var d = this.getAlternate(); if (h) { while (d.firstChild) { d.removeChild(d.firstChild) } for (var b = 0; b < h.length; b++) { d.appendChild(h[b]) } } else { try { d.innerHTML = f } catch (g) { } } return true }, changeCSS: function(b) { b = this.sIFR.util.escape(this.sIFR.util.cssToString(this.sIFR.util.convertCssArg(b))); this.updateVars("css", b); return this.call("changeCSS", b) } }; var X = new function() { this.create = function(n, i, h, e, d, f, m, k, g, l) { var j = n.ua.ie ? c : b; return new j(n, i, h, e, d, f, m, ["flashvars", k, "wmode", g, "bgcolor", l, "allowScriptAccess", "always", "quality", "best"]) }; function b(q, k, g, e, d, f, p, m) { var l = q.dom.create("object", E.FLASH); var o = ["type", "application/x-shockwave-flash", "id", e, "name", e, "data", d, "width", f, "height", p]; for (var n = 0; n < o.length; n += 2) { l.setAttribute(o[n], o[n + 1]) } var h = l; if (g) { h = W.create("div", E.FIX_FOCUS); h.appendChild(l) } for (var n = 0; n < m.length; n += 2) { if (m[n] == "name") { continue } var j = W.create("param"); j.setAttribute("name", m[n]); j.setAttribute("value", m[n + 1]); l.appendChild(j) } while (k.firstChild) { k.removeChild(k.firstChild) } k.appendChild(h); this.html = h.cloneNode(true) } b.prototype = { reset: function(d, e) { d.parentNode.replaceChild(this.html.cloneNode(true), d) }, setSize: function(d, e) { this.html.setAttribute(d, e) }, injectVars: function(d, f) { var g = d.getElementsByTagName("param"); for (var e = 0; e < g.length; e++) { if (g[e].getAttribute("name") == "flashvars") { g[e].setAttribute("value", f); break } } } }; function c(n, h, g, e, d, f, m, j) { this.dom = n.dom; this.html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="' + e + '" width="' + f + '" height="' + m + '" class="' + E.FLASH + '"><param name="movie" value="' + d + '"></param></object>'; var l = ""; for (var k = 0; k < j.length; k += 2) { l += '<param name="' + j[k] + '" value="' + j[k + 1] + '"></param>' } this.html = this.html.replace(/(<\/object>)/, l + "$1"); h.innerHTML = this.html } c.prototype = { reset: function(e, f) { var d = e.parentNode; d.innerHTML = this.html; d.appendChild(f) }, setSize: function(d, e) { this.html = this.html.replace(d == "height" ? /(height)="\d+"/ : /(width)="\d+"/, '$1="' + e + '"') }, injectVars: function(d, e) { if (d != this.html) { return } this.html = this.html.replace(/(flashvars(=|\"\svalue=)\")[^\"]+/, "$1" + e) } } }; this.errors = new Y(O); var A = this.util = new D(O); var W = this.dom = new T(O); var U = this.ua = new H(O); var G = { fragmentIdentifier: new F(O), pageLoad: new S(O), prefetch: new N(O) }; var J = { kwargs: [], replaceAll: function(c) { for (var b = 0; b < this.kwargs.length; b++) { O.replace(this.kwargs[b]) } if (!c) { this.kwargs = [] } } }; this.activate = function() { if (!U.supported || !this.isEnabled || this.isActive || !C() || a()) { return } if (U.requiresPrefetch) { G.prefetch.fetchMovies(arguments) } this.isActive = true; this.setFlashClass(); G.fragmentIdentifier.cache(); if (!this.autoInitialize) { return } G.pageLoad.attach(); if (U.ie) { window.attachEvent("onunload", function() { W.addClass(E.UNLOADING, document.documentElement) }) } }; this.setFlashClass = function() { if (this.hasFlashClassSet) { return } W.addClass(E.ACTIVE, W.getBody() || document.documentElement); this.hasFlashClassSet = true }; this.removeFlashClass = function() { if (!this.hasFlashClassSet) { return } W.removeClass(E.ACTIVE, W.getBody()); W.removeClass(E.ACTIVE, document.documentElement); this.hasFlashClassSet = false }; this.initialize = function(b) { if (!this.isActive || !this.isEnabled) { return } if (R) { if (!b) { J.replaceAll(false) } return } R = true; J.replaceAll(b); if (O.repaintOnResize) { if (window.addEventListener) { window.addEventListener("resize", Z, false) } else { window.attachEvent("onresize", Z) } } G.prefetch.clear() }; this.replace = function(v, s) { if (!U.supported) { return } if (s) { v = A.copyProperties(v, s) } if (!R) { return J.kwargs.push(v) } if (this.onReplacementStart) { this.onReplacementStart(v) } var AK = v.elements || W.querySelectorAll(v.selector); if (AK.length == 0) { return } var u = M(v.src); var AP = A.convertCssArg(v.css); var t = B(v.filters); var AL = v.forceSingleLine === true; var AQ = v.preventWrap === true && !AL; var o = AL || (v.fitExactly == null ? this.fitExactly : v.fitExactly) === true; var AB = o || (v.forceWidth == null ? this.forceWidth : v.forceWidth) === true; var q = v.ratios || []; var AC = v.pixelFont === true; var p = parseInt(v.tuneHeight) || 0; var x = !!v.onRelease || !!v.onRollOver || !!v.onRollOut; if (o) { A.extractFromCss(AP, ".sIFR-root", "text-align", true) } var r = A.extractFromCss(AP, ".sIFR-root", "font-size", true) || "0"; var d = A.extractFromCss(AP, ".sIFR-root", "background-color", true) || "#FFFFFF"; var m = A.extractFromCss(AP, ".sIFR-root", "kerning", true) || ""; var AU = A.extractFromCss(AP, ".sIFR-root", "opacity", true) || "100"; var h = A.extractFromCss(AP, ".sIFR-root", "cursor", true) || "default"; var AN = parseInt(A.extractFromCss(AP, ".sIFR-root", "leading")) || 0; var AH = v.gridFitType || (A.extractFromCss(AP, ".sIFR-root", "text-align") == "right") ? "subpixel" : "pixel"; var g = this.forceTextTransform === false ? "none" : A.extractFromCss(AP, ".sIFR-root", "text-transform", true) || "none"; r = /^\d+(px)?$/.test(r) ? parseInt(r) : 0; AU = parseFloat(AU) < 1 ? 100 * parseFloat(AU) : AU; var AA = v.modifyCss ? "" : A.cssToString(AP); var AE = v.wmode || ""; if (!AE) { if (v.transparent) { AE = "transparent" } else { if (v.opaque) { AE = "opaque" } } } if (AE == "transparent") { if (!U.transparencySupport) { AE = "opaque" } else { d = "transparent" } } for (var AT = 0; AT < AK.length; AT++) { var AD = AK[AT]; if (W.hasOneOfClassses(E.IGNORE_CLASSES, AD) || W.ancestorHasClass(AD, E.ALTERNATE)) { continue } var AM = W.getDimensions(AD); var e = AM.height; var b = AM.width; var y = W.getComputedStyle(AD, "display"); if (!e || !b || !y || y == "none") { continue } b = W.getWidthFromStyle(AD); var k, AF; if (!r) { var AJ = I(AD); k = Math.min(this.MAX_FONT_SIZE, Math.max(this.MIN_FONT_SIZE, AJ.fontSize)); if (AC) { k = Math.max(8, 8 * Math.round(k / 8)) } AF = AJ.lines; if (isNaN(AF) || !isFinite(AF) || AF == 0) { AF = 1 } if (AF > 1 && AN) { e += Math.round((AF - 1) * AN) } } else { k = r; AF = 1 } var c = W.create("span", E.ALTERNATE); var AV = AD.cloneNode(true); AD.parentNode.appendChild(AV); for (var AS = 0, AR = AV.childNodes.length; AS < AR; AS++) { c.appendChild(AV.childNodes[AS].cloneNode(true)) } if (v.modifyContent) { v.modifyContent(AV, v.selector) } if (v.modifyCss) { AA = v.modifyCss(AP, AV, v.selector) } var n = P(AV, g, v.uriEncode); AV.parentNode.removeChild(AV); if (v.modifyContentString) { n.text = v.modifyContentString(n.text, v.selector) } if (n.text == "") { continue } e = Math.round(AF * k); var AI = Math.round(AF * V(k, q) * k) + this.FLASH_PADDING_BOTTOM + p; var z = AB ? b : "100%"; var AG = "sIFR_replacement_" + L++; var AO = ["id=" + AG, "content=" + A.escape(n.text), "width=" + b, "height=" + e, "renderheight=" + AI, "link=" + A.escape(n.primaryLink.href || ""), "target=" + A.escape(n.primaryLink.target || ""), "size=" + k, "css=" + A.escape(AA), "cursor=" + h, "tunewidth=" + (v.tuneWidth || 0), "tuneheight=" + p, "offsetleft=" + (v.offsetLeft || ""), "offsettop=" + (v.offsetTop || ""), "fitexactly=" + o, "preventwrap=" + AQ, "forcesingleline=" + AL, "antialiastype=" + (v.antiAliasType || ""), "thickness=" + (v.thickness || ""), "sharpness=" + (v.sharpness || ""), "kerning=" + m, "gridfittype=" + AH, "flashfilters=" + t, "opacity=" + AU, "blendmode=" + (v.blendMode || ""), "selectable=" + (v.selectable == null ? "true" : v.selectable === true), "fixhover=" + (this.fixHover === true), "events=" + x, "version=" + this.VERSION]; var w = A.encodeVars(AO); var f = new K(O, AG, AO, AB, { onReplacement: v.onReplacement, onRollOver: v.onRollOver, onRollOut: v.onRollOut, onRelease: v.onRelease }); f.movie = X.create(sIFR, AD, U.fixFocus && v.fixFocus, AG, u, z, AI, w, AE, d); this.replacements.push(f); this.replacements[AG] = f; if (v.selector) { if (!this.replacements[v.selector]) { this.replacements[v.selector] = [f] } else { this.replacements[v.selector].push(f) } } c.setAttribute("id", AG + "_alternate"); AD.appendChild(c); W.addClass(E.REPLACED, AD) } G.fragmentIdentifier.restore() }; this.getReplacementByFlashElement = function(c) { for (var b = 0; b < O.replacements.length; b++) { if (O.replacements[b].id == c.getAttribute("id")) { return O.replacements[b] } } }; this.redraw = function() { for (var b = 0; b < O.replacements.length; b++) { O.replacements[b].resetMovie() } }; function C() { if (O.domains.length == 0) { return true } var c = A.domain(); for (var b = 0; b < O.domains.length; b++) { if (A.domainMatches(c, O.domains[b])) { return true } } return false } function a() { if (document.location.protocol == "file:") { if (O.debug) { O.errors.fire("isFile") } return true } return false } function M(b) { if (U.ie && b.charAt(0) == "/") { b = window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/, "$1$2$3") + b } return b } function V(c, d) { for (var b = 0; b < d.length; b += 2) { if (c <= d[b]) { return d[b + 1] } } return d[d.length - 1] || 1 } function B(f) { var d = []; for (var c in f) { if (f[c] == Object.prototype[c]) { continue } var b = f[c]; c = [c.replace(/filter/i, "") + "Filter"]; for (var e in b) { if (b[e] == Object.prototype[e]) { continue } c.push(e + ":" + A.escape(A.toJson(b[e], A.toHexString))) } d.push(c.join(",")) } return A.escape(d.join(";")) } function Z(c) { var d = Z.viewport; var b = W.getViewport(); if (d && b.width == d.width && b.height == d.height) { return } Z.viewport = b; if (O.replacements.length == 0) { return } if (Z.timer) { clearTimeout(Z.timer) } Z.timer = setTimeout(function() { delete Z.timer; for (var e = 0; e < O.replacements.length; e++) { O.replacements[e].resize() } }, 200) } function I(f) { var g, c; if (!U.ie) { g = W.getStyleAsInt(f, "lineHeight"); c = Math.floor(W.getStyleAsInt(f, "height") / g) } else { if (U.ie) { var g = W.getComputedStyle(f, "fontSize"); if (g.indexOf("px") > 0) { g = parseInt(g) } else { var e = f.innerHTML; f.style.visibility = "visible"; f.style.overflow = "visible"; f.style.position = "static"; f.style.zoom = "normal"; f.style.writingMode = "lr-tb"; f.style.width = f.style.height = "auto"; f.style.maxWidth = f.style.maxHeight = f.style.styleFloat = "none"; var h = f; var b = f.currentStyle.hasLayout; if (b) { f.innerHTML = '<div class="' + E.LAYOUT + '">X<br>X<br>X</div>'; h = f.firstChild } else { f.innerHTML = "X<br>X<br>X" } var d = h.getClientRects(); g = d[1].bottom - d[1].top; g = Math.ceil(g * 0.8); if (b) { f.innerHTML = '<div class="' + E.LAYOUT + '">' + e + "</div>"; h = f.firstChild } else { f.innerHTML = e } d = h.getClientRects(); c = d.length; if (b) { f.innerHTML = e } f.style.visibility = f.style.width = f.style.height = f.style.maxWidth = f.style.maxHeight = f.style.overflow = f.style.styleFloat = f.style.position = f.style.zoom = f.style.writingMode = "" } } } return { fontSize: g, lines: c} } function P(b, f, r) { r = r || A.uriEncode; var p = [], l = []; var j = null; var d = b.childNodes; var n = false, o = false; var h = 0; while (h < d.length) { var e = d[h]; if (e.nodeType == 3) { var s = A.textTransform(f, A.normalize(e.nodeValue)).replace(/</g, "&lt;"); if (n && o) { s = s.replace(/^\s+/, "") } l.push(s); n = /\s$/.test(s); o = false } if (e.nodeType == 1 && !/^(style|script)$/i.test(e.nodeName)) { var g = []; var q = e.nodeName.toLowerCase(); var m = e.className || ""; if (/\s+/.test(m)) { if (m.indexOf(E.CLASS) > -1) { m = m.match("(\\s|^)" + E.CLASS + "-([^\\s$]*)(\\s|$)")[2] } else { m = m.match(/^([^\s]+)/)[1] } } if (m != "") { g.push('class="' + m + '"') } if (q == "a") { var c = r(e.getAttribute("href") || ""); var k = e.getAttribute("target") || ""; g.push('href="' + c + '"', 'target="' + k + '"'); if (!j) { j = { href: c, target: k} } } l.push("<" + q + (g.length > 0 ? " " : "") + g.join(" ") + ">"); o = true; if (e.hasChildNodes()) { p.push(h); h = 0; d = e.childNodes; continue } else { if (!/^(br|img)$/i.test(e.nodeName)) { l.push("</", e.nodeName.toLowerCase(), ">") } } } if (p.length > 0 && !e.nextSibling) { do { h = p.pop(); d = e.parentNode.parentNode.childNodes; e = d[h]; if (e) { l.push("</", e.nodeName.toLowerCase(), ">") } } while (h == d.length - 1 && p.length > 0) } h++ } return { text: l.join("").replace(/^\s+|\s+$|\s*(<br>)\s*/g, "$1"), primaryLink: j || {}} } };
var parseSelector = (function() { var B = /\s*,\s*/; var A = /\s*([\s>+~(),]|^|$)\s*/g; var K = /([\s>+~,]|[^(]\+|^)([#.:@])/g; var E = /^[^\s>+~]/; var J = /[\s#.:>+~()@]|[^\s#.:>+~()@]+/g; function G(P, N) { N = N || document.documentElement; var Q = P.split(B), V = []; for (var S = 0; S < Q.length; S++) { var L = [N], U = F(Q[S]); for (var R = 0; R < U.length; ) { var O = U[R++], M = U[R++], T = ""; if (U[R] == "(") { while (U[R++] != ")" && R < U.length) { T += U[R] } T = T.slice(0, -1) } L = H(L, O, M, T) } V = V.concat(L) } return V } function F(L) { var M = L.replace(A, "$1").replace(K, "$1*$2"); if (E.test(M)) { M = " " + M } return M.match(J) || [] } function H(L, N, O, M) { return (G.selectors[N]) ? G.selectors[N](L, O, M) : [] } var D = { toArray: function(M) { var L = []; for (var N = 0; N < M.length; N++) { L.push(M[N]) } return L } }; var C = { isTag: function(M, L) { return (L == "*") || (L.toLowerCase() == M.nodeName.toLowerCase()) }, previousSiblingElement: function(L) { do { L = L.previousSibling } while (L && L.nodeType != 1); return L }, nextSiblingElement: function(L) { do { L = L.nextSibling } while (L && L.nodeType != 1); return L }, hasClass: function(L, M) { return (M.className || "").match("(^|\\s)" + L + "(\\s|$)") }, getByTag: function(L, M) { return M.getElementsByTagName(L) } }; var I = { "#": function(L, N) { for (var M = 0; M < L.length; M++) { if (L[M].getAttribute("id") == N) { return [L[M]] } } return [] }, " ": function(M, O) { var L = []; for (var N = 0; N < M.length; N++) { L = L.concat(D.toArray(C.getByTag(O, M[N]))) } return L }, ">": function(M, P) { var L = []; for (var O = 0, Q; O < M.length; O++) { Q = M[O]; for (var N = 0, R; N < Q.childNodes.length; N++) { R = Q.childNodes[N]; if (R.nodeType == 1 && C.isTag(R, P)) { L.push(R) } } } return L }, ".": function(M, O) { var L = []; for (var N = 0, P; N < M.length; N++) { P = M[N]; if (C.hasClass([O], P)) { L.push(P) } } return L }, ":": function(L, N, M) { return (G.pseudoClasses[N]) ? G.pseudoClasses[N](L, M) : [] } }; G.selectors = I; G.pseudoClasses = {}; G.util = D; G.dom = C; return G })();
