UNPKG

googlemaps-v3-utility-library

Version:
3,678 lines 86.9 kB
(function(){function aa() {
  return function(a) {
    return a
  }
}
function ba() {
  return function() {
  }
}
function g(a) {
  return function() {
    return this[a]
  }
}
function m(a) {
  return function() {
    return a
  }
}
var p, q = this;
function ca() {
}
function da(a) {
  a.W = function() {
    return a.ic || (a.ic = new a)
  }
}
function ea(a) {
  var b = typeof a;
  if(b == "object") {
    if(a) {
      if(a instanceof Array || !(a instanceof Object) && Object.prototype.toString.call(a) == "[object Array]" || typeof a.length == "number" && typeof a.splice != "undefined" && typeof a.propertyIsEnumerable != "undefined" && !a.propertyIsEnumerable("splice")) {
        return"array"
      }
      if(!(a instanceof Object) && (Object.prototype.toString.call(a) == "[object Function]" || typeof a.call != "undefined" && typeof a.propertyIsEnumerable != "undefined" && !a.propertyIsEnumerable("call"))) {
        return"function"
      }
    }else {
      return"null"
    }
  }else {
    if(b == "function" && typeof a.call == "undefined") {
      return"object"
    }
  }
  return b
}
function r(a) {
  return ea(a) == "array"
}
function fa(a) {
  var b = ea(a);
  return b == "array" || b == "object" && typeof a.length == "number"
}
function s(a) {
  return typeof a == "string"
}
function t(a) {
  return ea(a) == "function"
}
function ga(a) {
  a = ea(a);
  return a == "object" || a == "array" || a == "function"
}
function u(a) {
  if(a.hasOwnProperty && a.hasOwnProperty(ha)) {
    return a[ha]
  }
  a[ha] || (a[ha] = ++ia);
  return a[ha]
}
var ha = "closure_uid_" + Math.floor(Math.random() * 2147483648).toString(36), ia = 0;
function ja(a) {
  var b = Array.prototype.slice.call(arguments, 1);
  return function() {
    var c = Array.prototype.slice.call(arguments);
    c.unshift.apply(c, b);
    return a.apply(this, c)
  }
}
function v(a, b) {
  function c() {
  }
  c.prototype = b.prototype;
  a.c = b.prototype;
  a.prototype = new c;
  a.prototype.constructor = a
}
;/*
 http://google-maps-utility-library-v3.googlecode.com
*/
var w = Math.PI / 180, ka = 0;
window.ags_jsonp = window.ags_jsonp || {};
var y = google.maps, la, ma, na, oa = {Mb:null, xb:false}, z = {}, A = {};
function B(a, b, c) {
  var d = b === "" ? 0 : a.indexOf(b);
  return a.substring(d + b.length, c === "" ? a.length : a.indexOf(c, d + b.length))
}
function C(a, b, c) {
  if(a && b) {
    var d;
    for(d in a) {
      if(c || !(d in b)) {
        b[d] = a[d]
      }
    }
  }
  return b
}
function pa() {
  y.event.trigger.apply(this, arguments)
}
function qa(a, b) {
  var c = "";
  if(a) {
    c += a.getTime() - a.getTimezoneOffset() * 6E4
  }
  if(b) {
    c += ", " + (b.getTime() - b.getTimezoneOffset() * 6E4)
  }
  return c
}
function ra(a, b) {
  b = Math.min(Math.max(b, 0), 1);
  if(a) {
    var c = a.style;
    if(typeof c.opacity !== "undefined") {
      c.opacity = b
    }
    if(typeof c.filters !== "undefined") {
      c.filters.alpha.opacity = Math.floor(100 * b)
    }
    if(typeof c.filter !== "undefined") {
      c.filter = "alpha(opacity:" + Math.floor(b * 100) + ")"
    }
  }
}
function sa(a) {
  var b = "";
  for(var c in a) {
    if(a.hasOwnProperty(c)) {
      if(b.length > 0) {
        b += ";"
      }
      b += c + ":" + a[c]
    }
  }
  return b
}
function ta() {
  if(typeof XMLHttpRequest === "undefined") {
    try {
      return new ActiveXObject("Msxml2.XMLHTTP.6.0")
    }catch(a) {
    }
    try {
      return new ActiveXObject("Msxml2.XMLHTTP.3.0")
    }catch(b) {
    }
    try {
      return new ActiveXObject("Msxml2.XMLHTTP")
    }catch(c) {
    }
    throw new Error("This browser does not support XMLHttpRequest.");
  }else {
    return new XMLHttpRequest
  }
}
var va = "esriGeometryPoint", wa = "esriGeometryMultipoint", xa = "esriGeometryPolyline", ya = "esriGeometryPolygon", za = "esriGeometryEnvelope";
function Aa(a) {
  var b = a;
  if(a && a.splice && a.length > 0) {
    b = a[0]
  }
  if(b instanceof y.LatLng || b instanceof y.Marker) {
    return a && a.splice && a.length > 1 ? wa : va
  }else {
    if(b instanceof y.Polyline) {
      return xa
    }else {
      if(b instanceof y.Polygon) {
        return ya
      }else {
        if(b instanceof y.LatLngBounds) {
          return za
        }else {
          if(b.x !== undefined && b.y !== undefined) {
            return va
          }else {
            if(b.points) {
              return wa
            }else {
              if(b.paths) {
                return xa
              }else {
                if(b.rings) {
                  return ya
                }
              }
            }
          }
        }
      }
    }
  }
  return null
}
function Ba(a) {
  var b = a;
  if(a && a.splice && a.length > 0) {
    b = a[0]
  }
  if(b && b.splice && b.length > 0) {
    b = b[0]
  }
  if(b instanceof y.LatLng || b instanceof y.Marker || b instanceof y.Polyline || b instanceof y.Polygon || b instanceof y.LatLngBounds) {
    return true
  }
  return false
}
function Ca(a, b) {
  for(var c = [], d, e = 0, f = a.getLength();e < f;e++) {
    d = a.getAt(e);
    c.push("[" + d.lng() + "," + d.lat() + "]")
  }
  b && c.length > 0 && c.push("[" + a.getAt(0).lng() + "," + a.getAt(0).lat() + "]");
  return c.join(",")
}
function Da(a) {
  var b, c, d, e = "{";
  switch(Aa(a)) {
    case va:
      b = a && a.splice ? a[0] : a;
      if(b instanceof y.Marker) {
        b = b.getPosition()
      }
      e += "x:" + b.lng() + ",y:" + b.lat();
      break;
    case wa:
      d = [];
      for(c = 0;c < a.length;c++) {
        b = a[c] instanceof y.Marker ? a[c].getPosition() : a[c];
        d.push("[" + b.lng() + "," + b.lat() + "]")
      }
      e += "points: [" + d.join(",") + "]";
      break;
    case xa:
      d = [];
      a = a && a.splice ? a : [a];
      for(c = 0;c < a.length;c++) {
        d.push("[" + Ca(a[c].getPath()) + "]")
      }
      e += "paths:[" + d.join(",") + "]";
      break;
    case ya:
      d = [];
      b = a && a.splice ? a[0] : a;
      a = b.getPaths();
      for(c = 0;c < a.getLength();c++) {
        d.push("[" + Ca(a.getAt(c), true) + "]")
      }
      e += "rings:[" + d.join(",") + "]";
      break;
    case za:
      b = a && a.splice ? a[0] : a;
      e += "xmin:" + b.getSouthWest().lng() + ",ymin:" + b.getSouthWest().lat() + ",xmax:" + b.getNorthEast().lng() + ",ymax:" + b.getNorthEast().lat();
      break
  }
  e += ", spatialReference:{wkid:4326}";
  e += "}";
  return e
}
function Ea(a) {
  var b;
  if(typeof a === "object") {
    if(a && a.splice) {
      b = [];
      for(var c = 0, d = a.length;c < d;c++) {
        b.push(Ea(a[c]))
      }
      return"[" + b.join(",") + "]"
    }else {
      if(Ba(a)) {
        return Da(a)
      }else {
        if(a.toJSON) {
          return a.toJSON()
        }else {
          b = "";
          for(c in a) {
            if(a.hasOwnProperty(c)) {
              if(b.length > 0) {
                b += ", "
              }
              b += c + ":" + Ea(a[c])
            }
          }
          return"{" + b + "}"
        }
      }
    }
  }
  return a.toString()
}
function Fa(a) {
  var b = "";
  if(a) {
    a.f = a.f || "json";
    for(var c in a) {
      if(a.hasOwnProperty(c) && a[c] !== null && a[c] !== undefined) {
        var d = Ea(a[c]);
        b += (b.length > 0 ? "&" : "") + (c + "=" + (escape ? escape(d) : encodeURIComponent(d)))
      }
    }
  }
  return b
}
function Ga(a, b) {
  for(var c = [], d = 2, e = arguments.length;d < e;d++) {
    c.push(arguments[d])
  }
  return function() {
    a.apply(b, c)
  }
}
function Ha(a, b, c) {
  b.lb ? a.push(b.copyrightText) : y.event.addListenerOnce(b, "load", function() {
    Ia(c)
  })
}
function Ia(a) {
  var b = null;
  if(a) {
    var c = a.controls[y.ControlPosition.BOTTOM_RIGHT];
    if(c) {
      for(var d = 0, e = c.getLength();d < e;d++) {
        if(c.getAt(d).id === "agsCopyrights") {
          b = c.getAt(d);
          break
        }
      }
    }
    if(!b) {
      b = document.createElement("div");
      b.style.fontFamily = "Arial,sans-serif";
      b.style.fontSize = "10px";
      b.style.textAlign = "right";
      b.id = "agsCopyrights";
      a.controls[y.ControlPosition.BOTTOM_RIGHT].push(b);
      y.event.addListener(a, "maptypeid_changed", function() {
        Ia(a)
      })
    }
    var f = a.agsOverlays;
    c = [];
    if(f) {
      d = 0;
      for(e = f.getLength();d < e;d++) {
        Ha(c, f.getAt(d).Ib, a)
      }
    }
    var h = a.overlayMapTypes;
    if(h) {
      d = 0;
      for(e = h.getLength();d < e;d++) {
        f = h.getAt(d)
      }
    }
    f = a.mapTypes.get(a.getMapTypeId());
    b.innerHTML = c.join("<br/>")
  }
}
function Ja(a, b, c, d) {
  var e = "ags_jsonp_" + ka++ + "_" + Math.floor(Math.random() * 1E6), f = null;
  b = b || {};
  b[c || "callback"] = "ags_jsonp." + e;
  b = Fa(b);
  var h = document.getElementsByTagName("head")[0];
  if(!h) {
    throw new Error("document must have header tag");
  }
  window.ags_jsonp[e] = function() {
    window.ags_jsonp[e] && delete window.ags_jsonp[e];
    f && h.removeChild(f);
    f = null;
    d.apply(null, arguments);
    pa(A, "jsonpend", e)
  };
  if((b + a).length < 2E3 && !oa.xb) {
    f = document.createElement("script");
    f.src = a + (a.indexOf("?") === -1 ? "?" : "&") + b;
    f.id = e;
    h.appendChild(f)
  }else {
    c = window.location;
    c = c.protocol + "//" + c.hostname + (!c.port || c.port === 80 ? "" : ":" + c.port + "/");
    var i = true;
    if(a.toLowerCase().indexOf(c.toLowerCase()) !== -1) {
      i = false
    }
    if(oa.xb) {
      i = true
    }
    if(i && !oa.Mb) {
      throw new Error("No proxyUrl property in Config is defined");
    }
    var j = ta();
    j.onreadystatechange = function() {
      if(j.readyState === 4) {
        if(j.status === 200) {
          eval(j.responseText)
        }else {
          throw new Error("Error code " + j.status);
        }
      }
    };
    j.open("POST", i ? oa.Mb + "?" + a : a, true);
    j.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    j.send(b)
  }
  pa(A, "jsonpstart", e);
  return e
}
A.Ac = function(a, b, c, d) {
  Ja(a, b, c, d)
};
A.wb = function(a, b) {
  if(b && b.splice) {
    for(var c, d = 0, e = b.length;d < e;d++) {
      if((c = b[d]) && c.splice) {
        A.wb(a, c)
      }else {
        Ba(c) && c.setMap(a)
      }
    }
  }
};
A.Dc = function(a, b) {
  A.wb(null, a);
  if(b) {
    a.length = 0
  }
};
function D(a) {
  a = a || {};
  this.wkid = a.wkid;
  this.wkt = a.wkt
}
D.prototype.forward = aa();
D.prototype.ha = aa();
D.prototype.fa = m(360);
D.prototype.toJSON = function() {
  return"{" + (this.wkid ? " wkid:" + this.wkid : "wkt: '" + this.wkt + "'") + "}"
};
function Ka(a) {
  a = a || {};
  D.call(this, a)
}
Ka.prototype = new D;
function La(a) {
  a = a || {};
  D.call(this, a);
  var b = a.ib, c = a.tb * w, d = a.ub * w, e = a.kb * w;
  this.e = a.la / a.unit;
  this.A = a.ea * w;
  this.P = a.$a;
  this.Q = a.ab;
  a = 1 / b;
  b = 2 * a - a * a;
  this.w = Math.sqrt(b);
  a = this.R(c, b);
  b = this.R(d, b);
  e = Ma(this, e, this.w);
  c = Ma(this, c, this.w);
  d = Ma(this, d, this.w);
  this.k = Math.log(a / b) / Math.log(c / d);
  this.Ua = a / (this.k * Math.pow(c, this.k));
  this.O = this.na(this.e, this.Ua, e, this.k)
}
La.prototype = new D;
La.prototype.R = function(a, b) {
  var c = Math.sin(a);
  return Math.cos(a) / Math.sqrt(1 - b * c * c)
};
function Ma(a, b, c) {
  a = c * Math.sin(b);
  return Math.tan(Math.PI / 4 - b / 2) / Math.pow((1 - a) / (1 + a), c / 2)
}
p = La.prototype;
p.na = function(a, b, c, d) {
  return a * b * Math.pow(c, d)
};
p.ma = function(a, b, c) {
  c = b * Math.sin(c);
  return Math.PI / 2 - 2 * Math.atan(a * Math.pow((1 - c) / (1 + c), b / 2))
};
p.sb = function(a, b, c) {
  var d = 0;
  c = c;
  for(var e = this.ma(a, b, c);Math.abs(e - c) > 1.0E-9 && d < 10;) {
    d++;
    c = e;
    e = this.ma(a, b, c)
  }
  return e
};
p.forward = function(a) {
  var b = a[0] * w;
  a = this.na(this.e, this.Ua, Ma(this, a[1] * w, this.w), this.k);
  b = this.k * (b - this.A);
  return[this.P + a * Math.sin(b), this.Q + this.O - a * Math.cos(b)]
};
p.ha = function(a) {
  var b = a[0] - this.P, c = a[1] - this.Q;
  a = Math.atan(b / (this.O - c));
  b = Math.pow((this.k > 0 ? 1 : -1) * Math.sqrt(b * b + (this.O - c) * (this.O - c)) / (this.e * this.Ua), 1 / this.k);
  return[(a / this.k + this.A) / w, this.sb(b, this.w, Math.PI / 2 - 2 * Math.atan(b)) / w]
};
p.fa = function() {
  return Math.PI * 2 * this.e
};
function Na(a) {
  a = a || {};
  D.call(this, a);
  this.e = a.la / a.unit;
  var b = a.ib;
  this.Ja = a.vc;
  var c = a.kb * w;
  this.A = a.ea * w;
  this.P = a.$a;
  this.Q = a.ab;
  a = 1 / b;
  this.q = 2 * a - a * a;
  this.Ea = this.q * this.q;
  this.Za = this.Ea * this.q;
  this.$ = this.q / (1 - this.q);
  this.vb = this.R(c, this.e, this.q, this.Ea, this.Za)
}
Na.prototype = new D;
Na.prototype.R = function(a, b, c, d, e) {
  return b * ((1 - c / 4 - 3 * d / 64 - 5 * e / 256) * a - (3 * c / 8 + 3 * d / 32 + 45 * e / 1024) * Math.sin(2 * a) + (15 * d / 256 + 45 * e / 1024) * Math.sin(4 * a) - 35 * e / 3072 * Math.sin(6 * a))
};
Na.prototype.forward = function(a) {
  var b = a[1] * w, c = a[0] * w;
  a = this.e / Math.sqrt(1 - this.q * Math.pow(Math.sin(b), 2));
  var d = Math.pow(Math.tan(b), 2), e = this.$ * Math.pow(Math.cos(b), 2);
  c = (c - this.A) * Math.cos(b);
  var f = this.R(b, this.e, this.q, this.Ea, this.Za);
  return[this.P + this.Ja * a * (c + (1 - d + e) * Math.pow(c, 3) / 6 + (5 - 18 * d + d * d + 72 * e - 58 * this.$) * Math.pow(c, 5) / 120), this.Q + this.Ja * (f - this.vb) + a * Math.tan(b) * (c * c / 2 + (5 - d + 9 * e + 4 * e * e) * Math.pow(c, 4) / 120 + (61 - 58 * d + d * d + 600 * e - 330 * this.$) * Math.pow(c, 6) / 720)]
};
Na.prototype.ha = function(a) {
  var b = a[0], c = a[1];
  a = (1 - Math.sqrt(1 - this.q)) / (1 + Math.sqrt(1 - this.q));
  c = (this.vb + (c - this.Q) / this.Ja) / (this.e * (1 - this.q / 4 - 3 * this.Ea / 64 - 5 * this.Za / 256));
  a = c + (3 * a / 2 - 27 * Math.pow(a, 3) / 32) * Math.sin(2 * c) + (21 * a * a / 16 - 55 * Math.pow(a, 4) / 32) * Math.sin(4 * c) + 151 * Math.pow(a, 3) / 6 * Math.sin(6 * c) + 1097 * Math.pow(a, 4) / 512 * Math.sin(8 * c);
  c = this.$ * Math.pow(Math.cos(a), 2);
  var d = Math.pow(Math.tan(a), 2), e = this.e / Math.sqrt(1 - this.q * Math.pow(Math.sin(a), 2)), f = this.e * (1 - this.q) / Math.pow(1 - this.q * Math.pow(Math.sin(a), 2), 1.5);
  b = (b - this.P) / (e * this.Ja);
  e = a - e * Math.tan(a) / f * (b * b / 2 - (5 + 3 * d + 10 * c - 4 * c * c - 9 * this.$) * Math.pow(b, 4) / 24 + (61 + 90 * d + 28 * c + 45 * d * d - 252 * this.$ - 3 * c * c) * Math.pow(b, 6) / 720);
  return[(this.A + (b - (1 + 2 * d + c) * Math.pow(b, 3) / 6 + (5 - 2 * c + 28 * d - 3 * c * c + 8 * this.$ + 24 * d * d) * Math.pow(b, 5) / 120) / Math.cos(a)) / w, e / w]
};
Na.prototype.fa = function() {
  return Math.PI * 2 * this.e
};
function Oa(a) {
  a = a || {};
  D.call(this, a);
  this.e = (a.la || 6378137) / (a.unit || 1);
  this.A = (a.ea || 0) * w
}
Oa.prototype = new D;
Oa.prototype.forward = function(a) {
  var b = a[1] * w;
  return[this.e * (a[0] * w - this.A), this.e / 2 * Math.log((1 + Math.sin(b)) / (1 - Math.sin(b)))]
};
Oa.prototype.ha = function(a) {
  return[(a[0] / this.e + this.A) / w, (Math.PI / 2 - 2 * Math.atan(Math.exp(-a[1] / this.e))) / w]
};
Oa.prototype.fa = function() {
  return Math.PI * 2 * this.e
};
function Pa(a) {
  a = a || {};
  D.call(this, a);
  var b = a.ib, c = a.tb * w, d = a.ub * w, e = a.kb * w;
  this.e = a.la / a.unit;
  this.A = a.ea * w;
  this.P = a.$a;
  this.Q = a.ab;
  a = 1 / b;
  b = 2 * a - a * a;
  this.w = Math.sqrt(b);
  a = this.R(c, b);
  b = this.R(d, b);
  c = Qa(this, c, this.w);
  d = Qa(this, d, this.w);
  e = Qa(this, e, this.w);
  this.k = (a * a - b * b) / (d - c);
  this.Ta = a * a + this.k * c;
  this.O = this.na(this.e, this.Ta, this.k, e)
}
Pa.prototype = new D;
Pa.prototype.R = function(a, b) {
  var c = Math.sin(a);
  return Math.cos(a) / Math.sqrt(1 - b * c * c)
};
function Qa(a, b, c) {
  a = c * Math.sin(b);
  return(1 - c * c) * (Math.sin(b) / (1 - a * a) - 1 / (2 * c) * Math.log((1 - a) / (1 + a)))
}
p = Pa.prototype;
p.na = function(a, b, c, d) {
  return a * Math.sqrt(b - c * d) / c
};
p.ma = function(a, b, c) {
  var d = b * Math.sin(c);
  return c + (1 - d * d) * (1 - d * d) / (2 * Math.cos(c)) * (a / (1 - b * b) - Math.sin(c) / (1 - d * d) + Math.log((1 - d) / (1 + d)) / (2 * b))
};
p.sb = function(a, b, c) {
  var d = 0;
  c = c;
  for(var e = this.ma(a, b, c);Math.abs(e - c) > 1.0E-8 && d < 10;) {
    d++;
    c = e;
    e = this.ma(a, b, c)
  }
  return e
};
p.forward = function(a) {
  var b = a[0] * w;
  a = this.na(this.e, this.Ta, this.k, Qa(this, a[1] * w, this.w));
  b = this.k * (b - this.A);
  return[this.P + a * Math.sin(b), this.Q + this.O - a * Math.cos(b)]
};
p.ha = function(a) {
  var b = a[0] - this.P;
  a = a[1] - this.Q;
  var c = Math.sqrt(b * b + (this.O - a) * (this.O - a)), d = this.k > 0 ? 1 : -1;
  c = (this.Ta - c * c * this.k * this.k / (this.e * this.e)) / this.k;
  return[(Math.atan(d * b / (d * this.O - d * a)) / this.k + this.A) / w, this.sb(c, this.w, Math.asin(c / 2)) / w]
};
p.fa = function() {
  return Math.PI * 2 * this.e
};
p.fa = function() {
  return Math.PI * 2 * this.e
};
la = new Ka({wkid:4326});
ma = new Ka({wkid:4269});
na = new Oa({wkid:102113, la:6378137, ea:0, unit:1});
z = {"4326":la, "4269":ma, "102113":na, "102100":new Oa({wkid:102100, la:6378137, ea:0, unit:1})};
A.uc = function(a, b) {
  var c = z["" + a];
  if(c) {
    return c
  }
  if(b instanceof D) {
    c = z["" + a] = b
  }else {
    c = b || a;
    var d = {wkt:a};
    if(a === parseInt(a, 10)) {
      d = {wkid:a}
    }
    var e = B(c, 'PROJECTION["', '"]'), f = B(c, "SPHEROID[", "]").split(",");
    if(e !== "") {
      d.unit = parseFloat(B(B(c, "PROJECTION", ""), "UNIT[", "]").split(",")[1]);
      d.la = parseFloat(f[1]);
      d.ib = parseFloat(f[2]);
      d.kb = parseFloat(B(c, '"Latitude_Of_Origin",', "]"));
      d.ea = parseFloat(B(c, '"Central_Meridian",', "]"));
      d.$a = parseFloat(B(c, '"False_Easting",', "]"));
      d.ab = parseFloat(B(c, '"False_Northing",', "]"))
    }
    switch(e) {
      case "":
        c = new D(d);
        break;
      case "Lambert_Conformal_Conic":
        d.tb = parseFloat(B(c, '"Standard_Parallel_1",', "]"));
        d.ub = parseFloat(B(c, '"Standard_Parallel_2",', "]"));
        c = new La(d);
        break;
      case "Transverse_Mercator":
        d.vc = parseFloat(B(c, '"Scale_Factor",', "]"));
        c = new Na(d);
        break;
      case "Albers":
        d.tb = parseFloat(B(c, '"Standard_Parallel_1",', "]"));
        d.ub = parseFloat(B(c, '"Standard_Parallel_2",', "]"));
        c = new Pa(d);
        break;
      default:
        throw new Error(e + "  not supported");
    }
    if(c) {
      z["" + a] = c
    }
  }
  return c
};
function Ra(a) {
  this.url = a;
  this.definition = null
}
function Sa(a, b) {
  this.url = a;
  this.lb = false;
  var c = a.split("/");
  this.name = c[c.length - 2].replace(/_/g, " ");
  b = b || {};
  if(b.Tb) {
    var d = this;
    window.setTimeout(function() {
      Ta(d)
    }, b.Tb * 1E3)
  }else {
    Ta(this)
  }
}
function Ta(a) {
  Ja(a.url, {}, "", function(b) {
    Ua(a, b)
  })
}
function Ua(a, b) {
  if(b.error) {
    throw new Error(b.error.message);
  }
  C(b, a);
  a.spatialReference = b.spatialReference.wkt ? A.uc(b.spatialReference.wkt) : z[b.spatialReference.wkid];
  if(b.tables !== undefined) {
    Ja(a.url + "/layers", {}, "", function(c) {
      Va(a, c);
      Ja(a.url + "/legend", {}, "", function(d) {
        var e = a.layers;
        if(d.layers) {
          var f, h, i, j;
          h = 0;
          for(i = d.layers.length;h < i;h++) {
            j = d.layers[h];
            f = e[j.layerId];
            C(j, f)
          }
        }
        Wa(a)
      })
    })
  }else {
    Va(a, b);
    Wa(a)
  }
}
function Wa(a) {
  a.lb = true;
  pa(a, "load")
}
function Va(a, b) {
  var c = [], d = [];
  a.layers = c;
  if(b.tables) {
    a.tables = d
  }
  var e, f, h, i;
  f = 0;
  for(h = b.layers.length;f < h;f++) {
    i = b.layers[f];
    e = new Ra(a.url + "/" + i.id);
    C(i, e);
    e.visible = e.defaultVisibility;
    c.push(e)
  }
  if(b.tables) {
    f = 0;
    for(h = b.tables.length;f < h;f++) {
      i = b.tables[f];
      e = new Ra(a.url + "/" + i.id);
      C(i, e);
      d.push(e)
    }
  }
  f = 0;
  for(h = c.length;f < h;f++) {
    e = c[f];
    if(e.subLayerIds) {
      e.subLayers = [];
      d = 0;
      for(i = e.subLayerIds.length;d < i;d++) {
        var j;
        a: {
          j = e.subLayerIds[d];
          var k = a.layers;
          if(k) {
            for(var n = 0, l = k.length;n < l;n++) {
              if(j === k[n].id) {
                j = k[n];
                break a
              }
              if(j && typeof j === "string" && k[n].name.toLowerCase() === j.toLowerCase()) {
                j = k[n];
                break a
              }
            }
          }
          j = null
        }
        e.subLayers.push(j);
        j.Cc = e
      }
    }
  }
}
function Xa(a) {
  var b = {};
  if(a.layers) {
    for(var c = 0, d = a.layers.length;c < d;c++) {
      var e = a.layers[c];
      if(e.definition) {
        b[String(e.id)] = e.definition
      }
    }
  }
  return b
}
function $a(a) {
  var b = [];
  if(a.layers) {
    var c, d, e;
    d = 0;
    for(e = a.layers.length;d < e;d++) {
      c = a.layers[d];
      if(c.subLayers) {
        for(var f = 0, h = c.subLayers.length;f < h;f++) {
          if(c.subLayers[f].visible === false) {
            c.visible = false;
            break
          }
        }
      }
    }
    d = 0;
    for(e = a.layers.length;d < e;d++) {
      c = a.layers[d];
      c.subLayers && c.subLayers.length > 0 || c.visible === true && b.push(c.id)
    }
  }
  return b
}
function ab(a, b, c, d) {
  if(b && b.bounds) {
    var e = {};
    e.f = b.f;
    var f = b.bounds;
    e.bbox = "" + f.getSouthWest().lng() + "," + f.getSouthWest().lat() + "," + f.getNorthEast().lng() + "," + f.getNorthEast().lat();
    e.size = "" + b.width + "," + b.height;
    e.dpi = b.dpi;
    if(b.imageSR) {
      e.imageSR = b.imageSR.wkid ? b.imageSR.wkid : "{wkt:" + b.imageSR.wkt + "}"
    }
    e.bboxSR = "4326";
    e.format = b.format;
    f = b.layerDefinitions;
    if(f === undefined) {
      f = Xa(a)
    }
    e.layerDefs = sa(f);
    f = b.layerIds;
    var h = b.layerOption || "show";
    if(f === undefined) {
      f = $a(a)
    }
    if(f.length > 0) {
      e.layers = h + ":" + f.join(",")
    }else {
      if(a.lb && c) {
        c({href:null});
        return
      }
    }
    e.transparent = b.transparent === false ? false : true;
    if(b.time) {
      e.time = qa(b.time, b.yc)
    }
    e.jc = b.jc;
    if(e.f === "image") {
      return a.url + "/export?" + Fa(e)
    }else {
      Ja(a.url + "/export", e, "", function(i) {
        if(i.extent) {
          var j, k = i.extent, n = z[k.spatialReference.wkid || k.spatialReference.wkt];
          n = n || la;
          j = n.ha([k.xmin, k.ymin]);
          k = n.ha([k.xmax, k.ymax]);
          j = new y.LatLngBounds(new y.LatLng(j[1], j[0]), new y.LatLng(k[1], k[0]));
          i.bounds = j;
          delete i.extent;
          c(i)
        }else {
          i = i.error;
          d && i && i.error && d(i.error)
        }
      })
    }
  }
}
function bb(a, b, c, d) {
  if(b) {
    var e = {};
    e.geometry = Da(b.geometry);
    e.geometryType = Aa(b.geometry);
    e.mapExtent = Da(b.bounds);
    e.tolerance = b.tolerance || 2;
    e.sr = 4326;
    e.imageDisplay = "" + b.width + "," + b.height + "," + (b.dpi || 96);
    e.layers = b.layerOption || "all";
    if(b.layerIds) {
      e.layers += ":" + b.layerIds.join(",")
    }
    if(b.layerDefs) {
      e.layerDefs = sa(b.layerDefs)
    }
    e.mc = b.mc;
    e.returnGeometry = b.returnGeometry === false ? false : true;
    Ja(a.url + "/identify", e, "", function(f) {
      var h, i, j;
      if(f.results) {
        for(h = 0;h < f.results.length;h++) {
          i = f.results[h];
          a: {
            j = i.geometry;
            var k = b.overlayOptions, n = null, l = void 0, o = void 0, x = void 0;
            l = void 0;
            var Ac = void 0, Ya = void 0, ua = void 0, Eb = void 0, Za = void 0;
            k = k || {};
            if(j) {
              n = [];
              if(j.x) {
                l = new y.Marker(C(k.markerOptions || k, {position:new y.LatLng(j.y, j.x)}));
                n.push(l)
              }else {
                Ya = j.points || j.paths || j.rings;
                if(!Ya) {
                  j = n;
                  break a
                }
                var Bc = [];
                o = 0;
                for(x = Ya.length;o < x;o++) {
                  ua = Ya[o];
                  if(j.points) {
                    l = new y.Marker(C(k.markerOptions || k, {position:new y.LatLng(ua[1], ua[0])}));
                    n.push(l)
                  }else {
                    Za = [];
                    l = 0;
                    for(Ac = ua.length;l < Ac;l++) {
                      Eb = ua[l];
                      Za.push(new y.LatLng(Eb[1], Eb[0]))
                    }
                    if(j.paths) {
                      l = new y.Polyline(C(k.polylineOptions || k, {path:Za}));
                      n.push(l)
                    }else {
                      j.rings && Bc.push(Za)
                    }
                  }
                }
                if(j.rings) {
                  l = new y.Polygon(C(k.tc || k, {paths:Bc}));
                  n.push(l)
                }
              }
            }
            j = n
          }
          i.bb = {geometry:j, attributes:i.attributes};
          delete i.attributes
        }
      }
      c(f);
      d && f && f.error && d(f.error)
    })
  }
}
function cb(a) {
  this.lc = a ? a.lods : null;
  this.Ra = a ? z[a.spatialReference.wkid || a.spatialReference.wkt] : na;
  if(!this.Ra) {
    throw new Error("unsupported Spatial Reference");
  }
  this.Nb = a ? a.lods[0].resolution : 156543.033928;
  this.minZoom = Math.floor(Math.log(this.Ra.fa() / this.Nb / 256) / Math.LN2 + 0.5);
  this.maxZoom = a ? this.minZoom + this.lc.length - 1 : 20;
  if(y.Size) {
    this.Fc = a ? new y.Size(a.cols, a.rows) : new y.Size(256, 256)
  }
  this.Ob = Math.pow(2, this.minZoom) * this.Nb;
  this.qc = a ? a.origin.x : -2.0037508342787E7;
  this.rc = a ? a.origin.y : 2.0037508342787E7;
  if(a) {
    for(var b, c = 0;c < a.lods.length - 1;c++) {
      b = a.lods[c].resolution / a.lods[c + 1].resolution;
      if(b > 2.001 || b < 1.999) {
        throw new Error("This type of map cache is not supported in V3. \nScale ratio between zoom levels must be 2");
      }
    }
  }
}
cb.prototype.fromLatLngToPoint = function(a, b) {
  if(!a || isNaN(a.lat()) || isNaN(a.lng())) {
    return null
  }
  var c = this.Ra.forward([a.lng(), a.lat()]), d = b || new y.Point(0, 0);
  d.x = (c[0] - this.qc) / this.Ob;
  d.y = (this.rc - c[1]) / this.Ob;
  return d
};
cb.prototype.fromLatLngToPoint = cb.prototype.fromLatLngToPoint;
new cb;
function E(a, b) {
  b = b || {};
  this.Ib = a instanceof Sa ? a : new Sa(a);
  this.minZoom = b.minZoom;
  this.maxZoom = b.maxZoom;
  this.Oa = b.opacity || 1;
  this.Ub = b.zc || {};
  this.Na = this.Ca = false;
  this.U = null;
  b.map && this.setMap(b.map);
  this.mb = null
}
E.prototype = new y.OverlayView;
E.prototype.onAdd = function() {
  var a = document.createElement("div");
  a.style.position = "absolute";
  a.style.border = "none";
  this.U = a;
  this.getPanes().overlayLayer.appendChild(a);
  this.Oa && ra(a, this.Oa);
  this.Sb = y.event.addListener(this.getMap(), "bounds_changed", Ga(this.nb, this));
  a = this.getMap();
  a.agsOverlays = a.agsOverlays || new y.MVCArray;
  a.agsOverlays.push(this);
  Ia(a);
  this.mb = a
};
E.prototype.onAdd = E.prototype.onAdd;
E.prototype.onRemove = function() {
  y.event.removeListener(this.Sb);
  this.U.parentNode.removeChild(this.U);
  this.U = null;
  var a = this.mb, b = a.agsOverlays;
  if(b) {
    for(var c = 0, d = b.getLength();c < d;c++) {
      if(b.getAt(c) == this) {
        b.removeAt(c);
        break
      }
    }
  }
  Ia(a);
  this.mb = null
};
E.prototype.onRemove = E.prototype.onRemove;
E.prototype.draw = function() {
  if(!this.Ca || this.Na === true) {
    this.nb()
  }
};
E.prototype.draw = E.prototype.draw;
E.prototype.nb = function() {
  if(this.Ca === true) {
    this.Na = true
  }else {
    var a = this.getMap(), b = a ? a.getBounds() : null;
    if(b) {
      var c = this.Ub;
      c.bounds = b;
      b = na;
      var d = a.getDiv();
      c.width = d.offsetWidth;
      c.height = d.offsetHeight;
      if(!(d.offsetWidth == 0 || d.offsetHeight == 0)) {
        if((a = a.getProjection()) && a instanceof cb) {
          b = a.Ra
        }
        c.imageSR = b;
        pa(this, "drawstart");
        var e = this;
        this.Ca = true;
        this.U.style.backgroundImage = "";
        ab(this.Ib, c, function(f) {
          e.Ca = false;
          if(e.Na === true) {
            e.Na = false;
            e.nb()
          }else {
            if(f.href) {
              var h = e.getProjection(), i = f.bounds, j = h.fromLatLngToDivPixel(i.getSouthWest());
              h = h.fromLatLngToDivPixel(i.getNorthEast());
              i = e.U;
              i.style.left = j.x + "px";
              i.style.top = h.y + "px";
              i.style.width = h.x - j.x + "px";
              i.style.height = j.y - h.y + "px";
              e.U.style.backgroundImage = "url(" + f.href + ")";
              f = Math.min(Math.max(e.Oa, 0), 1);
              e.Oa = f;
              ra(e.U, f)
            }
            pa(e, "drawend")
          }
        })
      }
    }
  }
};
var db = Sa;function eb(a) {
  this.stack = (new Error).stack || "";
  if(a) {
    this.message = String(a)
  }
}
v(eb, Error);
eb.prototype.name = "CustomError";function fb(a) {
  for(var b = 1;b < arguments.length;b++) {
    var c = String(arguments[b]).replace(/\$/g, "$$$$");
    a = a.replace(/\%s/, c)
  }
  return a
}
function gb(a, b) {
  if(b) {
    return a.replace(hb, "&amp;").replace(ib, "&lt;").replace(jb, "&gt;").replace(kb, "&quot;")
  }else {
    if(!lb.test(a)) {
      return a
    }
    if(a.indexOf("&") != -1) {
      a = a.replace(hb, "&amp;")
    }
    if(a.indexOf("<") != -1) {
      a = a.replace(ib, "&lt;")
    }
    if(a.indexOf(">") != -1) {
      a = a.replace(jb, "&gt;")
    }
    if(a.indexOf('"') != -1) {
      a = a.replace(kb, "&quot;")
    }
    return a
  }
}
var hb = /&/g, ib = /</g, jb = />/g, kb = /\"/g, lb = /[&<>\"]/;
function mb(a, b) {
  for(var c = 0, d = String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), e = String(b).replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), f = Math.max(d.length, e.length), h = 0;c == 0 && h < f;h++) {
    var i = d[h] || "", j = e[h] || "", k = new RegExp("(\\d*)(\\D*)", "g"), n = new RegExp("(\\d*)(\\D*)", "g");
    do {
      var l = k.exec(i) || ["", "", ""], o = n.exec(j) || ["", "", ""];
      if(l[0].length == 0 && o[0].length == 0) {
        break
      }
      c = nb(l[1].length == 0 ? 0 : parseInt(l[1], 10), o[1].length == 0 ? 0 : parseInt(o[1], 10)) || nb(l[2].length == 0, o[2].length == 0) || nb(l[2], o[2])
    }while(c == 0)
  }
  return c
}
function nb(a, b) {
  if(a < b) {
    return-1
  }else {
    if(a > b) {
      return 1
    }
  }
  return 0
}
;function ob(a, b) {
  b.unshift(a);
  eb.call(this, fb.apply(null, b));
  b.shift();
  this.Bc = a
}
v(ob, eb);
ob.prototype.name = "AssertionError";
function pb(a, b) {
  if(!a) {
    var c = Array.prototype.slice.call(arguments, 2), d = "Assertion failed";
    if(b) {
      d += ": " + b;
      var e = c
    }
    throw new ob("" + d, e || []);
  }
}
;var F = Array.prototype, qb = F.indexOf ? function(a, b, c) {
  pb(a.length != null);
  return F.indexOf.call(a, b, c)
} : function(a, b, c) {
  c = c == null ? 0 : c < 0 ? Math.max(0, a.length + c) : c;
  if(s(a)) {
    if(!s(b) || b.length != 1) {
      return-1
    }
    return a.indexOf(b, c)
  }
  for(c = c;c < a.length;c++) {
    if(c in a && a[c] === b) {
      return c
    }
  }
  return-1
}, G = F.forEach ? function(a, b, c) {
  pb(a.length != null);
  F.forEach.call(a, b, c)
} : function(a, b, c) {
  for(var d = a.length, e = s(a) ? a.split("") : a, f = 0;f < d;f++) {
    f in e && b.call(c, e[f], f, a)
  }
}, rb = F.every ? function(a, b, c) {
  pb(a.length != null);
  return F.every.call(a, b, c)
} : function(a, b, c) {
  for(var d = a.length, e = s(a) ? a.split("") : a, f = 0;f < d;f++) {
    if(f in e && !b.call(c, e[f], f, a)) {
      return false
    }
  }
  return true
};
function sb(a, b) {
  return qb(a, b) >= 0
}
function tb(a, b) {
  var c = qb(a, b), d;
  if(d = c >= 0) {
    pb(a.length != null);
    F.splice.call(a, c, 1)
  }
  return d
}
function ub() {
  return F.concat.apply(F, arguments)
}
function vb(a) {
  if(r(a)) {
    return ub(a)
  }else {
    for(var b = [], c = 0, d = a.length;c < d;c++) {
      b[c] = a[c]
    }
    return b
  }
}
function wb(a) {
  pb(a.length != null);
  return F.splice.apply(a, xb(arguments, 1))
}
function xb(a, b, c) {
  pb(a.length != null);
  return arguments.length <= 2 ? F.slice.call(a, b) : F.slice.call(a, b, c)
}
;var yb;function zb(a) {
  return(a = a.className) && typeof a.split == "function" ? a.split(/\s+/) : []
}
function Ab(a) {
  var b = zb(a), c;
  c = xb(arguments, 1);
  for(var d = 0, e = 0;e < c.length;e++) {
    if(!sb(b, c[e])) {
      b.push(c[e]);
      d++
    }
  }
  c = d == c.length;
  a.className = b.join(" ");
  return c
}
function Bb(a) {
  var b = zb(a), c;
  c = xb(arguments, 1);
  for(var d = 0, e = 0;e < b.length;e++) {
    if(sb(c, b[e])) {
      wb(b, e--, 1);
      d++
    }
  }
  c = d == c.length;
  a.className = b.join(" ");
  return c
}
;function Cb(a, b, c) {
  for(var d in a) {
    b.call(c, a[d], d, a)
  }
}
function Db(a, b) {
  var c;
  if(c = b in a) {
    delete a[b]
  }
  return c
}
var Fb = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"];
function Gb(a) {
  for(var b, c, d = 1;d < arguments.length;d++) {
    c = arguments[d];
    for(b in c) {
      a[b] = c[b]
    }
    for(var e = 0;e < Fb.length;e++) {
      b = Fb[e];
      if(Object.prototype.hasOwnProperty.call(c, b)) {
        a[b] = c[b]
      }
    }
  }
}
function Hb() {
  var a = arguments.length;
  if(a == 1 && r(arguments[0])) {
    return Hb.apply(null, arguments[0])
  }
  if(a % 2) {
    throw Error("Uneven number of arguments");
  }
  for(var b = {}, c = 0;c < a;c += 2) {
    b[arguments[c]] = arguments[c + 1]
  }
  return b
}
;var Ib, Jb, Kb, Lb;
function Mb() {
  return q.navigator ? q.navigator.userAgent : null
}
Lb = Kb = Jb = Ib = false;
var Nb;
if(Nb = Mb()) {
  var Ob = q.navigator;
  Ib = Nb.indexOf("Opera") == 0;
  Jb = !Ib && Nb.indexOf("MSIE") != -1;
  Kb = !Ib && Nb.indexOf("WebKit") != -1;
  Lb = !Ib && !Kb && Ob.product == "Gecko"
}
var Pb = Ib, H = Jb, I = Lb, J = Kb, Qb = q.navigator, Rb = (Qb && Qb.platform || "").indexOf("Mac") != -1, Sb, Tb = "", Ub;
if(Pb && q.opera) {
  var Vb = q.opera.version;
  Tb = typeof Vb == "function" ? Vb() : Vb
}else {
  if(I) {
    Ub = /rv\:([^\);]+)(\)|;)/
  }else {
    if(H) {
      Ub = /MSIE\s+([^\);]+)(\)|;)/
    }else {
      if(J) {
        Ub = /WebKit\/(\S+)/
      }
    }
  }
  if(Ub) {
    var Wb = Ub.exec(Mb());
    Tb = Wb ? Wb[1] : ""
  }
}
Sb = Tb;
var Xb = {};
function Yb(a) {
  return Xb[a] || (Xb[a] = mb(Sb, a) >= 0)
}
;function Zb(a) {
  return a ? new $b(ac(a)) : yb || (yb = new $b)
}
function bc(a, b) {
  Cb(b, function(c, d) {
    if(d == "style") {
      a.style.cssText = c
    }else {
      if(d == "class") {
        a.className = c
      }else {
        if(d == "for") {
          a.htmlFor = c
        }else {
          if(d in cc) {
            a.setAttribute(cc[d], c)
          }else {
            a[d] = c
          }
        }
      }
    }
  })
}
var cc = {cellpadding:"cellPadding", cellspacing:"cellSpacing", colspan:"colSpan", rowspan:"rowSpan", valign:"vAlign", height:"height", width:"width", usemap:"useMap", frameborder:"frameBorder", type:"type"};
function dc() {
  return ec(document, arguments)
}
function ec(a, b) {
  var c = b[0], d = b[1];
  if(H && d && (d.name || d.type)) {
    c = ["<", c];
    d.name && c.push(' name="', gb(d.name), '"');
    if(d.type) {
      c.push(' type="', gb(d.type), '"');
      var e = {};
      Gb(e, d);
      d = e;
      delete d.type
    }
    c.push(">");
    c = c.join("")
  }
  c = a.createElement(c);
  if(d) {
    if(s(d)) {
      c.className = d
    }else {
      r(d) ? Ab.apply(null, [c].concat(d)) : bc(c, d)
    }
  }
  b.length > 2 && fc(a, c, b, 2);
  return c
}
function fc(a, b, c, d) {
  function e(h) {
    if(h) {
      b.appendChild(s(h) ? a.createTextNode(h) : h)
    }
  }
  for(d = d;d < c.length;d++) {
    var f = c[d];
    fa(f) && !(ga(f) && f.nodeType > 0) ? G(gc(f) ? vb(f) : f, e) : e(f)
  }
}
function hc(a, b) {
  a.appendChild(b)
}
function ic(a) {
  for(var b;b = a.firstChild;) {
    a.removeChild(b)
  }
}
function jc(a, b) {
  if(a.contains && b.nodeType == 1) {
    return a == b || a.contains(b)
  }
  if(typeof a.compareDocumentPosition != "undefined") {
    return a == b || Boolean(a.compareDocumentPosition(b) & 16)
  }
  for(;b && a != b;) {
    b = b.parentNode
  }
  return b == a
}
function ac(a) {
  return a.nodeType == 9 ? a : a.ownerDocument || a.document
}
function kc(a, b) {
  if("textContent" in a) {
    a.textContent = b
  }else {
    if(a.firstChild && a.firstChild.nodeType == 3) {
      for(;a.lastChild != a.firstChild;) {
        a.removeChild(a.lastChild)
      }
      a.firstChild.data = b
    }else {
      ic(a);
      a.appendChild(ac(a).createTextNode(b))
    }
  }
}
function lc(a) {
  var b = a.getAttributeNode("tabindex");
  if(b && b.specified) {
    a = a.tabIndex;
    return typeof a == "number" && a >= 0
  }
  return false
}
function gc(a) {
  if(a && typeof a.length == "number") {
    if(ga(a)) {
      return typeof a.item == "function" || typeof a.item == "string"
    }else {
      if(t(a)) {
        return typeof a.item == "function"
      }
    }
  }
  return false
}
function $b(a) {
  this.K = a || q.document || document
}
p = $b.prototype;
p.Fa = Zb;
p.b = function(a) {
  return s(a) ? this.K.getElementById(a) : a
};
p.n = function() {
  return ec(this.K, arguments)
};
p.createElement = function(a) {
  return this.K.createElement(a)
};
p.createTextNode = function(a) {
  return this.K.createTextNode(a)
};
p.appendChild = hc;
p.contains = jc;var mc = [];function K() {
}
K.prototype.Ya = false;
K.prototype.J = function() {
  if(!this.Ya) {
    this.Ya = true;
    this.i()
  }
};
K.prototype.i = ba();var nc;
function L(a, b) {
  this.type = a;
  this.currentTarget = this.target = b
}
v(L, K);
p = L.prototype;
p.i = function() {
  delete this.type;
  delete this.target;
  delete this.currentTarget
};
p.da = false;
p.ya = true;
p.stopPropagation = function() {
  this.da = true
};
p.preventDefault = function() {
  this.ya = false
};function M(a, b) {
  a && this.va(a, b)
}
v(M, L);
var oc = [1, 4, 2];
p = M.prototype;
p.target = null;
p.relatedTarget = null;
p.offsetX = 0;
p.offsetY = 0;
p.clientX = 0;
p.clientY = 0;
p.screenX = 0;
p.screenY = 0;
p.button = 0;
p.keyCode = 0;
p.charCode = 0;
p.ctrlKey = false;
p.altKey = false;
p.shiftKey = false;
p.metaKey = false;
p.sc = false;
p.M = null;
p.va = function(a, b) {
  var c = this.type = a.type;
  this.target = a.target || a.srcElement;
  this.currentTarget = b;
  var d = a.relatedTarget;
  if(d) {
    if(I) {
      try {
        d = d.nodeName && d
      }catch(e) {
        d = null
      }
    }
  }else {
    if(c == "mouseover") {
      d = a.fromElement
    }else {
      if(c == "mouseout") {
        d = a.toElement
      }
    }
  }
  this.relatedTarget = d;
  this.offsetX = a.offsetX !== undefined ? a.offsetX : a.layerX;
  this.offsetY = a.offsetY !== undefined ? a.offsetY : a.layerY;
  this.clientX = a.clientX !== undefined ? a.clientX : a.pageX;
  this.clientY = a.clientY !== undefined ? a.clientY : a.pageY;
  this.screenX = a.screenX || 0;
  this.screenY = a.screenY || 0;
  this.button = a.button;
  this.keyCode = a.keyCode || 0;
  this.charCode = a.charCode || (c == "keypress" ? a.keyCode : 0);
  this.ctrlKey = a.ctrlKey;
  this.altKey = a.altKey;
  this.shiftKey = a.shiftKey;
  this.metaKey = a.metaKey;
  this.sc = Rb ? a.metaKey : a.ctrlKey;
  this.M = a;
  delete this.ya;
  delete this.da
};
function pc(a, b) {
  return H ? a.type == "click" ? b == 0 : !!(a.M.button & oc[b]) : a.M.button == b
}
M.prototype.stopPropagation = function() {
  M.c.stopPropagation.call(this);
  if(this.M.stopPropagation) {
    this.M.stopPropagation()
  }else {
    this.M.cancelBubble = true
  }
};
var qc = H && !Yb("8");
M.prototype.preventDefault = function() {
  M.c.preventDefault.call(this);
  var a = this.M;
  if(a.preventDefault) {
    a.preventDefault()
  }else {
    a.returnValue = false;
    if(qc) {
      try {
        if(a.ctrlKey || a.keyCode >= 112 && a.keyCode <= 123) {
          a.keyCode = -1
        }
      }catch(b) {
      }
    }
  }
};
M.prototype.i = function() {
  M.c.i.call(this);
  this.relatedTarget = this.currentTarget = this.target = this.M = null
};function rc() {
}
var sc = 0;
p = rc.prototype;
p.key = 0;
p.ka = false;
p.yb = false;
p.va = function(a, b, c, d, e, f) {
  if(t(a)) {
    this.Gb = true
  }else {
    if(a && a.handleEvent && t(a.handleEvent)) {
      this.Gb = false
    }else {
      throw Error("Invalid listener argument");
    }
  }
  this.ja = a;
  this.Lb = b;
  this.src = c;
  this.type = d;
  this.capture = !!e;
  this.Ha = f;
  this.yb = false;
  this.key = ++sc;
  this.ka = false
};
p.handleEvent = function(a) {
  if(this.Gb) {
    return this.ja.call(this.Ha || this.src, a)
  }
  return this.ja.handleEvent.call(this.ja, a)
};function N(a, b) {
  this.Jb = b;
  this.ba = [];
  if(a > this.Jb) {
    throw Error("[goog.structs.SimplePool] Initial cannot be greater than max");
  }
  for(var c = 0;c < a;c++) {
    this.ba.push(this.I ? this.I() : {})
  }
}
v(N, K);
N.prototype.I = null;
N.prototype.Cb = null;
function tc(a) {
  if(a.ba.length) {
    return a.ba.pop()
  }
  return a.I ? a.I() : {}
}
function uc(a, b) {
  a.ba.length < a.Jb ? a.ba.push(b) : vc(a, b)
}
function vc(a, b) {
  if(a.Cb) {
    a.Cb(b)
  }else {
    if(ga(b)) {
      if(t(b.J)) {
        b.J()
      }else {
        for(var c in b) {
          delete b[c]
        }
      }
    }
  }
}
N.prototype.i = function() {
  N.c.i.call(this);
  for(var a = this.ba;a.length;) {
    vc(this, a.pop())
  }
  delete this.ba
};var wc;
var xc = (wc = "ScriptEngine" in q && q.ScriptEngine() == "JScript") ? q.ScriptEngineMajorVersion() + "." + q.ScriptEngineMinorVersion() + "." + q.ScriptEngineBuildVersion() : "0";var yc, zc, Cc, Dc, Ec, Fc, Gc, Hc, Ic, Jc, Kc;
(function() {
  function a() {
    return{D:0, B:0}
  }
  function b() {
    return[]
  }
  function c() {
    function o(x) {
      return h.call(o.src, o.key, x)
    }
    return o
  }
  function d() {
    return new rc
  }
  function e() {
    return new M
  }
  var f = wc && !(mb(xc, "5.7") >= 0), h;
  Fc = function(o) {
    h = o
  };
  if(f) {
    yc = function() {
      return tc(i)
    };
    zc = function(o) {
      uc(i, o)
    };
    Cc = function() {
      return tc(j)
    };
    Dc = function(o) {
      uc(j, o)
    };
    Ec = function() {
      return tc(k)
    };
    Gc = function() {
      uc(k, c())
    };
    Hc = function() {
      return tc(n)
    };
    Ic = function(o) {
      uc(n, o)
    };
    Jc = function() {
      return tc(l)
    };
    Kc = function(o) {
      uc(l, o)
    };
    var i = new N(0, 600);
    i.I = a;
    var j = new N(0, 600);
    j.I = b;
    var k = new N(0, 600);
    k.I = c;
    var n = new N(0, 600);
    n.I = d;
    var l = new N(0, 600);
    l.I = e
  }else {
    yc = a;
    zc = ca;
    Cc = b;
    Dc = ca;
    Ec = c;
    Gc = ca;
    Hc = d;
    Ic = ca;
    Jc = e;
    Kc = ca
  }
})();var Lc = {}, O = {}, P = {}, Mc = {};
function Nc(a, b, c, d, e) {
  if(b) {
    if(r(b)) {
      for(var f = 0;f < b.length;f++) {
        Nc(a, b[f], c, d, e)
      }
      return null
    }else {
      d = !!d;
      var h = O;
      b in h || (h[b] = yc());
      h = h[b];
      if(!(d in h)) {
        h[d] = yc();
        h.D++
      }
      h = h[d];
      var i = u(a), j;
      h.B++;
      if(h[i]) {
        j = h[i];
        for(f = 0;f < j.length;f++) {
          h = j[f];
          if(h.ja == c && h.Ha == e) {
            if(h.ka) {
              break
            }
            return j[f].key
          }
        }
      }else {
        j = h[i] = Cc();
        h.D++
      }
      f = Ec();
      f.src = a;
      h = Hc();
      h.va(c, f, a, b, d, e);
      c = h.key;
      f.key = c;
      j.push(h);
      Lc[c] = h;
      P[i] || (P[i] = Cc());
      P[i].push(h);
      if(a.addEventListener) {
        if(a == q || !a.Bb) {
          a.addEventListener(b, f, d)
        }
      }else {
        a.attachEvent(Oc(b), f)
      }
      return c
    }
  }else {
    throw Error("Invalid event type");
  }
}
function Pc(a, b, c, d, e) {
  if(r(b)) {
    for(var f = 0;f < b.length;f++) {
      Pc(a, b[f], c, d, e)
    }
    return null
  }
  d = !!d;
  a = Qc(a, b, d);
  if(!a) {
    return false
  }
  for(f = 0;f < a.length;f++) {
    if(a[f].ja == c && a[f].capture == d && a[f].Ha == e) {
      return Q(a[f].key)
    }
  }
  return false
}
function Q(a) {
  if(!Lc[a]) {
    return false
  }
  var b = Lc[a];
  if(b.ka) {
    return false
  }
  var c = b.src, d = b.type, e = b.Lb, f = b.capture;
  if(c.removeEventListener) {
    if(c == q || !c.Bb) {
      c.removeEventListener(d, e, f)
    }
  }else {
    c.detachEvent && c.detachEvent(Oc(d), e)
  }
  c = u(c);
  e = O[d][f][c];
  if(P[c]) {
    var h = P[c];
    tb(h, b);
    h.length == 0 && delete P[c]
  }
  b.ka = true;
  e.Kb = true;
  Rc(d, f, c, e);
  delete Lc[a];
  return true
}
function Rc(a, b, c, d) {
  if(!d.Ma) {
    if(d.Kb) {
      for(var e = 0, f = 0;e < d.length;e++) {
        if(d[e].ka) {
          var h = d[e].Lb;
          h.src = null;
          Gc(h);
          Ic(d[e])
        }else {
          if(e != f) {
            d[f] = d[e]
          }
          f++
        }
      }
      d.length = f;
      d.Kb = false;
      if(f == 0) {
        Dc(d);
        delete O[a][b][c];
        O[a][b].D--;
        if(O[a][b].D == 0) {
          zc(O[a][b]);
          delete O[a][b];
          O[a].D--
        }
        if(O[a].D == 0) {
          zc(O[a]);
          delete O[a]
        }
      }
    }
  }
}
function Sc(a, b, c) {
  var d = 0, e = b == null, f = c == null;
  c = !!c;
  if(a == null) {
    Cb(P, function(j) {
      for(var k = j.length - 1;k >= 0;k--) {
        var n = j[k];
        if((e || b == n.type) && (f || c == n.capture)) {
          Q(n.key);
          d++
        }
      }
    })
  }else {
    a = u(a);
    if(P[a]) {
      a = P[a];
      for(var h = a.length - 1;h >= 0;h--) {
        var i = a[h];
        if((e || b == i.type) && (f || c == i.capture)) {
          Q(i.key);
          d++
        }
      }
    }
  }
  return d
}
function Qc(a, b, c) {
  var d = O;
  if(b in d) {
    d = d[b];
    if(c in d) {
      d = d[c];
      a = u(a);
      if(d[a]) {
        return d[a]
      }
    }
  }
  return null
}
function Oc(a) {
  if(a in Mc) {
    return Mc[a]
  }
  return Mc[a] = "on" + a
}
function Tc(a, b, c, d, e) {
  var f = 1;
  b = u(b);
  if(a[b]) {
    a.B--;
    a = a[b];
    if(a.Ma) {
      a.Ma++
    }else {
      a.Ma = 1
    }
    try {
      for(var h = a.length, i = 0;i < h;i++) {
        var j = a[i];
        if(j && !j.ka) {
          f &= Uc(j, e) !== false
        }
      }
    }finally {
      a.Ma--;
      Rc(c, d, b, a)
    }
  }
  return Boolean(f)
}
function Uc(a, b) {
  var c = a.handleEvent(b);
  a.yb && Q(a.key);
  return c
}
function Vc(a, b) {
  if(!Lc[a]) {
    return true
  }
  var c = Lc[a], d = c.type, e = O;
  if(!(d in e)) {
    return true
  }
  e = e[d];
  var f, h;
  if(nc === undefined) {
    nc = H && !q.addEventListener
  }
  if(nc) {
    var i;
    if(!(i = b)) {
      a: {
        i = "window.event".split(".");
        for(var j = q;f = i.shift();) {
          if(j[f]) {
            j = j[f]
          }else {
            i = null;
            break a
          }
        }
        i = j
      }
    }
    f = i;
    i = true in e;
    j = false in e;
    if(i) {
      if(f.keyCode < 0 || f.returnValue != undefined) {
        return true
      }
      a: {
        var k = false;
        if(f.keyCode == 0) {
          try {
            f.keyCode = -1;
            break a
          }catch(n) {
            k = true
          }
        }
        if(k || f.returnValue == undefined) {
          f.returnValue = true
        }
      }
    }
    k = Jc();
    k.va(f, this);
    f = true;
    try {
      if(i) {
        for(var l = Cc(), o = k.currentTarget;o;o = o.parentNode) {
          l.push(o)
        }
        h = e[true];
        h.B = h.D;
        for(var x = l.length - 1;!k.da && x >= 0 && h.B;x--) {
          k.currentTarget = l[x];
          f &= Tc(h, l[x], d, true, k)
        }
        if(j) {
          h = e[false];
          h.B = h.D;
          for(x = 0;!k.da && x < l.length && h.B;x++) {
            k.currentTarget = l[x];
            f &= Tc(h, l[x], d, false, k)
          }
        }
      }else {
        f = Uc(c, k)
      }
    }finally {
      if(l) {
        l.length = 0;
        Dc(l)
      }
      k.J();
      Kc(k)
    }
    return f
  }
  d = new M(b, this);
  try {
    f = Uc(c, d)
  }finally {
    d.J()
  }
  return f
}
Fc(Vc);
mc[mc.length] = function(a) {
  Vc = a.Gc(Vc);
  Fc(Vc)
};function Wc(a) {
  this.Fb = a
}
v(Wc, K);
var Xc = new N(0, 100);
function R(a, b, c, d, e, f) {
  if(r(c)) {
    for(var h = 0;h < c.length;h++) {
      R(a, b, c[h], d, e, f)
    }
  }else {
    b = Nc(b, c, d || a, e || false, f || a.Fb || a);
    if(a.t) {
      a.t[b] = true
    }else {
      if(a.Y) {
        a.t = tc(Xc);
        a.t[a.Y] = true;
        a.Y = null;
        a.t[b] = true
      }else {
        a.Y = b
      }
    }
  }
  return a
}
function S(a, b, c, d, e, f) {
  if(a.Y || a.t) {
    if(r(c)) {
      for(var h = 0;h < c.length;h++) {
        S(a, b, c[h], d, e, f)
      }
    }else {
      a: {
        d = d || a;
        f = f || a.Fb || a;
        e = !!(e || false);
        if(b = Qc(b, c, e)) {
          for(c = 0;c < b.length;c++) {
            if(b[c].ja == d && b[c].capture == e && b[c].Ha == f) {
              b = b[c];
              break a
            }
          }
        }
        b = null
      }
      if(b) {
        b = b.key;
        Q(b);
        if(a.t) {
          Db(a.t, b)
        }else {
          if(a.Y == b) {
            a.Y = null
          }
        }
      }
    }
  }
  return a
}
function Yc(a) {
  if(a.t) {
    for(var b in a.t) {
      Q(b);
      delete a.t[b]
    }
    uc(Xc, a.t);
    a.t = null
  }else {
    a.Y && Q(a.Y)
  }
}
Wc.prototype.i = function() {
  Wc.c.i.call(this);
  Yc(this)
};
Wc.prototype.handleEvent = function() {
  throw Error("EventHandler.handleEvent not implemented");
};function Zc() {
}
v(Zc, K);
p = Zc.prototype;
p.Bb = true;
p.Pa = null;
p.qb = function(a) {
  this.Pa = a
};
p.addEventListener = function(a, b, c, d) {
  Nc(this, a, b, c, d)
};
p.removeEventListener = function(a, b, c, d) {
  Pc(this, a, b, c, d)
};
p.dispatchEvent = function(a) {
  a = a;
  if(s(a)) {
    a = new L(a, this)
  }else {
    if(a instanceof L) {
      a.target = a.target || this
    }else {
      var b = a;
      a = new L(a.type, this);
      Gb(a, b)
    }
  }
  b = 1;
  var c, d = a.type, e = O;
  if(d in e) {
    e = e[d];
    d = true in e;
    var f;
    if(d) {
      c = [];
      for(f = this;f;f = f.Pa) {
        c.push(f)
      }
      f = e[true];
      f.B = f.D;
      for(var h = c.length - 1;!a.da && h >= 0 && f.B;h--) {
        a.currentTarget = c[h];
        b &= Tc(f, c[h], a.type, true, a) && a.ya != false
      }
    }
    if(false in e) {
      f = e[false];
      f.B = f.D;
      if(d) {
        for(h = 0;!a.da && h < c.length && f.B;h++) {
          a.currentTarget = c[h];
          b &= Tc(f, c[h], a.type, false, a) && a.ya != false
        }
      }else {
        for(c = this;!a.da && c && f.B;c = c.Pa) {
          a.currentTarget = c;
          b &= Tc(f, c, a.type, false, a) && a.ya != false
        }
      }
    }
    a = Boolean(b)
  }else {
    a = true
  }
  return a
};
p.i = function() {
  Zc.c.i.call(this);
  Sc(this);
  this.Pa = null
};function $c(a, b, c, d) {
  if(typeof d == "number") {
    d = (b ? Math.round(d) : d) + "px"
  }
  c.style[a] = d
}
ja($c, "height", true);
ja($c, "width", true);
var ad = I ? "MozUserSelect" : J ? "WebkitUserSelect" : null;
function bd(a, b, c) {
  c = !c ? a.getElementsByTagName("*") : null;
  if(ad) {
    b = b ? "none" : "";
    a.style[ad] = b;
    if(c) {
      a = 0;
      for(var d;d = c[a];a++) {
        d.style[ad] = b
      }
    }
  }else {
    if(H || Pb) {
      b = b ? "on" : "";
      a.setAttribute("unselectable", b);
      if(c) {
        for(a = 0;d = c[a];a++) {
          d.setAttribute("unselectable", b)
        }
      }
    }
  }
}
;function cd() {
}
da(cd);
cd.prototype.oc = 0;
cd.W();function T(a) {
  this.V = a || Zb();
  this.za = dd
}
v(T, Zc);
T.prototype.hc = cd.W();
var dd = null, ed = "select";
function fd(a, b) {
  switch(a) {
    case 1:
      return b ? "disable" : "enable";
    case 2:
      return b ? "highlight" : "unhighlight";
    case 4:
      return b ? "activate" : "deactivate";
    case 8:
      return b ? ed : "unselect";
    case 16:
      return b ? "check" : "uncheck";
    case 32:
      return b ? "focus" : "blur";
    case 64:
      return b ? "open" : "close";
    default:
  }
  throw Error("Invalid component state");
}
p = T.prototype;
p.Ia = null;
p.V = null;
p.g = false;
p.a = null;
p.za = null;
p.nc = null;
p.u = null;
p.h = null;
p.T = null;
p.xc = false;
function gd(a) {
  return a.Ia || (a.Ia = ":" + (a.hc.oc++).toString(36))
}
T.prototype.b = g("a");
function hd(a) {
  return a.ga || (a.ga = new Wc(a))
}
function id(a, b) {
  if(a == b) {
    throw Error("Unable to set parent component");
  }
  if(b && a.u && a.Ia && jd(a.u, a.Ia) && a.u != b) {
    throw Error("Unable to set parent component");
  }
  a.u = b;
  T.c.qb.call(a, b)
}
T.prototype.qb = function(a) {
  if(this.u && this.u != a) {
    throw Error("Method not supported");
  }
  T.c.qb.call(this, a)
};
T.prototype.Fa = g("V");
T.prototype.n = function() {
  this.a = this.V.createElement("div")
};
function kd(a, b, c) {
  if(a.g) {
    throw Error("Component already rendered");
  }
  a.a || a.n();
  b ? b.insertBefore(a.a, c || null) : a.V.K.body.appendChild(a.a);
  if(!a.u || a.u.g) {
    a.L()
  }
}
p = T.prototype;
p.L = function() {
  this.g = true;
  this.h && G(this.h, function(a) {
    !a.g && a.b() && a.L()
  }, void 0)
};
p.aa = function() {
  this.h && G(this.h, function(a) {
    a.g && a.aa()
  }, void 0);
  this.ga && Yc(this.ga);
  this.g = false
};
p.i = function() {
  T.c.i.call(this);
  this.g && this.aa();
  if(this.ga) {
    this.ga.J();
    delete this.ga
  }
  this.h && G(this.h, function(a) {
    a.J()
  }, void 0);
  !this.xc && this.a && this.a && this.a.parentNode && this.a.parentNode.removeChild(this.a);
  this.u = this.nc = this.a = this.T = this.h = null
};
p.Va = function(a, b) {
  this.Wa(a, ld(this), b)
};
p.Wa = function(a, b, c) {
  if(a.g && (c || !this.g)) {
    throw Error("Component already rendered");
  }
  if(b < 0 || b > ld(this)) {
    throw Error("Child component index out of bounds");
  }
  if(!this.T || !this.h) {
    this.T = {};
    this.h = []
  }
  if(a.u == this) {
    this.T[gd(a)] = a;
    tb(this.h, a)
  }else {
    var d = this.T, e = gd(a);
    if(e in d) {
      throw Error('The object already contains the key "' + e + '"');
    }
    d[e] = a
  }
  id(a, this);
  wb(this.h, b, 0, a);
  if(a.g && this.g && a.u == this) {
    c = this.N();
    c.insertBefore(a.b(), c.childNodes[b] || null)
  }else {
    if(c) {
      this.a || this.n();
      b = U(this, b + 1);
      kd(a, this.N(), b ? b.a : null)
    }else {
      this.g && !a.g && a.a && a.L()
    }
  }
};
p.N = g("a");
function md(a) {
  if(a.za == null) {
    var b;
    a: {
      b = a.g ? a.a : a.V.K.body;
      var c = ac(b);
      if(c.defaultView && c.defaultView.getComputedStyle) {
        if(b = c.defaultView.getComputedStyle(b, "")) {
          b = b.direction;
          break a
        }
      }
      b = null
    }
    a.za = "rtl" == (b || ((a.g ? a.a : a.V.K.body).currentStyle ? (a.g ? a.a : a.V.K.body).currentStyle.direction : null) || (a.g ? a.a : a.V.K.body).style.direction)
  }
  return a.za
}
T.prototype.Aa = function(a) {
  if(this.g) {
    throw Error("Component already rendered");
  }
  this.za = a
};
function ld(a) {
  return a.h ? a.h.length : 0
}
function jd(a, b) {
  var c;
  if(a.T && b) {
    c = a.T;
    c = b in c ? c[b] : void 0;
    c = c || null
  }else {
    c = null
  }
  return c
}
function U(a, b) {
  return a.h ? a.h[b] || null : null
}
function nd(a, b) {
  return a.h && b ? qb(a.h, b) : -1
}
T.prototype.removeChild = function(a, b) {
  if(a) {
    var c = s(a) ? a : gd(a);
    a = jd(this, c);
    if(c && a) {
      Db(this.T, c);
      tb(this.h, a);
      if(b) {
        a.aa();
        a.a && a.a && a.a.parentNode && a.a.parentNode.removeChild(a.a)
      }
      id(a, null)
    }
  }
  if(!a) {
    throw Error("Child is not in parent component");
  }
  return a
};function od(a, b, c, d, e) {
  if(!H && !(J && Yb("525"))) {
    return true
  }
  if(Rb && e) {
    return pd(a)
  }
  if(e && !d) {
    return false
  }
  if(!c && (b == 17 || b == 18)) {
    return false
  }
  if(H && d && b == a) {
    return false
  }
  switch(a) {
    case 13:
      return true;
    case 27:
      return!J
  }
  return pd(a)
}
function pd(a) {
  if(a >= 48 && a <= 57) {
    return true
  }
  if(a >= 96 && a <= 106) {
    return true
  }
  if(a >= 65 && a <= 90) {
    return true
  }
  if(J && a == 0) {
    return true
  }
  switch(a) {
    case 32:
    ;
    case 63:
    ;
    case 107:
    ;
    case 109:
    ;
    case 110:
    ;
    case 111:
    ;
    case 186:
    ;
    case 189:
    ;
    case 187:
    ;
    case 188:
    ;
    case 190:
    ;
    case 191:
    ;
    case 192:
    ;
    case 222:
    ;
    case 219:
    ;
    case 220:
    ;
    case 221:
      return true;
    default:
      return false
  }
}
;function V(a) {
  a && qd(this, a)
}
v(V, Zc);
p = V.prototype;
p.a = null;
p.Ka = null;
p.jb = null;
p.La = null;
p.wa = -1;
p.ca = -1;
var rd = {"3":13, "12":144, "63232":38, "63233":40, "63234":37, "63235":39, "63236":112, "63237":113, "63238":114, "63239":115, "63240":116, "63241":117, "63242":118, "63243":119, "63244":120, "63245":121, "63246":122, "63247":123, "63248":44, "63272":46, "63273":36, "63275":35, "63276":33, "63277":34, "63289":144, "63302":45}, sd = {Up:38, Down:40, Left:37, Right:39, Enter:13, F1:112, F2:113, F3:114, F4:115, F5:116, F6:117, F7:118, F8:119, F9:120, F10:121, F11:122, F12:123, "U+007F":46, Home:36, 
End:35, PageUp:33, PageDown:34, Insert:45}, td = {61:187, 59:186}, ud = H || J && Yb("525");
V.prototype.$b = function(a) {
  if(ud && !od(a.keyCode, this.wa, a.shiftKey, a.ctrlKey, a.altKey)) {
    this.handleEvent(a)
  }else {
    this.ca = I && a.keyCode in td ? td[a.keyCode] : a.keyCode
  }
};
V.prototype.ac = function() {
  this.ca = this.wa = -1
};
V.prototype.handleEvent = function(a) {
  var b = a.M, c, d;
  if(H && a.type == "keypress") {
    c = this.ca;
    d = c != 13 && c != 27 ? b.keyCode : 0
  }else {
    if(J && a.type == "keypress") {
      c = this.ca;
      d = b.charCode >= 0 && b.charCode < 63232 && pd(c) ? b.charCode : 0
    }else {
      if(Pb) {
        c = this.ca;
        d = pd(c) ? b.keyCode : 0
      }else {
        c = b.keyCode || this.ca;
        d = b.charCode || 0;
        if(Rb && d == 63 && !c) {
          c = 191
        }
      }
    }
  }
  var e = c, f = b.keyIdentifier;
  if(c) {
    if(c >= 63232 && c in rd) {
      e = rd[c]
    }else {
      if(c == 25 && a.shiftKey) {
        e = 9
      }
    }
  }else {
    if(f && f in sd) {
      e = sd[f]
    }
  }
  a = e == this.wa;
  this.wa = e;
  b = new vd(e, d, a, b);
  try {
    this.dispatchEvent(b)
  }finally {
    b.J()
  }
};
V.prototype.b = g("a");
function qd(a, b) {
  a.La && a.detach();
  a.a = b;
  a.Ka = Nc(a.a, "keypress", a);
  a.jb = Nc(a.a, "keydown", a.$b, false, a);
  a.La = Nc(a.a, "keyup", a.ac, false, a)
}
V.prototype.detach = function() {
  if(this.Ka) {
    Q(this.Ka);
    Q(this.jb);
    Q(this.La);
    this.La = this.jb = this.Ka = null
  }
  this.a = null;
  this.ca = this.wa = -1
};
V.prototype.i = function() {
  V.c.i.call(this);
  this.detach()
};
function vd(a, b, c, d) {
  d && this.va(d, void 0);
  this.type = "key";
  this.keyCode = a;
  this.charCode = b;
  this.repeat = c
}
v(vd, M);function wd(a, b) {
  if(I) {
    a.setAttribute("role", b);
    a.Ec = b
  }
}
;function xd() {
}
var yd;
da(xd);
p = xd.prototype;
p.pa = ba();
p.n = function(a) {
  return a.Fa().n("div", this.qa(a).join(" "), a.getContent())
};
p.N = aa();
p.oa = function(a, b, c) {
  if(a = a.b ? a.b() : a) {
    if(H && !Yb("7")) {
      var d = zd(this, zb(a), b);
      d.push(b);
      ja(c ? Ab : Bb, a).apply(null, d)
    }else {
      c ? Ab(a, b) : Bb(a, b)
    }
  }
};
p.hb = function(a) {
  md(a) && this.Aa(a.b(), true);
  a.r() && this.Qa(a, a.m)
};
p.ob = function(a, b) {
  bd(a, !b, !H && !Pb)
};
p.Aa = function(a, b) {
  this.oa(a, this.z() + "-rtl", b)
};
p.ia = function(a) {
  var b;
  if(a.v & 32 && (b = a.o())) {
    return lc(b)
  }
  return false
};
p.Qa = function(a, b) {
  var c;
  if(a.v & 32 && (c = a.o())) {
    if(!b && a.p & 32) {
      try {
        c.blur()
      }catch(d) {
      }
      a.p & 32 && a.ra(null)
    }
    if(lc(c) != b) {
      c = c;
      if(b) {
        c.tabIndex = 0
      }else {
        c.removeAttribute("tabIndex")
      }
    }
  }
};
p.setVisible = function(a, b) {
  a.style.display = b ? "" : "none"
};
p.H = function(a, b, c) {
  var d = a.b();
  if(d) {
    var e = Ad(this, b);
    e && this.oa(a, e, c);
    if(I) {
      yd || (yd = Hb(1, "disabled", 4, "pressed", 8, "selected", 16, "checked", 64, "expanded"));
      (a = yd[b]) && I && d.setAttribute("aria-" + a, c)
    }
  }
};
p.setContent = function(a, b) {
  var c = this.N(a);
  if(c) {
    ic(c);
    if(b) {
      if(s(b)) {
        kc(c, b)
      }else {
        var d = function(e) {
          if(e) {
            var f = ac(c);
            c.appendChild(s(e) ? f.createTextNode(e) : e)
          }
        };
        if(r(b)) {
          G(b, d)
        }else {
          fa(b) && !("nodeType" in b) ? G(vb(b), d) : d(b)
        }
      }
    }
  }
};
p.o = function(a) {
  return a.b()
};
p.z = m("goog-control");
p.qa = function(a) {
  var b = this.z(), c = [b], d = this.z();
  d != b && c.push(d);
  b = a.p;
  for(d = [];b;) {
    var e = b & -b;
    d.push(Ad(this, e));
    b &= ~e
  }
  c.push.apply(c, d);
  (a = a.F) && c.push.apply(c, a);
  H && !Yb("7") && c.push.apply(c, zd(this, c));
  return c
};
function zd(a, b, c) {
  var d = [];
  if(c) {
    b = b.concat([c])
  }
  G([], function(e) {
    if(rb(e, ja(sb, b)) && (!c || sb(e, c))) {
      d.push(e.join("_"))
    }
  });
  return d
}
function Ad(a, b) {
  if(!a.Ab) {
    var c = a.z();
    a.Ab = Hb(1, c + "-disabled", 2, c + "-hover", 4, c + "-active", 8, c + "-selected", 16, c + "-checked", 32, c + "-focused", 64, c + "-open")
  }
  return a.Ab[b]
}
;function Bd(a, b) {
  if(!a) {
    throw Error("Invalid class name " + a);
  }
  if(!t(b)) {
    throw Error("Invalid decorator function " + b);
  }
  Cd[a] = b
}
var Dd = {}, Cd = {};function W(a, b, c) {
  T.call(this, c);
  if(!(b = b)) {
    b = this.constructor;
    for(var d;b;) {
      d = u(b);
      if(d = Dd[d]) {
        break
      }
      b = b.c ? b.c.constructor : null
    }
    b = d ? t(d.W) ? d.W() : new d : null
  }
  this.d = b;
  this.Ba = a
}
v(W, T);
p = W.prototype;
p.Ba = null;
p.p = 0;
p.v = 39;
p.Rb = 255;
p.Sa = 0;
p.m = true;
p.F = null;
p.ua = true;
p.Xa = false;
p.o = function() {
  return this.d.o(this)
};
p.Ga = function() {
  return this.s || (this.s = new V)
};
p.oa = function(a, b) {
  if(b) {
    if(a) {
      if(this.F) {
        sb(this.F, a) || this.F.push(a)
      }else {
        this.F = [a]
      }
      this.d.oa(this, a, true)
    }
  }else {
    if(a && this.F) {
      tb(this.F, a);
      if(this.F.length == 0) {
        this.F = null
      }
      this.d.oa(this, a, false)
    }
  }
};
p.n = function() {
  var a = this.d.n(this);
  this.a = a;
  if(I) {
    var b = this.d.pa();
    b && wd(a, b)
  }
  this.Xa || this.d.ob(a, false);
  this.m || this.d.setVisible(a, false)
};
p.N = function() {
  return this.d.N(this.b())
};
p.L = function() {
  W.c.L.call(this);
  this.d.hb(this);
  if(this.v & -2) {
    this.ua && Ed(this, true);
    if(this.v & 32) {
      var a = this.o();
      if(a) {
        var b = this.Ga();
        qd(b, a);
        R(R(R(hd(this), b, "key", this.X), a, "focus", this.sa), a, "blur", this.ra)
      }
    }
  }
};
function Ed(a, b) {
  var c = hd(a), d = a.b();
  if(b) {
    R(R(R(R(c, d, "mouseover", a.fb), d, "mousedown", a.ta), d, "mouseup", a.gb), d, "mouseout", a.eb);
    H && R(c, d, "dblclick", a.Eb)
  }else {
    S(S(S(S(c, d, "mouseover", a.fb), d, "mousedown", a.ta), d, "mouseup", a.gb), d, "mouseout", a.eb);
    H && S(c, d, "dblclick", a.Eb)
  }
}
p = W.prototype;
p.aa = function() {
  W.c.aa.call(this);
  this.s && this.s.detach();
  this.m && this.r() && this.d.Qa(this, false)
};
p.i = function() {
  W.c.i.call(this);
  if(this.s) {
    this.s.J();
    delete this.s
  }
  delete this.d;
  this.F = this.Ba = null
};
p.getContent = g("Ba");
p.setContent = function(a) {
  this.d.setContent(this.b(), a);
  this.Ba = a
};
p.Aa = function(a) {
  W.c.Aa.call(this, a);
  var b = this.b();
  b && this.d.Aa(b, a)
};
p.ob = function(a) {
  this.Xa = a;
  var b = this.b();
  b && this.d.ob(b, a)
};
p.setVisible = function(a, b) {
  if(b || this.m != a && this.dispatchEvent(a ? "show" : "hide")) {
    var c = this.b();
    c && this.d.setVisible(c, a);
    this.r() && this.d.Qa(this, a);
    this.m = a;
    return true
  }
  return false
};
p.r = function() {
  return!!!(this.p & 1)
};
p.G = function(a) {
  Fd(this, 2, a) && this.H(2, a)
};
p.setActive = function(a) {
  Fd(this, 4, a) && this.H(4, a)
};
function Gd(a, b) {
  Fd(a, 8, b) && a.H(8, b)
}
function Hd(a, b) {
  Fd(a, 64, b) && a.H(64, b)
}
W.prototype.H = function(a, b) {
  if(this.v & a && b != !!(this.p & a)) {
    this.d.H(this, a, b);
    this.p = b ? this.p | a : this.p & ~a
  }
};
function Id(a, b, c) {
  if(a.g && a.p & b && !c) {
    throw Error("Component already rendered");
  }
  !c && a.p & b && a.H(b, false);
  a.v = c ? a.v | b : a.v & ~b
}
function X(a, b) {
  return!!(a.Rb & b) && !!(a.v & b)
}
function Fd(a, b, c) {
  return!!(a.v & b) && !!(a.p & b) != c && (!(a.Sa & b) || a.dispatchEvent(fd(b, c))) && !a.Ya
}
W.prototype.fb = function(a) {
  !Jd(a, this.b()) && this.dispatchEvent("enter") && this.r() && X(this, 2) && this.G(true)
};
W.prototype.eb = function(a) {
  if(!Jd(a, this.b()) && this.dispatchEvent("leave")) {
    X(this, 4) && this.setActive(false);
    X(this, 2) && this.G(false)
  }
};
function Jd(a, b) {
  return!!a.relatedTarget && jc(b, a.relatedTarget)
}
W.prototype.ta = function(a) {
  if(this.r()) {
    X(this, 2) && this.G(true);
    if(pc(a, 0)) {
      X(this, 4) && this.setActive(true);
      this.d.ia(this) && this.o().focus()
    }
  }
  !this.Xa && pc(a, 0) && a.preventDefault()
};
W.prototype.gb = function(a) {
  if(this.r()) {
    X(this, 2) && this.G(true);
    this.p & 4 && Kd(this, a) && X(this, 4) && this.setActive(false)
  }
};
W.prototype.Eb = function(a) {
  this.r() && Kd(this, a)
};
function Kd(a, b) {
  if(X(a, 16)) {
    var c = !!!(a.p & 16);
    Fd(a, 16, c) && a.H(16, c)
  }
  X(a, 8) && Gd(a, true);
  X(a, 64) && Hd(a, !!!(a.p & 64));
  c = new L("action", a);
  if(b) {
    for(var d = ["altKey", "ctrlKey", "metaKey", "shiftKey", "platformModifierKey"], e, f = 0;e = d[f];f++) {
      c[e] = b[e]
    }
  }
  return a.dispatchEvent(c)
}
W.prototype.sa = function() {
  X(this, 32) && Fd(this, 32, true) && this.H(32, true)
};
W.prototype.ra = function() {
  X(this, 4) && this.setActive(false);
  X(this, 32) && Fd(this, 32, false) && this.H(32, false)
};
W.prototype.X = function(a) {
  if(this.m && this.r() && this.db(a)) {
    a.preventDefault();
    a.stopPropagation();
    return true
  }
  return false
};
W.prototype.db = function(a) {
  return a.keyCode == 13 && Kd(this, a)
};
if(!t(W)) {
  throw Error("Invalid component class " + W);
}
if(!t(xd)) {
  throw Error("Invalid renderer class " + xd);
}
var Ld = u(W);
Dd[Ld] = xd;
Bd("goog-control", function() {
  return new W(null)
});function Md() {
}
v(Md, xd);
da(Md);
p = Md.prototype;
p.z = m("goog-tab");
p.pa = m("tab");
p.n = function(a) {
  var b = Md.c.n.call(this, a);
  (a = a.Db()) && this.rb(b, a);
  return b
};
p.Db = function(a) {
  return a.title || ""
};
p.rb = function(a, b) {
  if(a) {
    a.title = b || ""
  }
};function Nd(a, b, c) {
  W.call(this, a, b || Md.W(), c);
  Id(this, 8, true);
  this.Sa |= 9
}
v(Nd, W);
Nd.prototype.Db = g("wc");
Nd.prototype.rb = function(a) {
  this.d.rb(this.b(), a);
  this.wc = a
};
Bd("goog-tab", function() {
  return new Nd(null)
});function Od() {
}
v(Od, xd);
da(Od);
Od.prototype.n = function(a) {
  return a.Fa().n("div", this.z())
};
Od.prototype.setContent = ba();
Od.prototype.z = m("goog-menuseparator");function Pd(a, b) {
  W.call(this, null, a || Od.W(), b);
  Id(this, 1, false);
  Id(this, 2, false);
  Id(this, 4, false);
  Id(this, 32, false);
  this.p = 1
}
v(Pd, W);
Pd.prototype.L = function() {
  Pd.c.L.call(this);
  wd(this.b(), "separator")
};
Bd("goog-menuseparator", function() {
  return new Pd
});function Qd() {
}
da(Qd);
p = Qd.prototype;
p.pa = ba();
p.n = function(a) {
  return a.Fa().n("div", this.qa(a).join(" "))
};
p.N = aa();
p.hb = function(a) {
  a = a.b();
  bd(a, true, I);
  if(H) {
    a.hideFocus = true
  }
  var b = this.pa();
  b && wd(a, b)
};
p.o = function(a) {
  return a.b()
};
p.z = m("goog-container");
p.qa = function(a) {
  var b = this.z(), c = [b, a.Z == Rd ? b + "-horizontal" : b + "-vertical"];
  a.r() || c.push(b + "-disabled");
  return c
};function Y(a, b, c) {
  T.call(this, c);
  this.d = b || Qd.W();
  this.Z = a || Sd
}
v(Y, T);
var Rd = "horizontal", Sd = "vertical";
p = Y.prototype;
p.Hb = null;
p.s = null;
p.d = null;
p.Z = null;
p.m = true;
p.Da = true;
p.cb = true;
p.l = -1;
p.j = null;
p.xa = false;
p.Pb = false;
p.pc = true;
p.S = null;
p.o = function() {
  return this.Hb || this.d.o(this)
};
p.Ga = function() {
  return this.s || (this.s = new V(this.o()))
};
p.n = function() {
  this.a = this.d.n(this)
};
p.N = function() {
  return this.d.N(this.b())
};
p.L = function() {
  Y.c.L.call(this);
  this.h && G(this.h, function(b) {
    b.g && Td(this, b)
  }, this);
  var a = this.b();
  this.d.hb(this);
  this.setVisible(this.m, true);
  R(R(R(R(R(R(R(R(hd(this), this, "enter", this.Yb), this, "highlight", this.Zb), this, "unhighlight", this.gc), this, "open", this.bc), this, "close", this.Wb), a, "mousedown", this.ta), ac(a), "mouseup", this.Xb), a, ["mousedown", "mouseup", "mouseover", "mouseout"], this.Vb);
  this.ia() && Ud(this, true)
};
function Ud(a, b) {
  var c = hd(a), d = a.o();
  b ? R(R(R(c, d, "focus", a.sa), d, "blur", a.ra), a.Ga(), "key", a.X) : S(S(S(c, d, "focus", a.sa), d, "blur", a.ra), a.Ga(), "key", a.X)
}
p = Y.prototype;
p.aa = function() {
  Vd(this, -1);
  this.j && Hd(this.j, false);
  this.xa = false;
  Y.c.aa.call(this)
};
p.i = function() {
  Y.c.i.call(this);
  if(this.s) {
    this.s.J();
    this.s = null
  }
  this.d = this.j = this.S = null
};
p.Yb = m(true);
p.Zb = function(a) {
  var b = nd(this, a.target);
  if(b > -1 && b != this.l) {
    var c = U(this, this.l);
    c && c.G(false);
    this.l = b;
    c = U(this, this.l);
    this.xa && c.setActive(true);
    if(this.pc && this.j && c != this.j) {
      c.v & 64 ? Hd(c, true) : Hd(this.j, false)
    }
  }
  b = this.b();
  a = a.target.b().id;
  I && b.setAttribute("aria-activedescendant", a)
};
p.gc = function(a) {
  if(a.target == U(this, this.l)) {
    this.l = -1
  }
  a = this.b();
  I && a.setAttribute("aria-activedescendant", "")
};
p.bc = function(a) {
  if((a = a.target) && a != this.j && a.u == this) {
    this.j && Hd(this.j, false);
    this.j = a
  }
};
p.Wb = function(a) {
  if(a.target == this.j) {
    this.j = null
  }
};
p.ta = function(a) {
  if(this.Da) {
    this.xa = true
  }
  var b = this.o(), c;
  a: {
    if(b) {
      if((c = b.getAttributeNode("tabindex")) && c.specified) {
        c = b.tabIndex;
        c = typeof c == "number" && c >= 0;
        break a
      }
    }
    c = false
  }
  c ? b.focus() : a.preventDefault()
};
p.Xb = function() {
  this.xa = false
};
p.Vb = function(a) {
  var b;
  a: {
    b = a.target;
    if(this.S) {
      for(var c = this.b();b && b.parentNode && b != c;) {
        var d = b.id;
        if(d in this.S) {
          b = this.S[d];
          break a
        }
        b = b.parentNode
      }
    }
    b = null
  }
  if(b) {
    switch(a.type) {
      case "mousedown":
        b.ta(a);
        break;
      case "mouseup":
        b.gb(a);
        break;
      case "mouseover":
        b.fb(a);
        break;
      case "mouseout":
        b.eb(a);
        break
    }
  }
};
p.sa = ba();
p.ra = function() {
  Vd(this, -1);
  this.xa = false;
  this.j && Hd(this.j, false)
};
p.X = function(a) {
  if(this.r() && this.m && (ld(this) != 0 || this.Hb) && this.db(a)) {
    a.preventDefault();
    a.stopPropagation();
    return true
  }
  return false
};
p.db = function(a) {
  var b = U(this, this.l);
  if(b && typeof b.X == "function" && b.X(a)) {
    return true
  }
  if(this.j && this.j != b && typeof this.j.X == "function" && this.j.X(a)) {
    return true
  }
  switch(a.keyCode) {
    case 27:
      if(this.ia()) {
        this.o().blur()
      }else {
        return false
      }
      break;
    case 36:
      Wd(this);
      break;
    case 35:
      Xd(this);
      break;
    case 38:
      if(this.Z == Sd) {
        Yd(this)
      }else {
        return false
      }
      break;
    case 37:
      if(this.Z == Rd) {
        md(this) ? Zd(this) : Yd(this)
      }else {
        return false
      }
      break;
    case 40:
      if(this.Z == Sd) {
        Zd(this)
      }else {
        return false
      }
      break;
    case 39:
      if(this.Z == Rd) {
        md(this) ? Yd(this) : Zd(this)
      }else {
        return false
      }
      break;
    default:
      return false
  }
  return true
};
function Td(a, b) {
  var c = b.b();
  c = c.id || (c.id = gd(b));
  if(!a.S) {
    a.S = {}
  }
  a.S[c] = b
}
p = Y.prototype;
p.Va = function(a, b) {
  Y.c.Va.call(this, a, b)
};
p.Wa = function(a, b, c) {
  a.Sa |= 2;
  a.Sa |= 64;
  if(this.ia() || !this.Pb) {
    Id(a, 32, false)
  }
  a.g && false != a.ua && Ed(a, false);
  a.ua = false;
  Y.c.Wa.call(this, a, b, c);
  c && this.g && Td(this, a);
  b <= this.l && this.l++
};
p.removeChild = function(a, b) {
  if(a = s(a) ? jd(this, a) : a) {
    var c = nd(this, a);
    if(c != -1) {
      if(c == this.l) {
        a.G(false)
      }else {
        c < this.l && this.l--
      }
    }
    (c = a.b()) && c.id && Db(this.S, c.id)
  }
  c = a = Y.c.removeChild.call(this, a, b);
  c.g && true != c.ua && Ed(c, true);
  c.ua = true;
  return a
};
p.setVisible = function(a, b) {
  if(b || this.m != a && this.dispatchEvent(a ? "show" : "hide")) {
    this.m = a;
    var c = this.b();
    if(c) {
      c.style.display = a ? "" : "none";
      if(this.ia()) {
        if(c = this.o()) {
          c.tabIndex = this.Da && this.m ? 0 : -1
        }
      }
      b || this.dispatchEvent(this.m ? "aftershow" : "afterhide")
    }
    return true
  }
  return false
};
p.r = g("Da");
p.ia = g("cb");
p.Qa = function(a) {
  a != this.cb && this.g && Ud(this, a);
  this.cb = a;
  if(this.Da && this.m) {
    var b = this.o();
    if(b) {
      b.tabIndex = a ? 0 : -1
    }
  }
};
function Vd(a, b) {
  var c = U(a, b);
  if(c) {
    c.G(true)
  }else {
    a.l > -1 && U(a, a.l).G(false)
  }
}
Y.prototype.G = function(a) {
  Vd(this, nd(this, a))
};
function Wd(a) {
  $d(a, function(b, c) {
    return(b + 1) % c
  }, ld(a) - 1)
}
function Xd(a) {
  $d(a, function(b, c) {
    b--;
    return b < 0 ? c - 1 : b
  }, 0)
}
function Zd(a) {
  $d(a, function(b, c) {
    return(b + 1) % c
  }, a.l)
}
function Yd(a) {
  $d(a, function(b, c) {
    b--;
    return b < 0 ? c - 1 : b
  }, a.l)
}
function $d(a, b, c) {
  c = c < 0 ? nd(a, a.j) : c;
  var d = ld(a);
  c = b.call(a, c, d);
  for(var e = 0;e <= d;) {
    var f = U(a, c);
    if(f && f.m && f.r() && f.v & 2) {
      a.pb(c);
      return true
    }
    e++;
    c = b.call(a, c, d)
  }
  return false
}
Y.prototype.pb = function(a) {
  Vd(this, a)
};function ae() {
}
v(ae, Qd);
da(ae);
ae.prototype.z = m("goog-tab-bar");
ae.prototype.pa = m("tablist");
ae.prototype.qa = function(a) {
  var b = ae.c.qa.call(this, a);
  if(!this.zb) {
    var c = this.z();
    this.zb = Hb(be, c + "-top", ce, c + "-bottom", de, c + "-start", ee, c + "-end")
  }
  b.push(this.zb[a.kc]);
  return b
};function Z(a, b, c) {
  a = a || be;
  var d = a == de || a == ee ? Sd : Rd;
  if(this.b()) {
    throw Error("Component already rendered");
  }
  this.Z = d;
  this.kc = a;
  Y.call(this, this.Z, b || ae.W(), c);
  b = hd(this);
  R(b, this, ed, this.ec);
  R(b, this, "unselect", this.fc);
  R(b, this, "disable", this.cc);
  R(b, this, "hide", this.dc)
}
v(Z, Y);
var be = "top", ce = "bottom", de = "start", ee = "end";
p = Z.prototype;
p.Qb = true;
p.C = null;
p.i = function() {
  Z.c.i.call(this);
  this.C = null
};
p.removeChild = function(a, b) {
  fe(this, a);
  return Z.c.removeChild.call(this, a, b)
};
p.pb = function(a) {
  Z.c.pb.call(this, a);
  this.Qb && ge(this, U(this, a))
};
function ge(a, b) {
  if(b) {
    Gd(b, true)
  }else {
    a.C && Gd(a.C, false)
  }
}
function fe(a, b) {
  if(b && b == a.C) {
    for(var c = nd(a, b), d = c - 1;b = U(a, d);d--) {
      if(b.m && b.r()) {
        ge(a, b);
        return
      }
    }
    for(c = c + 1;b = U(a, c);c++) {
      if(b.m && b.r()) {
        ge(a, b);
        return
      }
    }
    ge(a, null)
  }
}
p = Z.prototype;
p.ec = function(a) {
  this.C && this.C != a.target && Gd(this.C, false);
  this.C = a.target
};
p.fc = function(a) {
  if(a.target == this.C) {
    this.C = null
  }
};
p.cc = function(a) {
  fe(this, a.target)
};
p.dc = function(a) {
  fe(this, a.target)
};
p.sa = function() {
  U(this, this.l) || this.G(this.C || U(this, 0))
};
Bd("goog-tab-bar", function() {
  return new Z
});var he, $, ie, je, ke = [], le, me = {polylineOptions:{strokeColor:"#FF0000", strokeWeight:4}, tc:{fillColor:"#FFFF99", fillOpacity:0.5, strokeWeight:2, strokeColor:"#FF0000"}};
function ne(a) {
  oe();
  if(ie) {
    ie.length = 0
  }
  bb(he, {geometry:a.latLng, tolerance:3, layerIds:[0, 2], layerOption:"all", bounds:$.getBounds(), width:$.getDiv().offsetWidth, height:$.getDiv().offsetHeight, overlayOptions:me}, function(b, c) {
    c ? alert(c.message + c.details.join("\n")) : pe(b, a.latLng)
  })
}
function oe() {
  if(ke) {
    for(var a = 0;a < ke.length;a++) {
      ke[a].setMap(null)
    }
    ke.length = 0
  }
}
function pe(a, b) {
  ie = a.results;
  le = {"0":[], "2":[]};
  for(var c = 0;c < ie.length;c++) {
    var d = ie[c];
    le[d.layerId].push(d)
  }
  d = [];
  for(var e in le) {
    c = le[e];
    var f = c.length, h = "", i = "";
    switch(e) {
      case "0":
        h = "Building";
        i = "Total features returned: <b>" + f + "</b>";
        if(f == 0) {
          break
        }
        i += "<table><tr><th>ID</th><th>Address</th></tr>";
        for(var j = 0;j < f;j++) {
          var k = c[j].bb.attributes;
          i += "<tr>";
          i += "<td><a href='javascript:void(0)' onclick='showFeature(" + e + "," + j + ")'>" + k.PARCELID + "</a></td>";
          i += "<td>" + k["Full Site Address"] + "</td>";
          i += "</tr>"
        }
        i += "</table>";
        break;
      case "2":
        h = "Parcel";
        i = "Total features returned: <b>" + f + "</b>";
        if(f === 0) {
          break
        }
        i += "<table border='1'><tr><th>ID</th><th>Year Built</th><th>School District</th><th>Description</th></tr>";
        for(j = 0;j < f;j++) {
          k = c[j].bb.attributes;
          i += "<tr>";
          i += "<td><a href='javascript:void(0)' onclick='showFeature(" + e + "," + j + ")'>" + k["Parcel Identification Number"] + "</td>";
          i += "<td>" + k["Residential Year Built"] + "</td>";
          i += "<td>" + k["School District Description"] + "</td>";
          i += "<td>" + k["Property Description"] + "</td>";
          i += "</tr>"
        }
        i += "</table>";
        break
    }
    d.push({label:h, content:i});
    f = document.createElement("div");
    f.style.width = "450px";
    h = new Z;
    for(c = 0;c < d.length;c++) {
      i = new Nd(d[c].label);
      i.content = d[c].content;
      h.Va(i, true)
    }
    kd(h, f);
    hc(f, dc("div", {"class":"goog-tab-bar-clear"}));
    var n = dc("div", {"class":"goog-tab-content"});
    f.appendChild(n);
    Nc(h, ed, function(l) {
      n.innerHTML = l.target.content
    });
    ge(h, U(h, 0));
    if(je) {
      je.setContent(f);
      je.setPosition(b)
    }else {
      je = new google.maps.InfoWindow({content:f, position:b})
    }
    je.open($)
  }
}
window.onload = function() {
  var a = {zoom:17, center:new google.maps.LatLng(42.579693, -83.28072), mapTypeId:google.maps.MapTypeId.ROADMAP, draggableCursor:"pointer", streetViewControl:true};
  $ = new google.maps.Map(document.getElementById("map_canvas"), a);
  he = new db("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer");
  (new E(he, {opacity:0.2})).setMap($);
  google.maps.event.addListener($, "click", ne)
};
window.showFeature = function(a, b) {
  window.status = "showFeature";
  oe();
  var c = le[a][b].bb;
  if(c.geometry) {
    for(var d = 0;d < c.geometry.length;d++) {
      ke.push(c.geometry[d]);
      c.geometry[d].setMap($)
    }
  }
};})()