﻿(function () {
    var b;
    function g(a) {
        this.extend(g, google.maps.OverlayView); this.b = []; this.d = null; this.h = 100; this.m = false; a = a || {}; if (a.backgroundColor == undefined) a.backgroundColor = this.z; if (a.borderColor == undefined) a.borderColor = this.A; if (a.borderRadius == undefined) a.borderRadius = this.B; if (a.borderWidth == undefined) a.borderWidth = this.C; if (a.padding == undefined) a.padding = this.F; if (a.arrowPosition == undefined) a.arrowPosition = this.u; if (a.disableAutoPan == undefined) a.disableAutoPan = false; if (a.disableAnimation == undefined) a.disableAnimation = false;
        if (a.minWidth == undefined) a.minWidth = this.D; if (a.shadowStyle == undefined) a.shadowStyle = this.G; if (a.arrowSize == undefined) a.arrowSize = this.v; if (a.arrowStyle == undefined) a.arrowStyle = this.w; k(this); this.setValues(a)
    } window.InfoBubble = g; b = g.prototype; b.v = 15; b.w = 0; b.G = 1; b.D = 50; b.u = 50; b.F = 10; b.C = 1; b.A = "#ccc"; b.B = 10; b.z = "#fff"; b.extend = function (a, c) { return function (d) { for (var f in d.prototype) this.prototype[f] = d.prototype[f]; return this } .apply(a, [c]) };
    function k(a) {
        var c = a.c = document.createElement("DIV"); c.style.position = "absolute"; c.style.zIndex = a.h; (a.i = document.createElement("DIV")).style.position = "relative"; var d = a.l = document.createElement("IMG"); d.style.position = "absolute"; d.style.width = l(a, 12); d.style.height = l(a, 12); d.style.border = 0; d.style.zIndex = a.h + 1; d.style.cursor = "pointer"; d.src = "http://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif"; google.maps.event.addDomListener(d, "click", function () { a.close(); google.maps.event.trigger(a, "closeclick") });
        var f = a.e = document.createElement("DIV"); f.style.overflowX = "auto"; f.style.overflowY = "auto"; f.style.cursor = "default"; f.style.clear = "both"; f.style.position = "relative"; var e = a.j = document.createElement("DIV"); f.appendChild(e); e = a.L = document.createElement("DIV"); e.style.position = "relative"; var h = a.n = document.createElement("DIV"), i = a.k = document.createElement("DIV"), j = p(a); h.style.position = i.style.position = "absolute"; h.style.left = i.style.left = "50%"; h.style.height = i.style.height = "0"; h.style.width = i.style.width =
"0"; h.style.marginLeft = l(a, -j); h.style.borderWidth = l(a, j); h.style.borderBottomWidth = 0; j = a.a = document.createElement("DIV"); j.style.position = "absolute"; c.style.display = j.style.display = "none"; c.appendChild(a.i); c.appendChild(d); c.appendChild(f); e.appendChild(h); e.appendChild(i); c.appendChild(e); c = document.createElement("style"); c.setAttribute("type", "text/css"); a.g = "_ibani_" + Math.round(Math.random() * 1E4); c.textContent = "." + a.g + "{-webkit-animation-name:" + a.g + ";-webkit-animation-duration:0.5s;-webkit-animation-iteration-count:1;}@-webkit-keyframes " +
a.g + " {from {-webkit-transform: scale(0)}50% {-webkit-transform: scale(1.2)}90% {-webkit-transform: scale(0.95)}to {-webkit-transform: scale(1)}}"; document.getElementsByTagName("head")[0].appendChild(c)
    } b.da = function (a) { this.set("backgroundClassName", a) }; g.prototype.setBackgroundClassName = g.prototype.da; g.prototype.M = function () { this.j.className = this.get("backgroundClassName") }; g.prototype.backgroundClassName_changed = g.prototype.M; g.prototype.pa = function (a) { this.set("tabClassName", a) };
    g.prototype.setTabClassName = g.prototype.pa; g.prototype.sa = function () { s(this) }; g.prototype.tabClassName_changed = g.prototype.sa; g.prototype.ca = function (a) { this.set("arrowStyle", a) }; g.prototype.setArrowStyle = g.prototype.ca; g.prototype.K = function () { this.p() }; g.prototype.arrowStyle_changed = g.prototype.K; function p(a) { return parseInt(a.get("arrowSize"), 10) || 0 } g.prototype.ba = function (a) { this.set("arrowSize", a) }; g.prototype.setArrowSize = g.prototype.ba; g.prototype.p = function () { this.r() };
    g.prototype.arrowSize_changed = g.prototype.p; g.prototype.aa = function (a) { this.set("arrowPosition", a) }; g.prototype.setArrowPosition = g.prototype.aa; g.prototype.J = function () { this.n.style.left = this.k.style.left = (parseInt(this.get("arrowPosition"), 10) || 0) + "%"; t(this) }; g.prototype.arrowPosition_changed = g.prototype.J; g.prototype.setZIndex = function (a) { this.set("zIndex", a) }; g.prototype.setZIndex = g.prototype.setZIndex;
    g.prototype.ua = function () { this.c.style.zIndex = this.h = this.va(); this.l.style.zIndex = zIndex_ + 1 }; g.prototype.zIndex_changed = g.prototype.ua; g.prototype.na = function (a) { this.set("shadowStyle", a) }; g.prototype.setShadowStyle = g.prototype.na;
    g.prototype.qa = function () { var a = "", c = "", d = ""; switch (parseInt(this.get("shadowStyle"), 10) || 0) { case 0: a = "none"; break; case 1: c = "40px 15px 10px rgba(33,33,33,0.3)"; d = "transparent"; break; case 2: c = "0 0 2px rgba(33,33,33,0.3)"; d = "rgba(33,33,33,0.35)" } this.a.style.boxShadow = this.a.style.webkitBoxShadow = this.a.style.MozBoxShadow = c; this.a.style.backgroundColor = d; if (this.m) { this.a.style.display = a; this.draw() } }; g.prototype.shadowStyle_changed = g.prototype.qa;
    g.prototype.ra = function () { this.set("hideCloseButton", false) }; g.prototype.showCloseButton = g.prototype.ra; g.prototype.Q = function () { this.set("hideCloseButton", true) }; g.prototype.hideCloseButton = g.prototype.Q; g.prototype.R = function () { this.l.style.display = this.get("hideCloseButton") ? "none" : "" }; g.prototype.hideCloseButton_changed = g.prototype.R; g.prototype.ea = function (a) { a && this.set("backgroundColor", a) }; g.prototype.setBackgroundColor = g.prototype.ea;
    g.prototype.N = function () { var a = this.get("backgroundColor"); this.e.style.backgroundColor = a; this.k.style.borderColor = a + " transparent transparent"; s(this) }; g.prototype.backgroundColor_changed = g.prototype.N; g.prototype.fa = function (a) { a && this.set("borderColor", a) }; g.prototype.setBorderColor = g.prototype.fa;
    g.prototype.O = function () { var a = this.get("borderColor"), c = this.e, d = this.n; c.style.borderColor = a; d.style.borderColor = a + " transparent transparent"; c.style.borderStyle = d.style.borderStyle = this.k.style.borderStyle = "solid"; s(this) }; g.prototype.borderColor_changed = g.prototype.O; g.prototype.ga = function (a) { this.set("borderRadius", a) }; g.prototype.setBorderRadius = g.prototype.ga; function u(a) { return parseInt(a.get("borderRadius"), 10) || 0 }
    g.prototype.q = function () { var a = u(this), c = v(this); this.e.style.borderRadius = this.e.style.MozBorderRadius = this.e.style.webkitBorderRadius = this.a.style.borderRadius = this.a.style.MozBorderRadius = this.a.style.webkitBorderRadius = l(this, a); this.i.style.paddingLeft = this.i.style.paddingRight = l(this, a + c); t(this) }; g.prototype.borderRadius_changed = g.prototype.q; function v(a) { return parseInt(a.get("borderWidth"), 10) || 0 } g.prototype.ha = function (a) { this.set("borderWidth", a) }; g.prototype.setBorderWidth = g.prototype.ha;
    g.prototype.r = function () {
        var a = v(this); this.e.style.borderWidth = l(this, a); this.i.style.top = l(this, a); a = v(this); var c = p(this), d = parseInt(this.get("arrowStyle"), 10) || 0, f = l(this, c), e = l(this, Math.max(0, c - a)), h = this.n, i = this.k; this.L.style.marginTop = l(this, -a); h.style.borderTopWidth = f; i.style.borderTopWidth = e; if (d == 0 || d == 1) { h.style.borderLeftWidth = f; i.style.borderLeftWidth = e } else h.style.borderLeftWidth = i.style.borderLeftWidth = 0; if (d == 0 || d == 2) { h.style.borderRightWidth = f; i.style.borderRightWidth = e } else h.style.borderRightWidth =
i.style.borderRightWidth = 0; if (d < 2) { h.style.marginLeft = l(this, -c); i.style.marginLeft = l(this, -(c - a)) } else h.style.marginLeft = i.style.marginLeft = 0; h.style.display = a == 0 ? "none" : ""; s(this); this.q(); t(this)
    }; g.prototype.borderWidth_changed = g.prototype.r; g.prototype.ma = function (a) { this.set("padding", a) }; g.prototype.setPadding = g.prototype.ma; function w(a) { return parseInt(a.get("padding"), 10) || 0 } g.prototype.Y = function () { this.e.style.padding = l(this, w(this)); s(this); t(this) }; g.prototype.padding_changed = g.prototype.Y;
    function l(a, c) { if (c) return c + "px"; return c } function y(a) { var c = ["mousedown", "mousemove", "mouseover", "mouseout", "mouseup", "mousewheel", "DOMMouseScroll", "touchstart", "touchend", "touchmove", "dblclick", "contextmenu", "click"], d = a.c; a.s = []; for (var f = 0, e; e = c[f]; f++) a.s.push(google.maps.event.addDomListener(d, e, function (h) { h.cancelBubble = true; h.stopPropagation && h.stopPropagation() })) } g.prototype.onAdd = function () { this.c || k(this); y(this); var a = this.getPanes(); if (a) { a.floatPane.appendChild(this.c); a.floatShadow.appendChild(this.a) } };
    g.prototype.onAdd = g.prototype.onAdd;
    g.prototype.draw = function () {
        var a = this.getProjection(); if (a) {
            var c = this.get("position"); if (c) {
                var d = 0; if (this.d) d = this.d.offsetHeight; var f = z(this), e = p(this), h = parseInt(this.get("arrowPosition"), 10) || 0; h /= 100; a = a.fromLatLngToDivPixel(c); if (c = this.e.offsetWidth) {
                    var i = a.y - (this.c.offsetHeight + e); if (f) i -= f; var j = a.x - c * h; this.c.style.top = l(this, i); this.c.style.left = l(this, j); switch (parseInt(this.get("shadowStyle"), 10)) {
                        case 1: this.a.style.top = l(this, i + d - 1); this.a.style.left = l(this, j); this.a.style.width =
l(this, c); this.a.style.height = l(this, this.e.offsetHeight - e); break; case 2: c *= 0.8; this.a.style.top = f ? l(this, a.y) : l(this, a.y + e); this.a.style.left = l(this, a.x - c * h); this.a.style.width = l(this, c); this.a.style.height = l(this, 2)
                    } 
                } 
            } else this.close()
        } 
    }; g.prototype.draw = g.prototype.draw; g.prototype.onRemove = function () { this.c && this.c.parentNode && this.c.parentNode.removeChild(this.c); this.a && this.a.parentNode && this.a.parentNode.removeChild(this.a); for (var a = 0, c; c = this.s[a]; a++) google.maps.event.removeListener(c) };
    g.prototype.onRemove = g.prototype.onRemove; g.prototype.S = function () { return this.m }; g.prototype.isOpen = g.prototype.S; g.prototype.close = function () { if (this.c) { this.c.style.display = "none"; this.c.className = this.c.className.replace(this.g, "") } if (this.a) { this.a.style.display = "none"; this.a.className = this.a.className.replace(this.g, "") } this.m = false }; g.prototype.close = g.prototype.close;
    g.prototype.open = function (a, c) { a && this.setMap(a); if (c) { this.set("anchor", c); this.bindTo("anchorPoint", c); this.bindTo("position", c) } this.c.style.display = this.a.style.display = ""; if (!this.get("disableAnimation")) { this.c.className += " " + this.g; this.a.className += " " + this.g } t(this); this.m = true; if (!this.get("disableAutoPan")) { var d = this; window.setTimeout(function () { d.o() }, 200) } }; g.prototype.open = g.prototype.open; g.prototype.setPosition = function (a) { a && this.set("position", a) }; g.prototype.setPosition = g.prototype.setPosition;
    g.prototype.getPosition = function () { return this.get("position") }; g.prototype.getPosition = g.prototype.getPosition; g.prototype.Z = function () { this.draw() }; g.prototype.position_changed = g.prototype.Z;
    g.prototype.o = function () { var a = this.getProjection(); if (a) if (this.c) { var c = this.c.offsetHeight + z(this), d = this.get("map"), f = d.getDiv().offsetHeight, e = this.getPosition(), h = a.fromLatLngToContainerPixel(d.getCenter()); e = a.fromLatLngToContainerPixel(e); c = h.y - c; f = f - h.y; h = 0; if (c < 0) { c *= -1; h = (c + f) / 2 } e.y -= h; e = a.fromContainerPixelToLatLng(e); d.getCenter() != e && d.panTo(e) } }; g.prototype.panToView = g.prototype.o;
    function A(a, c) { c = c.replace(/^\s*([\S\s]*)\b\s*$/, "$1"); var d = document.createElement("DIV"); d.innerHTML = c; if (d.childNodes.length == 1) return d.removeChild(d.firstChild); else { for (var f = document.createDocumentFragment(); d.firstChild; ) f.appendChild(d.firstChild); return f } } function B(a, c) { if (c) for (var d; d = c.firstChild; ) c.removeChild(d) } g.prototype.setContent = function (a) { this.set("content", a) }; g.prototype.setContent = g.prototype.setContent; g.prototype.getContent = function () { return this.get("content") };
    g.prototype.getContent = g.prototype.getContent; g.prototype.P = function () { if (this.j) { B(this, this.j); var a = this.getContent(); if (a) { if (typeof a == "string") a = A(this, a); this.j.appendChild(a); var c = this; a = this.j.getElementsByTagName("IMG"); for (var d = 0, f; f = a[d]; d++) google.maps.event.addDomListener(f, "load", function () { var e = !c.get("disableAutoPan"); t(c); if (e && (c.b.length == 0 || c.d.index == 0)) c.o() }); google.maps.event.trigger(this, "domready") } t(this) } }; g.prototype.content_changed = g.prototype.P;
    function s(a) { if (a.b && a.b.length) { for (var c = 0, d; d = a.b[c]; c++) C(a, d.f); a.d.style.zIndex = a.h; c = v(a); d = w(a) / 2; a.d.style.borderBottomWidth = 0; a.d.style.paddingBottom = l(a, d + c) } }
    function C(a, c) {
        var d = a.get("backgroundColor"), f = a.get("borderColor"), e = u(a), h = v(a), i = w(a), j = l(a, -Math.max(i, e)); e = l(a, e); var o = a.h; if (c.index) o -= c.index; d = { cssFloat: "left", position: "relative", cursor: "pointer", backgroundColor: d, border: l(a, h) + " solid " + f, padding: l(a, i / 2) + " " + l(a, i), marginRight: j, whiteSpace: "nowrap", borderRadiusTopLeft: e, MozBorderRadiusTopleft: e, webkitBorderTopLeftRadius: e, borderRadiusTopRight: e, MozBorderRadiusTopright: e, webkitBorderTopRightRadius: e, zIndex: o, display: "inline" }; for (var m in d) c.style[m] =
d[m]; m = a.get("tabClassName"); if (m != undefined) c.className += " " + m
    } function D(a, c) { c.T = google.maps.event.addDomListener(c, "click", function () { E(a, this) }) } g.prototype.oa = function (a) { (a = this.b[a - 1]) && E(this, a.f) }; g.prototype.setTabActive = g.prototype.oa;
    function E(a, c) { if (c) { var d = w(a) / 2, f = v(a); if (a.d) { var e = a.d; e.style.zIndex = a.h - e.index; e.style.paddingBottom = l(a, d); e.style.borderBottomWidth = l(a, f) } c.style.zIndex = a.h; c.style.borderBottomWidth = 0; c.style.marginBottomWidth = "-10px"; c.style.paddingBottom = l(a, d + f); a.setContent(a.b[c.index].content); a.d = c; t(a) } else a.setContent("") } g.prototype.ja = function (a) { this.set("maxWidth", a) }; g.prototype.setMaxWidth = g.prototype.ja; g.prototype.V = function () { t(this) }; g.prototype.maxWidth_changed = g.prototype.V;
    g.prototype.ia = function (a) { this.set("maxHeight", a) }; g.prototype.setMaxHeight = g.prototype.ia; g.prototype.U = function () { t(this) }; g.prototype.maxHeight_changed = g.prototype.U; g.prototype.la = function (a) { this.set("minWidth", a) }; g.prototype.setMinWidth = g.prototype.la; g.prototype.X = function () { t(this) }; g.prototype.minWidth_changed = g.prototype.X; g.prototype.ka = function (a) { this.set("minHeight", a) }; g.prototype.setMinHeight = g.prototype.ka; g.prototype.W = function () { t(this) }; g.prototype.minHeight_changed = g.prototype.W;
    g.prototype.H = function (a, c) { var d = document.createElement("DIV"); d.innerHTML = a; C(this, d); D(this, d); this.i.appendChild(d); this.b.push({ label: a, content: c, f: d }); d.index = this.b.length - 1; d.style.zIndex = this.h - d.index; this.d || E(this, d); d.className = d.className + " " + this.g; t(this) }; g.prototype.addTab = g.prototype.H;
    g.prototype.ta = function (a, c, d) { if (!(!this.b.length || a < 0 || a >= this.b.length)) { a = this.b[a]; if (c != undefined) a.f.innerHTML = a.label = c; if (d != undefined) a.content = d; this.d == a.f && this.setContent(a.content); t(this) } }; g.prototype.updateTab = g.prototype.ta;
    g.prototype.$ = function (a) { if (!(!this.b.length || a < 0 || a >= this.b.length)) { var c = this.b[a]; c.f.parentNode.removeChild(c.f); google.maps.event.removeListener(c.f.T); this.b.splice(a, 1); delete c; for (var d = 0, f; f = this.b[d]; d++) f.f.index = d; if (c.f == this.d) { this.d = this.b[a] ? this.b[a].f : this.b[a - 1] ? this.b[a - 1].f : undefined; E(this, this.d) } t(this) } }; g.prototype.removeTab = g.prototype.$;
    function F(a, c, d, f) {
        var e = document.createElement("DIV"); e.style.display = "inline"; e.style.position = "absolute"; e.style.visibility = "hidden"; if (typeof c == "string") e.innerHTML = c; else e.appendChild(c.cloneNode(true)); document.body.appendChild(e); c = new google.maps.Size(e.offsetWidth, e.offsetHeight); if (d && c.width > d) { e.style.width = l(a, d); c = new google.maps.Size(e.offsetWidth, e.offsetHeight) } if (f && c.height > f) { e.style.height = l(a, f); c = new google.maps.Size(e.offsetWidth, e.offsetHeight) } document.body.removeChild(e);
        delete e; return c
    }
    function t(a) {
        var c = a.get("map"); if (c) {
            var d = w(a); v(a); u(a); var f = p(a), e = c.getDiv(), h = f * 2; c = e.offsetWidth - h; e = e.offsetHeight - h - z(a); h = 0; var i = a.get("minWidth") || 0, j = a.get("minHeight") || 0, o = a.get("maxWidth") || 0, m = a.get("maxHeight") || 0; o = Math.min(c, o); m = Math.min(e, m); var x = 0; if (a.b.length) for (var q = 0, n; n = a.b[q]; q++) { var r = F(a, n.f, o, m); n = F(a, n.content, o, m); if (i < r.width) i = r.width; x += r.width; if (j < r.height) j = r.height; if (r.height > h) h = r.height; if (i < n.width) i = n.width; if (j < n.height) j = n.height } else {
                q = a.get("content");
                if (typeof q == "string") q = A(a, q); if (q) { n = F(a, q, o, m); if (i < n.width) i = n.width; if (j < n.height) j = n.height } 
            } if (o) i = Math.min(i, o); if (m) j = Math.min(j, m); i = Math.max(i, x); if (i == x) i += 2 * d; f *= 2; i = Math.max(i, f); if (i > c) i = c; if (j > e) j = e - h; if (a.i) { a.t = h; a.i.style.width = l(a, x) } a.e.style.width = l(a, i); a.e.style.height = l(a, j)
        } u(a); c = v(a); f = d = 2; if (a.b.length && a.t) f += a.t; f += c; d += c; if ((c = a.e) && c.clientHeight < c.scrollHeight) d += 15; a.l.style.right = l(a, d); a.l.style.top = l(a, f); a.draw()
    }
    function z(a) { if (a.get("anchor")) if (a = a.get("anchorPoint")) return -1 * a.y; return 0 } g.prototype.I = function () { this.draw() }; g.prototype.anchorPoint_changed = g.prototype.I;
})();
