/*!
 * selectivizr v1.0.3 - (c) Keith Clark, freely distributable under the terms of the MIT license.
 * selectivizr.com
 */
(function (i) {
  function C(a) {
    return a.replace(D, l).replace(E, function (b, a, d) {
      for (var b = d.split(","), d = 0, e = b.length; d < e; d++) {
        var h = F(b[d].replace(G, l).replace(H, l)) + p,
            g = [];
        b[d] = h.replace(I, function (b, a, d, c, e) {
          if (a) return g.length > 0 && (q.push({
            d: h.substring(0, e),
            c: g
          }), g = []), a;else {
            if (a = d ? J(d) : !u || u.test(c) ? {
              className: v(c),
              b: !0
            } : null) return g.push(a), "." + a.className;
            return b;
          }
        });
      }

      return a + b.join(",");
    });
  }

  function J(a) {
    var b = !0,
        c = v(a.slice(1)),
        d = a.substring(0, 5) == ":not(",
        e,
        h;
    d && (a = a.slice(5, -1));
    var g = a.indexOf("(");
    g > -1 && (a = a.substring(0, g));
    if (a.charAt(0) == ":") switch (a.slice(1)) {
      case "root":
        b = function b(a) {
          return d ? a != r : a == r;
        };

        break;

      case "target":
        if (m == 8) {
          b = function b(a) {
            function b() {
              var c = location.hash,
                  e = c.slice(1);
              return d ? c == j || a.id != e : c != j && a.id == e;
            }

            k(i, "hashchange", function () {
              n(a, c, b());
            });
            return b();
          };

          break;
        }

        return !1;

      case "checked":
        b = function b(a) {
          K.test(a.type) && k(a, "propertychange", function () {
            event.propertyName == "checked" && n(a, c, a.checked !== d);
          });
          return a.checked !== d;
        };

        break;

      case "disabled":
        d = !d;

      case "enabled":
        b = function b(_b) {
          if (L.test(_b.tagName)) return k(_b, "propertychange", function () {
            event.propertyName == "$disabled" && n(_b, c, _b.a === d);
          }), s.push(_b), _b.a = _b.disabled, _b.disabled === d;
          return a == ":enabled" ? d : !d;
        };

        break;

      case "focus":
        e = "focus", h = "blur";

      case "hover":
        e || (e = "mouseenter", h = "mouseleave");

        b = function b(a) {
          k(a, d ? h : e, function () {
            n(a, c, !0);
          });
          k(a, d ? e : h, function () {
            n(a, c, !1);
          });
          return d;
        };

        break;

      default:
        if (!M.test(a)) return !1;
    }
    return {
      className: c,
      b: b
    };
  }

  function N() {
    for (var a, b, c, d = 0; d < q.length; d++) {
      b = q[d].d;
      c = q[d].c;
      b = b.replace(O, j);
      if (b == j || b.charAt(b.length - 1) == p) b += "*";

      try {
        a = w(b);
      } catch (e) {}

      if (a) {
        b = 0;

        for (var h = a.length; b < h; b++) {
          for (var g = a[b], f = g.className, k = 0, l = c.length; k < l; k++) {
            var i = c[k];
            if (!RegExp("(^|\\s)" + i.className + "(\\s|$)").test(g.className) && i.b && (i.b === !0 || i.b(g) === !0)) f = x(f, i.className, !0);
          }

          g.className = f;
        }
      }
    }
  }

  function v(a) {
    return P + "-" + (m == 6 && Q ? R++ : a.replace(S, function (a) {
      return a.charCodeAt(0);
    }));
  }

  function F(a) {
    return a.replace(y, l).replace(T, p);
  }

  function n(a, b, c) {
    var d = a.className,
        b = x(d, b, c);
    if (b != d) a.className = b, a.parentNode.className += j;
  }

  function x(a, b, c) {
    var d = RegExp("(^|\\s)" + b + "(\\s|$)"),
        e = d.test(a);
    return c ? e ? a : a + p + b : e ? a.replace(d, l).replace(y, l) : a;
  }

  function k(a, b, c) {
    a.attachEvent("on" + b, c);
  }

  function t(a, b, c) {
    b || (b = U);
    a.substring(0, 2) == "//" && (a = b.substring(0, b.indexOf("//")) + a);
    if (/^https?:\/\//i.test(a)) return !c && b.substring(0, b.indexOf("/", 8)) != a.substring(0, a.indexOf("/", 8)) ? null : a;
    if (a.charAt(0) == "/") return b.substring(0, b.indexOf("/", 8)) + a;
    b = b.split(/[?#]/)[0];
    a.charAt(0) != "?" && b.charAt(b.length - 1) != "/" && (b = b.substring(0, b.lastIndexOf("/") + 1));
    return b + a;
  }

  function z(a) {
    if (a) return o.open("GET", a, !1), o.send(), (o.status == 200 ? o.responseText : j).replace(V, j).replace(W, function (b, c, d, e, f, g) {
      b = z(t(d || f, a));
      return g ? "@media " + g + " {" + b + "}" : b;
    }).replace(X, function (b, c, d, e) {
      d = d || j;
      return c ? b : " url(" + d + t(e, a, !0) + d + ") ";
    });
    return j;
  }

  function Y() {
    N();
    s.length > 0 && setInterval(function () {
      for (var a = 0, b = s.length; a < b; a++) {
        var c = s[a];
        if (c.disabled !== c.a) c.disabled ? (c.disabled = !1, c.a = !0, c.disabled = !0) : c.a = c.disabled;
      }
    }, 250);
  }

  if (!
  /*@cc_on!@*/
  true) {
    var f = document,
        r = f.documentElement,
        o = function () {
      if (i.XMLHttpRequest) return new XMLHttpRequest();

      try {
        return new ActiveXObject("Microsoft.XMLHTTP");
      } catch (a) {
        return null;
      }
    }(),
        m = /MSIE (\d+)/.exec(navigator.userAgent)[1];

    if (!(f.compatMode != "CSS1Compat" || m < 6 || m > 8 || !o)) {
      var A = {
        NW: "*.Dom.select",
        MooTools: "$$",
        DOMAssistant: "*.$",
        Prototype: "$$",
        YAHOO: "*.util.Selector.query",
        Sizzle: "*",
        jQuery: "*",
        dojo: "*.query"
      },
          w,
          s = [],
          q = [],
          R = 0,
          Q = !0,
          P = "slvzr",
          V = /(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*?/g,
          W = /@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))\s*([^;]*);/g,
          X = /(behavior\s*?:\s*)?\burl\(\s*(["']?)(?!data:)([^"')]+)\2\s*\)/g,
          M = /^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,
          D = /:(:first-(?:line|letter))/g,
          E = /((?:^|(?:\s*})+)(?:\s*@media[^{]+{)?)\s*([^\{]*?[\[:][^{]+)/g,
          I = /([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,
          O = /(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,
          S = /[^\w-]/g,
          L = /^(INPUT|SELECT|TEXTAREA|BUTTON)$/,
          K = /^(checkbox|radio)$/,
          u = m > 6 ? /[\$\^*]=(['"])\1/ : null,
          G = /([(\[+~])\s+/g,
          H = /\s+([)\]+~])/g,
          T = /\s+/g,
          y = /^\s*((?:[\S\s]*\S)?)\s*$/,
          j = "",
          p = " ",
          l = "$1",
          B = f.getElementsByTagName("BASE"),
          U = B.length > 0 ? B[0].href : f.location.href;

      (function () {
        for (var a, b, c = 0; c < f.styleSheets.length; c++) {
          if (b = f.styleSheets[c], b.href != j && (a = t(b.href))) b.cssText = b.rawCssText = C(z(a));
        }
      })();

      (function (a, b) {
        function c() {
          try {
            r.doScroll("left");
          } catch (a) {
            setTimeout(c, 50);
            return;
          }

          d("poll");
        }

        function d(c) {
          if (!(c.type == "readystatechange" && f.readyState != "complete") && ((c.type == "load" ? a : f).detachEvent("on" + c.type, d, !1), !e && (e = !0))) b.call(a, c.type || c);
        }

        var e = !1,
            h = !0;
        if (f.readyState == "complete") b.call(a, j);else {
          if (f.createEventObject && r.doScroll) {
            try {
              h = !a.frameElement;
            } catch (g) {}

            h && c();
          }

          k(f, "readystatechange", d);
          k(a, "load", d);
        }
      })(i, function () {
        for (var a in A) {
          var b,
              c,
              d = i;

          if (i[a]) {
            for (b = A[a].replace("*", a).split("."); (c = b.shift()) && (d = d[c]);) {
              ;
            }

            if (typeof d == "function") {
              w = d;
              Y();
              break;
            }
          }
        }
      });
    }
  }
})(this);