//------------------------------// CLEAR INPUT FORMS

/*
* clearingInput: a jQuery plugin
*
* clearingInput is a simple jQuery plugin that provides example/label text
* inside text inputs that automatically clears when the input is focused.
* Common uses are for a hint/example, or as a label when space is limited.
*
* For usage and examples, visit:
* http://github.com/alexrabarts/jquery-clearinginput
*
* Licensed under the MIT:
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright (c) 2008 Stateless Systems (http://statelesssystems.com)
*
* @author   Alex Rabarts (alexrabarts -at- gmail -dawt- com)
* @requires jQuery v1.2 or later
* @version  0.1.2
*/

(function (jQuery) {
    jQuery.extend(jQuery.fn, {
        clearingInput: function (options) {
            var defaults = { blurClass: 'blur' };

            options = jQuery.extend(defaults, options);

            return this.each(function () {
                var input = jQuery(this).addClass(options.blurClass);
                var form = input.parents('form:first');
                var label, text;

                text = options.text || textFromLabel() || input.val();

                if (text) {
                    input.val(text);

                    input.blur(function () {
                        if (input.val() === '') {
                            input.addClass(options.blurClass).val(text);
                        }
                    }).focus(function () {
                        if (input.val() === text) {
                            input.val('');
                        }
                        input.removeClass(options.blurClass);
                    });

                    form.submit(function () {
                        if (input.hasClass(options.blurClass)) {
                            input.val('');
                        }
                    });

                    input.blur();
                }

                function textFromLabel() {
                    label = form.find('label[for=' + input.attr('id') + ']');
                    // Position label off screen and use it for the input text
                    return label ? label.css({ position: 'absolute', left: '-9999px' }).text() : '';
                }
            });
        }
    });
})(jQuery);


// ColorBox v1.3.16 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function (a, b, c) { function ba(b) { if (!T) { O = b, Z(a.extend(J, a.data(O, e))), x = a(O), P = 0, J.rel !== "nofollow" && (x = a("." + V).filter(function () { var b = a.data(this, e).rel || this.rel; return b === J.rel }), P = x.index(O), P === -1 && (x = x.add(O), P = x.length - 1)); if (!R) { R = S = !0, q.show(); if (J.returnFocus) try { O.blur(), a(O).one(k, function () { try { this.focus() } catch (a) { } }) } catch (c) { } p.css({ opacity: +J.opacity, cursor: J.overlayClose ? "pointer" : "auto" }).show(), J.w = X(J.initialWidth, "x"), J.h = X(J.initialHeight, "y"), U.position(0), n && y.bind("resize." + o + " scroll." + o, function () { p.css({ width: y.width(), height: y.height(), top: y.scrollTop(), left: y.scrollLeft() }) }).trigger("resize." + o), jQuery(g, J.onOpen), I.add(C).hide(), H.html(J.close).show() } U.load(!0) } } function _() { var a, b = f + "Slideshow_", c = "click." + f, d, e, g; J.slideshow && x[1] && (d = function () { E.text(J.slideshowStop).unbind(c).bind(i, function () { if (P < x.length - 1 || J.loop) a = setTimeout(U.next, J.slideshowSpeed) }).bind(h, function () { clearTimeout(a) }).one(c + " " + j, e), q.removeClass(b + "off").addClass(b + "on"), a = setTimeout(U.next, J.slideshowSpeed) }, e = function () { clearTimeout(a), E.text(J.slideshowStart).unbind([i, h, j, c].join(" ")).one(c, d), q.removeClass(b + "on").addClass(b + "off") }, J.slideshowAuto ? d() : e()) } function jQuery(b, c) { c && c.call(O), a.event.trigger(b) } function Z(b) { for (var c in b) a.isFunction(b[c]) && c.substring(0, 2) !== "on" && (b[c] = b[c].call(O)); b.rel = b.rel || O.rel || "nofollow", b.href = a.trim(b.href || a(O).attr("href")), b.title = b.title || O.title } function Y(a) { return J.photo || /\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?jQuery/i.test(a) } function X(a, b) { b = b === "x" ? y.width() : y.height(); return typeof a == "string" ? Math.round(/%/.test(a) ? b / 100 * parseInt(a, 10) : parseInt(a, 10)) : a } function W(c, d) { var e = b.createElement("div"); c && (e.id = f + c), e.style.cssText = d || !1; return a(e) } var d = { transition: "elastic", speed: 300, width: !1, initialWidth: "600", innerWidth: !1, maxWidth: !1, height: !1, initialHeight: "450", innerHeight: !1, maxHeight: !1, scalePhotos: !0, scrolling: !0, inline: !1, html: !1, iframe: !1, fastIframe: !0, photo: !1, href: !1, title: !1, rel: !1, opacity: .9, preloading: !0, current: "image {current} of {total}", previous: "previous", next: "next", close: "close", open: !1, returnFocus: !0, loop: !0, slideshow: !1, slideshowAuto: !0, slideshowSpeed: 2500, slideshowStart: "start slideshow", slideshowStop: "stop slideshow", onOpen: !1, onLoad: !1, onComplete: !1, onCleanup: !1, onClosed: !1, overlayClose: !0, escKey: !0, arrowKey: !0 }, e = "colorbox", f = "cbox", g = f + "_open", h = f + "_load", i = f + "_complete", j = f + "_cleanup", k = f + "_closed", l = f + "_purge", m = a.browser.msie && !a.support.opacity, n = m && a.browser.version < 7, o = f + "_IE6", p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J = {}, K, L, M, N, O, P, Q, R, S, T = !1, U, V = f + "Element"; U = a.fn[e] = a[e] = function (b, c) { var f = this, g; if (!f[0] && f.selector) return f; b = b || {}, c && (b.onComplete = c); if (!f[0] || f.selector === undefined) f = a("<a/>"), b.open = !0; f.each(function () { a.data(this, e, a.extend({}, a.data(this, e) || d, b)), a(this).addClass(V) }), g = b.open, a.isFunction(g) && (g = g.call(f)), g && ba(f[0]); return f }, U.init = function () { y = a(c), q = W().attr({ id: e, "class": m ? f + (n ? "IE6" : "IE") : "" }), p = W("Overlay", n ? "position:absolute" : "").hide(), r = W("Wrapper"), s = W("Content").append(z = W("LoadedContent", "width:0; height:0; overflow:hidden"), B = W("LoadingOverlay").add(W("LoadingGraphic")), C = W("Title"), D = W("Current"), F = W("Next"), G = W("Previous"), E = W("Slideshow").bind(g, _), H = W("Close")), r.append(W().append(W("TopLeft"), t = W("TopCenter"), W("TopRight")), W(!1, "clear:left").append(u = W("MiddleLeft"), s, v = W("MiddleRight")), W(!1, "clear:left").append(W("BottomLeft"), w = W("BottomCenter"), W("BottomRight"))).children().children().css({ "float": "left" }), A = W(!1, "position:absolute; width:9999px; visibility:hidden; display:none"), a("body").prepend(p, q.append(r, A)), s.children().hover(function () { a(this).addClass("hover") }, function () { a(this).removeClass("hover") }).addClass("hover"), K = t.height() + w.height() + s.outerHeight(!0) - s.height(), L = u.width() + v.width() + s.outerWidth(!0) - s.width(), M = z.outerHeight(!0), N = z.outerWidth(!0), q.css({ "padding-bottom": K, "padding-right": L }).hide(), F.click(function () { U.next() }), G.click(function () { U.prev() }), H.click(function () { U.close() }), I = F.add(G).add(D).add(E), s.children().removeClass("hover"), a("." + V).live("click", function (a) { a.button !== 0 && typeof a.button != "undefined" || a.ctrlKey || a.shiftKey || a.altKey || (a.preventDefault(), ba(this)) }), p.click(function () { J.overlayClose && U.close() }), a(b).bind("keydown." + f, function (a) { var b = a.keyCode; R && J.escKey && b === 27 && (a.preventDefault(), U.close()), R && J.arrowKey && x[1] && (b === 37 ? (a.preventDefault(), G.click()) : b === 39 && (a.preventDefault(), F.click())) }) }, U.remove = function () { q.add(p).remove(), a("." + V).die("click").removeData(e).removeClass(V) }, U.position = function (a, c) { function g(a) { t[0].style.width = w[0].style.width = s[0].style.width = a.style.width, B[0].style.height = B[1].style.height = s[0].style.height = u[0].style.height = v[0].style.height = a.style.height } var d, e = Math.max(b.documentElement.clientHeight - J.h - M - K, 0) / 2 + y.scrollTop(), f = Math.max(y.width() - J.w - N - L, 0) / 2 + y.scrollLeft(); d = q.width() === J.w + N && q.height() === J.h + M ? 0 : a, r[0].style.width = r[0].style.height = "9999px", q.dequeue().animate({ width: J.w + N, height: J.h + M, top: e, left: f }, { duration: d, complete: function () { g(this), S = !1, r[0].style.width = J.w + N + L + "px", r[0].style.height = J.h + M + K + "px", c && c() }, step: function () { g(this) } }) }, U.resize = function (a) { if (R) { a = a || {}, a.width && (J.w = X(a.width, "x") - N - L), a.innerWidth && (J.w = X(a.innerWidth, "x")), z.css({ width: J.w }), a.height && (J.h = X(a.height, "y") - M - K), a.innerHeight && (J.h = X(a.innerHeight, "y")); if (!a.innerHeight && !a.height) { var b = z.wrapInner("<div style='overflow:auto'></div>").children(); J.h = b.height(), b.replaceWith(b.children()) } z.css({ height: J.h }), U.position(J.transition === "none" ? 0 : J.speed) } }, U.prep = function (b) { function h(b) { U.position(b, function () { var b, d, g, h, j = x.length, k, n; !R || (n = function () { B.hide(), jQuery(i, J.onComplete) }, m && Q && z.fadeIn(100), C.html(J.title).add(z).show(), j > 1 ? (typeof J.current == "string" && D.html(J.current.replace(/\{current\}/, P + 1).replace(/\{total\}/, j)).show(), F[J.loop || P < j - 1 ? "show" : "hide"]().html(J.next), G[J.loop || P ? "show" : "hide"]().html(J.previous), b = P ? x[P - 1] : x[j - 1], g = P < j - 1 ? x[P + 1] : x[0], J.slideshow && E.show(), J.preloading && (h = a.data(g, e).href || g.href, d = a.data(b, e).href || b.href, h = a.isFunction(h) ? h.call(g) : h, d = a.isFunction(d) ? d.call(b) : d, Y(h) && (a("<img/>")[0].src = h), Y(d) && (a("<img/>")[0].src = d))) : I.hide(), J.iframe ? (k = a("<iframe/>").addClass(f + "Iframe")[0], J.fastIframe ? n() : a(k).load(n), k.name = f + +(new Date), k.src = J.href, J.scrolling || (k.scrolling = "no"), m && (k.frameBorder = 0, k.allowTransparency = "true"), a(k).appendTo(z).one(l, function () { k.src = "//about:blank" })) : n(), J.transition === "fade" ? q.fadeTo(c, 1, function () { q[0].style.filter = "" }) : q[0].style.filter = "", y.bind("resize." + f, function () { U.position(0) })) }) } function g() { J.h = J.h || z.height(), J.h = J.mh && J.mh < J.h ? J.mh : J.h; return J.h } function d() { J.w = J.w || z.width(), J.w = J.mw && J.mw < J.w ? J.mw : J.w; return J.w } if (!!R) { var c = J.transition === "none" ? 0 : J.speed; y.unbind("resize." + f), z.remove(), z = W("LoadedContent").html(b), z.hide().appendTo(A.show()).css({ width: d(), overflow: J.scrolling ? "auto" : "hidden" }).css({ height: g() }).prependTo(s), A.hide(), a(Q).css({ "float": "none" }), n && a("select").not(q.find("select")).filter(function () { return this.style.visibility !== "hidden" }).css({ visibility: "hidden" }).one(j, function () { this.style.visibility = "inherit" }), J.transition === "fade" ? q.fadeTo(c, 0, function () { h(0) }) : h(c) } }, U.load = function (b) { var c, d, g = U.prep; S = !0, Q = !1, O = x[P], b || Z(a.extend(J, a.data(O, e))), jQuery(l), jQuery(h, J.onLoad), J.h = J.height ? X(J.height, "y") - M - K : J.innerHeight && X(J.innerHeight, "y"), J.w = J.width ? X(J.width, "x") - N - L : J.innerWidth && X(J.innerWidth, "x"), J.mw = J.w, J.mh = J.h, J.maxWidth && (J.mw = X(J.maxWidth, "x") - N - L, J.mw = J.w && J.w < J.mw ? J.w : J.mw), J.maxHeight && (J.mh = X(J.maxHeight, "y") - M - K, J.mh = J.h && J.h < J.mh ? J.h : J.mh), c = J.href, B.show(), J.inline ? (W().hide().insertBefore(a(c)[0]).one(l, function () { a(this).replaceWith(z.children()) }), g(a(c))) : J.iframe ? g(" ") : J.html ? g(J.html) : Y(c) ? (a(Q = new Image).addClass(f + "Photo").error(function () { J.title = !1, g(W("Error").text("This image could not be loaded")) }).load(function () { var a; Q.onload = null, J.scalePhotos && (d = function () { Q.height -= Q.height * a, Q.width -= Q.width * a }, J.mw && Q.width > J.mw && (a = (Q.width - J.mw) / Q.width, d()), J.mh && Q.height > J.mh && (a = (Q.height - J.mh) / Q.height, d())), J.h && (Q.style.marginTop = Math.max(J.h - Q.height, 0) / 2 + "px"), x[1] && (P < x.length - 1 || J.loop) && (Q.style.cursor = "pointer", Q.onclick = function () { U.next() }), m && (Q.style.msInterpolationMode = "bicubic"), setTimeout(function () { g(Q) }, 1) }), setTimeout(function () { Q.src = c }, 1)) : c && A.load(c, function (b, c, d) { g(c === "error" ? W("Error").text("Request unsuccessful: " + d.statusText) : a(this).contents()) }) }, U.next = function () { !S && x[1] && (P < x.length - 1 || J.loop) && (P = P < x.length - 1 ? P + 1 : 0, U.load()) }, U.prev = function () { !S && x[1] && (P || J.loop) && (P = P ? P - 1 : x.length - 1, U.load()) }, U.close = function () { R && !T && (T = !0, R = !1, jQuery(j, J.onCleanup), y.unbind("." + f + " ." + o), p.fadeTo(200, 0), q.stop().fadeTo(300, 0, function () { q.add(p).css({ opacity: 1, cursor: "auto" }).hide(), jQuery(l), z.remove(), setTimeout(function () { T = !1, jQuery(k, J.onClosed) }, 1) })) }, U.element = function () { return a(O) }, U.settings = d, a(U.init) })(jQuery, document, this);

/*
*  GMAP3 Plugin for JQuery 
*  Version   : 4.0
*  Date      : 2011-08-23
*  Licence   : GPL v3 : http://www.gnu.org/licenses/gpl.html  
*  Author    : DEMONTE Jean-Baptiste
*  Contact   : jbdemonte@gmail.com
*  Web site  : http://gmap3.net
*   
*  Copyright (c) 2010-2011 Jean-Baptiste DEMONTE
*  All rights reserved.
*   
* Redistribution and use in source and binary forms, with or without 
* modification, are permitted provided that the following conditions are met:
* 
*   - Redistributions of source code must retain the above copyright
*     notice, this list of conditions and the following disclaimer.
*   - Redistributions in binary form must reproduce the above 
*     copyright notice, this list of conditions and the following 
*     disclaimer in the documentation and/or other materials provided 
*     with the distribution.
*   - Neither the name of the author nor the names of its contributors 
*     may be used to endorse or promote products derived from this 
*     software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
* POSSIBILITY OF SUCH DAMAGE.
*/

(function (c) { function q() { var D = []; this.empty = function () { for (var E = 0; E < D.length; E++) { if (D[E]) { return false } } return true }; this.add = function (E) { D.push(E) }; this.addNext = function (F) { var H = [], G, E = 0; for (G = 0; G < D.length; G++) { if (!D[G]) { continue } if (E == 1) { H.push(F) } H.push(D[G]); E++ } if (E < 2) { H.push(F) } D = H }; this.get = function () { for (var E = 0; E < D.length; E++) { if (D[E]) { return D[E] } } return false }; this.ack = function () { for (var E = 0; E < D.length; E++) { if (D[E]) { delete D[E]; break } } if (this.empty()) { D = [] } } } function o() { var D = {}; this.add = function (F, G, E) { F = F.toLowerCase(); if (!D[F]) { D[F] = [] } D[F].push({ obj: G, tag: s(E, "tag") }); return F + "-" + (D[F].length - 1) }; this.get = function (G, I, F) { var H, E, J; G = G.toLowerCase(); if (!D[G] || !D[G].length) { return null } E = I ? D[G].length : -1; J = I ? -1 : 1; for (H = 0; H < D[G].length; H++) { E += J; if (D[G][E]) { if (F !== undefined) { if ((D[G][E].tag === undefined) || (c.inArray(D[G][E].tag, F) < 0)) { continue } } return D[G][E].obj } } return null }; this.all = function (G, F) { var H, E = []; G = G.toLowerCase(); if (!D[G] || !D[G].length) { return E } for (H = 0; H < D[G].length; H++) { if (!D[G][H]) { continue } if ((F !== undefined) && ((D[G][H].tag === undefined) || (c.inArray(D[G][H].tag, F) < 0))) { continue } E.push(D[G][H].obj) } return E }; this.names = function () { var F, E = []; for (F in D) { E.push(F) } return E }; this.refToObj = function (E) { E = E.split("-"); if ((E.length == 2) && D[E[0]] && D[E[0]][E[1]]) { return D[E[0]][E[1]].obj } return null }; this.rm = function (H, F, G) { var E, J, I; H = H.toLowerCase(); if (!D[H]) { return false } if (F !== undefined) { if (G) { for (E = D[H].length - 1; E >= 0; E--) { if ((D[H][E] !== undefined) && (D[H][E].tag !== undefined) && (c.inArray(D[H][E].tag, F) >= 0)) { break } } } else { for (E = 0; E < D[H].length; E++) { if ((D[H][E] !== undefined) && (D[H][E].tag !== undefined) && (c.inArray(D[H][E].tag, F) >= 0)) { break } } } } else { E = G ? D[H].length - 1 : 0 } if (!(E in D[H])) { return false } if (typeof (D[H][E].obj.setMap) === "function") { D[H][E].obj.setMap(null) } if (typeof (D[H][E].obj.remove) === "function") { D[H][E].obj.remove() } if (typeof (D[H][E].obj.free) === "function") { D[H][E].obj.free() } delete D[H][E].obj; if (F !== undefined) { I = []; for (J = 0; J < D[H].length; J++) { if (J !== E) { I.push(D[H][J]) } } D[H] = I } else { if (G) { D[H].pop() } else { D[H].shift() } } return true }; this.clear = function (J, I, K, E) { var F, H, G; if (!J || !J.length) { J = []; for (F in D) { J.push(F) } } else { J = g(J) } for (H = 0; H < J.length; H++) { if (J[H]) { G = J[H].toLowerCase(); if (!D[G]) { continue } if (I) { this.rm(G, E, true) } else { if (K) { this.rm(G, E, false) } else { while (this.rm(G, E, false)) { } } } } } } } function z() { var H = [], E = [], F = [], D = [], G = false, I; this.events = function () { for (var J = 0; J < arguments.length; J++) { E.push(arguments[J]) } }; this.startRedraw = function () { if (!G) { G = true; return true } return false }; this.endRedraw = function () { G = false }; this.redraw = function () { var K, J = [], L = this; for (K = 0; K < arguments.length; K++) { J.push(arguments[K]) } if (this.startRedraw) { I.apply(L, J); this.endRedraw() } else { setTimeout(function () { L.redraw.apply(L, J) }, 50) } }; this.setRedraw = function (J) { I = J }; this.store = function (J, K, L) { F.push({ data: J, obj: K, shadow: L }) }; this.free = function () { for (var J = 0; J < E.length; J++) { google.maps.event.removeListener(E[J]) } E = []; this.freeAll() }; this.freeIndex = function (J) { if (typeof (F[J].obj.setMap) === "function") { F[J].obj.setMap(null) } if (typeof (F[J].obj.remove) === "function") { F[J].obj.remove() } if (F[J].shadow) { if (typeof (F[J].shadow.remove) === "function") { F[J].obj.remove() } if (typeof (F[J].shadow.setMap) === "function") { F[J].shadow.setMap(null) } delete F[J].shadow } delete F[J].obj; delete F[J].data; delete F[J] }; this.freeAll = function () { var J; for (J = 0; J < F.length; J++) { if (F[J]) { this.freeIndex(J) } } F = [] }; this.freeDiff = function (M) { var L, K, N = {}, J = []; for (L = 0; L < M.length; L++) { J.push(M[L].idx.join("-")) } for (L = 0; L < F.length; L++) { if (!F[L]) { continue } K = c.inArray(F[L].data.idx.join("-"), J); if (K >= 0) { N[K] = true } else { this.freeIndex(L) } } return N }; this.add = function (K, J) { H.push({ latLng: K, marker: J }) }; this.get = function (J) { return H[J] }; this.clusters = function (ag, L, K) { var M = ag.getProjection(), X = M.fromLatLngToPoint(new google.maps.LatLng(ag.getBounds().getNorthEast().lat(), ag.getBounds().getSouthWest().lng())), ac, aa, J, W, U, T, Y, R, S = ag.getZoom(), O = {}, af = {}, ab = {}, Q = [], ad, ae, N, ah, V, Z, P = ag.getBounds(); Z = 0; V = {}; for (ac = 0; ac < H.length; ac++) { if (!P.contains(H[ac].latLng)) { continue } W = M.fromLatLngToPoint(H[ac].latLng); O[ac] = [Math.floor((W.x - X.x) * Math.pow(2, S)), Math.floor((W.y - X.y) * Math.pow(2, S))]; V[ac] = true; Z++ } if (!K) { for (Y = 0; Y < D.length; Y++) { if (Y in V) { Z-- } else { break } } if (!Z) { return false } } D = V; V = []; for (ac in O) { U = O[ac][0]; T = O[ac][1]; if (!(U in af)) { af[U] = {} } if (!(T in af[U])) { af[U][T] = ac; ab[ac] = {}; V.push(ac) } ab[af[U][T]][ac] = true } L = Math.pow(L, 2); delete (af); Y = 0; while (1) { while ((Y < V.length) && !(V[Y] in ab)) { Y++ } if (Y == V.length) { break } ac = V[Y]; N = O[ac][0]; ah = O[ac][1]; af = null; do { ad = { lat: 0, lng: 0, idx: [] }; for (R = Y; R < V.length; R++) { if (!(V[R] in ab)) { continue } aa = V[R]; if (Math.pow(N - O[aa][0], 2) + Math.pow(ah - O[aa][1], 2) <= L) { for (J in ab[aa]) { ad.lat += H[J].latLng.lat(); ad.lng += H[J].latLng.lng(); ad.idx.push(J) } } } ad.lat /= ad.idx.length; ad.lng /= ad.idx.length; if (!af) { ae = ad.idx.length > 1; af = ad } else { ae = ad.idx.length > af.idx.length; if (ae) { af = ad } } if (ae) { W = M.fromLatLngToPoint(new google.maps.LatLng(af.lat, af.lng)); N = Math.floor((W.x - X.x) * Math.pow(2, S)); ah = Math.floor((W.y - X.y) * Math.pow(2, S)) } } while (ae); for (R = 0; R < af.idx.length; R++) { if (af.idx[R] in ab) { delete (ab[af.idx[R]]) } } Q.push(af) } return Q }; this.getBounds = function () { var J, K = new google.maps.LatLngBounds(); for (J = 0; J < H.length; J++) { K.extend(H[J].latLng) } return K } } var e = { verbose: false, queryLimit: { attempt: 5, delay: 250, random: 250 }, init: { mapTypeId: google.maps.MapTypeId.ROADMAP, center: [46.578498, 2.457275], zoom: 2 }, classes: { Map: google.maps.Map, Marker: google.maps.Marker, InfoWindow: google.maps.InfoWindow, Circle: google.maps.Circle, Rectangle: google.maps.Rectangle, OverlayView: google.maps.OverlayView, StreetViewPanorama: google.maps.StreetViewPanorama, KmlLayer: google.maps.KmlLayer, TrafficLayer: google.maps.TrafficLayer, BicyclingLayer: google.maps.BicyclingLayer, GroundOverlay: google.maps.GroundOverlay, StyledMapType: google.maps.StyledMapType} }, v = ["events", "onces", "options", "apply", "callback", "data", "tag"], i = ["init", "geolatlng", "getlatlng", "getroute", "getelevation", "getdistance", "addstyledmap", "setdefault", "destroy"], p = ["get"], m = directionsService = elevationService = maxZoomService = distanceMatrixService = null; function B(E) { for (var D in E) { if (typeof (e[D]) === "object") { e[D] = c.extend({}, e[D], E[D]) } else { e[D] = E[D] } } } function u(E) { if (!E) { return true } for (var D = 0; D < i.length; D++) { if (i[D] === E) { return false } } return true } function n(D) { var F = s(D, "action"); for (var E = 0; E < p.length; E++) { if (p[E] === F) { return true } } return false } function t(E, F) { if (F.toLowerCase) { F = F.toLowerCase(); for (var D in E) { if (D.toLowerCase && (D.toLowerCase() == F)) { return D } } } return false } function s(E, F, G) { var D = t(E, F); return D ? E[D] : G } function C(E, F) { var G, D; if (!E || !F) { return false } F = g(F); for (G in E) { if (G.toLowerCase) { G = G.toLowerCase(); for (D in F) { if (G == F[D]) { return true } } } } return false } function h(F, E, D) { if (C(F, v) || C(F, E)) { var H, G; for (H = 0; H < v.length; H++) { G = t(F, v[H]); D[v[H]] = G ? F[G] : {} } if (E && E.length) { for (H = 0; H < E.length; H++) { if (G = t(F, E[H])) { D[E[H]] = F[G] } } } return D } else { D.options = {}; for (G in F) { if (G !== "action") { D.options[G] = F[G] } } return D } } function A(H, F, E, G) { var K = t(F, H), I, D = {}, J = ["map"]; D.callback = s(F, "callback"); E = g(E); G = g(G); if (K) { return h(F[K], E, D) } if (G && G.length) { for (I = 0; I < G.length; I++) { J.push(G[I]) } } if (!C(F, J)) { D = h(F, E, D) } for (I = 0; I < v.length; I++) { if (v[I] in D) { continue } D[v[I]] = {} } return D } function l() { if (!m) { m = new google.maps.Geocoder() } return m } function a() { if (!directionsService) { directionsService = new google.maps.DirectionsService() } return directionsService } function r() { if (!elevationService) { elevationService = new google.maps.ElevationService() } return elevationService } function x() { if (!maxZoomService) { maxZoomService = new google.maps.MaxZoomService() } return maxZoomService } function b() { if (!distanceMatrixService) { distanceMatrixService = new google.maps.DistanceMatrixService() } return distanceMatrixService } function d(D) { return (typeof (D) === "number" || typeof (D) === "string") && D !== "" && !isNaN(D) } function g(F) { var E, D = []; if (F !== undefined) { if (typeof (F) === "object") { if (typeof (F.length) === "number") { D = F } else { for (E in F) { D.push(F[E]) } } } else { D.push(F) } } return D } function f(E, G, D) { var F = G ? E : null; if (!E || (typeof (E) === "string")) { return F } if (E.latLng) { return f(E.latLng) } if (typeof (E.lat) === "function") { return E } else { if (d(E.lat)) { return new google.maps.LatLng(E.lat, E.lng) } else { if (!D && E.length) { if (!d(E[0]) || !d(E[1])) { return F } return new google.maps.LatLng(E[0], E[1]) } } } return F } function j(E, F, I) { var H, D, G; if (!E) { return null } G = I ? E : null; if (typeof (E.getCenter) === "function") { return E } if (E.length) { if (E.length == 2) { H = f(E[0]); D = f(E[1]) } else { if (E.length == 4) { H = f([E[0], E[1]]); D = f([E[2], E[3]]) } } } else { if (("ne" in E) && ("sw" in E)) { H = f(E.ne); D = f(E.sw) } else { if (("n" in E) && ("e" in E) && ("s" in E) && ("w" in E)) { H = f([E.n, E.e]); D = f([E.s, E.w]) } } } if (H && D) { return new google.maps.LatLngBounds(D, H) } return G } function w(I) { var D = new q(), F = new o(), H = null, G = {}, E = false; this._plan = function (K) { for (var J = 0; J < K.length; J++) { D.add(K[J]) } this._run() }; this._planNext = function (J) { D.addNext(J) }; this._direct = function (J) { var K = s(J, "action"); return this[K](c.extend({}, K in e ? e[K] : {}, J.args ? J.args : J)) }; this._end = function () { E = false; D.ack(); this._run() }, this._run = function () { if (E) { return } var J = D.get(); if (!J) { return } E = true; this._proceed(J) }; this._proceed = function (J) { J = J || {}; var O = s(J, "action") || "init", N = O.toLowerCase(), M = true, P = s(J, "target"), L = s(J, "args"), K; if (!H && u(N)) { this.init(c.extend({}, e.init, J.args && J.args.map ? J.args.map : J.map ? J.map : {}), true) } if (!P && !L && (N in this) && (typeof (this[N]) === "function")) { this[N](c.extend({}, N in e ? e[N] : {}, J.args ? J.args : J)) } else { if (P && (typeof (P) === "object")) { if (M = (typeof (P[O]) === "function")) { K = P[O].apply(P, J.args ? J.args : []) } } else { if (H) { if (M = (typeof (H[O]) === "function")) { K = H[O].apply(H, J.args ? J.args : []) } } } if (!M && e.verbose) { alert("unknown action : " + O) } this._callback(K, J); this._end() } }; this._resolveLatLng = function (J, P, M, L) { var K = s(J, "address"), O, N = this; if (K) { if (!L) { L = 0 } if (typeof (K) === "object") { O = K } else { O = { address: K} } l().geocode(O, function (R, Q) { if (Q === google.maps.GeocoderStatus.OK) { N[P](J, M ? R : R[0].geometry.location) } else { if ((Q === google.maps.GeocoderStatus.OVER_QUERY_LIMIT) && (L < e.queryLimit.attempt)) { setTimeout(function () { N._resolveLatLng(J, P, M, L + 1) }, e.queryLimit.delay + Math.floor(Math.random() * e.queryLimit.random)) } else { if (e.verbose) { alert("Geocode error : " + Q) } N[P](J, false) } } }) } else { N[P](J, f(J, false, true)) } }, this._call = function () { var K, L = arguments[0], J = []; if (!arguments.length || !H || (typeof (H[L]) !== "function")) { return } for (K = 1; K < arguments.length; K++) { J.push(arguments[K]) } return H[L].apply(H, J) }; this._subcall = function (J, L) { var K = {}; if (!J.map) { return } if (!L) { L = s(J.map, "latlng") } if (!H) { if (L) { K = { center: L} } this.init(c.extend({}, J.map, K), true) } else { if (J.map.center && L) { this._call("setCenter", L) } if (J.map.zoom !== undefined) { this._call("setZoom", J.map.zoom) } if (J.map.mapTypeId !== undefined) { this._call("setMapTypeId", J.map.mapTypeId) } } }; this._attachEvent = function (K, J, N, M, L) { google.maps.event["addListener" + (L ? "Once" : "")](K, J, function (O) { N.apply(I, [K, O, M]) }) }; this._attachEvents = function (L, J) { var K; if (!J) { return } if (J.events) { for (K in J.events) { if (typeof (J.events[K]) === "function") { this._attachEvent(L, K, J.events[K], J.data, false) } } } if (J.onces) { for (K in J.onces) { if (typeof (J.onces[K]) === "function") { this._attachEvent(L, K, J.onces[K], J.data, true) } } } }; this._callback = function (K, J) { if (typeof (J.callback) === "function") { J.callback.apply(I, [K]) } else { if (typeof (J.callback) === "object") { for (var L = 0; L < J.callback.length; L++) { if (typeof (J.callback[L]) === "function") { J.callback[k].apply(I, [K]) } } } } }; this._manageEnd = function (K, J, L) { var N, M; if (K && (typeof (K) === "object")) { this._attachEvents(K, J); if (J.apply && J.apply.length) { for (N = 0; N < J.apply.length; N++) { M = J.apply[N]; if (!M.action || (typeof (K[M.action]) !== "function")) { continue } if (M.args) { K[M.action].apply(K, M.args) } else { K[M.action]() } } } } if (!L) { this._callback(K, J); this._end() } }; this.destroy = function (J) { var K; F.clear(); I.empty(); for (K in G) { delete G[K] } G = {}; if (H) { delete H } this._callback(I, null, J); this._end() }; this.init = function (J, K) { var M, L; if (H) { return this._end() } M = A("map", J); if ((typeof (M.options.center) === "boolean") && M.options.center) { return false } opts = c.extend({}, e.init, M.options); if (!opts.center) { opts.center = [e.init.center.lat, e.init.center.lng] } opts.center = f(opts.center); H = new e.classes.Map(I.get(0), opts); for (L in G) { H.mapTypes.set(L, G[L]) } this._manageEnd(H, M, K); return true }; this.getlatlng = function (J) { this._resolveLatLng(J, "_getLatLng", true) }, this._getLatLng = function (J, K) { this._manageEnd(K, J) }, this.getaddress = function (J) { var L = f(J, false, true), K = s(J, "address"), M = L ? { latLng: L} : (K ? (typeof (K) === "string" ? { address: K} : K) : null), N = s(J, "callback"); if (M && typeof (N) === "function") { l().geocode(M, function (Q, O) { var P = O === google.maps.GeocoderStatus.OK ? Q : false; N.apply(I, [P, O]) }) } this._end() }; this.getroute = function (J) { var K = s(J, "callback"); if ((typeof (K) === "function") && J.options) { J.options.origin = f(J.options.origin, true); J.options.destination = f(J.options.destination, true); a().route(J.options, function (N, L) { var M = L == google.maps.DirectionsStatus.OK ? N : false; K.apply(I, [M, L]) }) } this._end() }; this.getelevation = function (K) { var P, N, O, L, M, J = [], Q = s(K, "callback"), N = s(K, "latlng"); if (typeof (Q) === "function") { P = function (T, R) { var S = R === google.maps.ElevationStatus.OK ? T : false; Q.apply(I, [S, R]) }; if (N) { J.push(f(N)) } else { J = s(K, "locations") || []; if (J) { J = g(J); for (M = 0; M < J.length; M++) { J[M] = f(J[M]) } } } if (J.length) { r().getElevationForLocations({ locations: J }, P) } else { O = s(K, "path"); L = s(K, "samples"); if (O && L) { for (M = 0; M < O.length; M++) { J.push(f(O[M])) } if (J.length) { r().getElevationAlongPath({ path: J, samples: L }, P) } } } } this._end() }; this.getdistance = function (J) { var K, L = s(J, "callback"); if ((typeof (L) === "function") && J.options && J.options.origins && J.options.destinations) { J.options.origins = g(J.options.origins); for (K = 0; K < J.options.origins.length; K++) { J.options.origins[K] = f(J.options.origins[K], true) } J.options.destinations = g(J.options.destinations); for (K = 0; K < J.options.destinations.length; K++) { J.options.destinations[K] = f(J.options.destinations[K], true) } b().getDistanceMatrix(J.options, function (O, M) { var N = M == google.maps.DistanceMatrixStatus.OK ? O : false; L.apply(I, [N, M]) }) } }; this.addmarker = function (J) { this._resolveLatLng(J, "_addMarker") }; this._addMarker = function (K, N, L) { var J, M, P, O = A("marker", K, "to"); if (!L) { if (!N) { this._manageEnd(false, O); return } this._subcall(K, N) } else { if (!N) { return } } if (O.to) { P = F.refToObj(O.to); J = P && (typeof (P.add) === "function"); if (J) { P.add(N, K); if (typeof (P.redraw) === "function") { P.redraw() } } if (!L) { this._manageEnd(J, O) } } else { O.options.position = N; O.options.map = H; J = new e.classes.Marker(O.options); if (C(K, "infowindow")) { M = A("infowindow", K.infowindow, "open"); if ((M.open === undefined) || M.open) { M.apply = g(M.apply); M.apply.unshift({ action: "open", args: [H, J] }) } M.action = "addinfowindow"; this._planNext(M) } if (!L) { F.add("marker", J, O); this._manageEnd(J, O) } } return J }; this.addmarkers = function (J) { if (s(J, "clusters")) { this._addclusteredmarkers(J) } else { this._addmarkers(J) } }; this._addmarkers = function (L) { var S, J, N, K, P, R = {}, O, Q, M = s(L, "markers"); this._subcall(L); if (typeof (M) !== "object") { return this._end() } J = A("marker", L, ["to", "markers"]); if (J.to) { Q = F.refToObj(J.to); S = Q && (typeof (Q.add) === "function"); if (S) { for (N = 0; N < M.length; N++) { if (K = f(M[N])) { Q.add(K, M[N]) } } if (typeof (Q.redraw) === "function") { Q.redraw() } } this._manageEnd(S, J) } else { c.extend(true, R, J.options); R.map = H; S = []; for (N = 0; N < M.length; N++) { if (K = f(M[N])) { if (M[N].options) { O = {}; c.extend(true, O, R, M[N].options); J.options = O } else { J.options = R } J.options.position = K; P = new e.classes.Marker(J.options); S.push(P); J.data = M[N].data; J.tag = M[N].tag; F.add("marker", P, J); this._manageEnd(P, J, true) } } J.options = R; this._callback(S, L); this._end() } }; this._addclusteredmarkers = function (K) { var N, M, J, Q, O = this, P = s(K, "radius"), L = s(K, "markers"), R = s(K, "clusters"); if (!H.getBounds()) { google.maps.event.addListenerOnce(H, "bounds_changed", function () { O._addclusteredmarkers(K) }); return } if (typeof (P) === "number") { N = new z(); for (M = 0; M < L.length; M++) { J = f(L[M]); N.add(J, L[M]) } Q = this._initClusters(K, N, P, R) } this._callback(Q, K); this._end() }; this._initClusters = function (K, L, J, N) { var M = this; L.setRedraw(function (P) { var Q, O = L.clusters(H, J, P); if (O) { Q = L.freeDiff(O); M._displayClusters(K, L, O, Q, N) } }); L.events(google.maps.event.addListener(H, "zoom_changed", function () { L.redraw(true) }), google.maps.event.addListener(H, "bounds_changed", function () { L.redraw() })); L.redraw(); return F.add("cluster", L, K) }; this._displayClusters = function (N, Y, M, X, O) { var W, Z, R, V, T, S, L, aa, J, ac, Q, ab, K, P = C(N, "cluster") ? A("", s(N, "cluster")) : {}, U = C(N, "marker") ? A("", s(N, "marker")) : {}; for (Z = 0; Z < M.length; Z++) { if (Z in X) { continue } aa = M[Z]; T = false; if (aa.idx.length > 1) { V = 0; for (W in O) { if ((W > V) && (W <= aa.idx.length)) { V = W } } if (O[V]) { Q = s(O[V], "width"); ab = s(O[V], "height"); K = {}; c.extend(true, K, P, { options: { pane: "overlayLayer", content: O[V].content.replace("CLUSTER_COUNT", aa.idx.length), offset: { x: -Q / 2, y: -ab / 2}} }); S = this._addOverlay(K, f(aa), true); K.options.pane = "floatShadow"; K.options.content = c("<div></div>"); K.options.content.width(Q); K.options.content.height(ab); L = this._addOverlay(K, f(aa), true); P.data = { latLng: f(aa), markers: [] }; for (R = 0; R < aa.idx.length; R++) { P.data.markers.push(Y.get(aa.idx[R]).marker) } this._attachEvents(L, P); Y.store(aa, S, L); T = true } } if (!T) { J = {}; c.extend(true, J, U.options); for (R = 0; R < aa.idx.length; R++) { V = Y.get(aa.idx[R]); U.latLng = V.latLng; U.data = V.marker.data; U.tag = V.marker.tag; if (V.marker.options) { ac = {}; c.extend(true, ac, J, V.marker.options); U.options = ac } else { U.options = J } S = this._addMarker(U, U.latLng, true); this._attachEvents(S, U); Y.store(aa, S) } U.options = J } } }; this.addinfowindow = function (J) { this._resolveLatLng(J, "_addInfoWindow") }; this._addInfoWindow = function (J, L) { var N, M, K = []; this._subcall(J, L); N = A("infowindow", J, ["open", "anchor"]); if (L) { N.options.position = L } M = new e.classes.InfoWindow(N.options); if ((N.open === undefined) || N.open) { N.apply = g(N.apply); K.push(H); if (N.anchor) { K.push(N.anchor) } N.apply.unshift({ action: "open", args: K }) } F.add("infowindow", M, N); this._manageEnd(M, N) }; this.addpolyline = function (J) { this._addPoly(J, "Polyline", "path") }; this.addpolygon = function (J) { this._addPoly(J, "Polygon", "paths") }; this._addPoly = function (J, M, O) { var K, N, L, P = A(M.toLowerCase(), J, O); if (P[O]) { P.options[O] = []; for (K = 0; K < P[O].length; K++) { if (L = f(P[O][K])) { P.options[O].push(L) } } } N = new google.maps[M](P.options); N.setMap(H); F.add(M.toLowerCase(), N, P); this._manageEnd(N, P) }; this.addcircle = function (J) { this._resolveLatLng(J, "_addCircle") }; this._addCircle = function (J, K) { var M, L = A("circle", J); if (!K) { K = f(L.options.center) } if (!K) { return this._manageEnd(false, L) } this._subcall(J, K); L.options.center = K; L.options.map = H; M = new e.classes.Circle(L.options); F.add("circle", M, L); this._manageEnd(M, L) }; this.addrectangle = function (J) { this._resolveLatLng(J, "_addRectangle") }; this._addRectangle = function (J, L) { var K, M = A("rectangle", J); M.options.bounds = j(M.options.bounds, true); if (!M.options.bounds) { return this._manageEnd(false, M) } this._subcall(J, M.options.bounds.getCenter()); M.options.map = H; K = new e.classes.Rectangle(M.options); F.add("rectangle", K, M); this._manageEnd(K, M) }; this.addoverlay = function (J) { this._resolveLatLng(J, "_addOverlay") }; this._addOverlay = function (N, L, O) { var M, K = A("overlay", N), J = c.extend({ pane: "floatPane", content: "", offset: { x: 0, y: 0} }, K.options), R = c("<div></div>"), Q = []; R.css("border", "none").css("borderWidth", "0px").css("position", "absolute"); R.append(J.content); function P() { e.classes.OverlayView.call(this); this.setMap(H) } P.prototype = new e.classes.OverlayView(); P.prototype.onAdd = function () { var S = this.getPanes(); if (J.pane in S) { c(S[J.pane]).append(R) } }; P.prototype.draw = function () { var S = this.getProjection(), U = S.fromLatLngToDivPixel(L), T = this; R.css("left", (U.x + J.offset.x) + "px").css("top", (U.y + J.offset.y) + "px"); c.each(("dblclick click mouseover mousemove mouseout mouseup mousedown").split(" "), function (W, V) { Q.push(google.maps.event.addDomListener(R[0], V, function (X) { google.maps.event.trigger(T, V) })) }); Q.push(google.maps.event.addDomListener(R[0], "contextmenu", function (V) { google.maps.event.trigger(T, "rightclick") })) }; P.prototype.onRemove = function () { for (var S = 0; S < Q.length; S++) { google.maps.event.removeListener(Q[S]) } R.remove() }; P.prototype.hide = function () { R.hide() }; P.prototype.show = function () { R.show() }; P.prototype.toggle = function () { if (R) { if (R.is(":visible")) { this.show() } else { this.hide() } } }; P.prototype.toggleDOM = function () { if (this.getMap()) { this.setMap(null) } else { this.setMap(H) } }; P.prototype.getDOMElement = function () { return R[0] }; M = new P(); if (!O) { F.add("overlay", M, K); this._manageEnd(M, K) } return M }; this.addfixpanel = function (K) { var N = A("fixpanel", K), J = y = 0, M, L; if (N.options.content) { M = c(N.options.content); if (N.options.left !== undefined) { J = N.options.left } else { if (N.options.right !== undefined) { J = I.width() - M.width() - N.options.right } else { if (N.options.center) { J = (I.width() - M.width()) / 2 } } } if (N.options.top !== undefined) { y = N.options.top } else { if (N.options.bottom !== undefined) { y = I.height() - M.height() - N.options.bottom } else { if (N.options.middle) { y = (I.height() - M.height()) / 2 } } } L = c("<div></div>").css("position", "absolute").css("top", y + "px").css("left", J + "px").css("z-index", "1000").append(M); I.first().prepend(L); this._attachEvents(H, N); F.add("fixpanel", L, N); this._callback(L, N) } this._end() }; this.adddirectionsrenderer = function (J, K) { var L, M = A("directionrenderer", J, "panelId"); F.rm("directionrenderer"); M.options.map = H; L = new google.maps.DirectionsRenderer(M.options); if (M.panelId) { L.setPanel(document.getElementById(M.panelId)) } F.add("directionrenderer", L, M); this._manageEnd(L, M, K); return L }; this.setdirectionspanel = function (J) { var K = F.get("directionrenderer"), L = A("directionpanel", J, "id"); if (K && L.id) { K.setPanel(document.getElementById(L.id)) } this._manageEnd(K, L) }; this.setdirections = function (J) { var K = F.get("directionrenderer"), L = A("directions", J); if (J) { L.options.directions = J.directions ? J.directions : (J.options && J.options.directions ? J.options.directions : null) } if (L.options.directions) { if (!K) { K = this.adddirectionsrenderer(L, true) } else { K.setDirections(L.options.directions) } } this._manageEnd(K, L) }; this.setstreetview = function (J) { var K, L = A("streetview", J, "id"); if (L.options.position) { L.options.position = f(L.options.position) } K = new e.classes.StreetViewPanorama(document.getElementById(L.id), L.options); if (K) { H.setStreetView(K) } this._manageEnd(K, L) }; this.addkmllayer = function (K) { var J, L = A("kmllayer", K, "url"); L.options.map = H; if (typeof (L.url) === "string") { J = new e.classes.KmlLayer(L.url, L.options) } F.add("kmllayer", J, L); this._manageEnd(J, L) }; this.addtrafficlayer = function (J) { var L = A("trafficlayer", J), K = F.get("trafficlayer"); if (!K) { K = new e.classes.TrafficLayer(); K.setMap(H); F.add("trafficlayer", K, L) } this._manageEnd(K, L) }; this.addbicyclinglayer = function (J) { var K = A("bicyclinglayer", J), L = F.get("bicyclinglayer"); if (!L) { L = new e.classes.BicyclingLayer(); L.setMap(H); F.add("bicyclinglayer", L, K) } this._manageEnd(L, K) }; this.addgroundoverlay = function (J) { var K, L = A("groundoverlay", J, ["bounds", "url"]); L.bounds = j(L.bounds); if (L.bounds && (typeof (L.url) === "string")) { K = new e.classes.GroundOverlay(L.url, L.bounds); K.setMap(H); F.add("groundoverlay", K, L) } this._manageEnd(K, L) }; this.geolatlng = function (J) { var K = s(J, "callback"); if (typeof (K) === "function") { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (L) { var M = new google.maps.LatLng(L.coords.latitude, L.coords.longitude); K.apply(I, [M]) }, function () { var L = false; K.apply(I, [L]) }) } else { if (google.gears) { google.gears.factory.create("beta.geolocation").getCurrentPosition(function (L) { var M = new google.maps.LatLng(L.latitude, L.longitude); K.apply(I, [M]) }, function () { out = false; K.apply(I, [out]) }) } else { K.apply(I, [false]) } } } this._end() }; this.addstyledmap = function (J, K) { var L = A("styledmap", J, ["id", "style"]); if (L.style && L.id && !G[L.id]) { G[L.id] = new e.classes.StyledMapType(L.style, L.options); if (H) { H.mapTypes.set(L.id, G[L.id]) } } this._manageEnd(G[L.id], L, K) }; this.setstyledmap = function (J) { var K = A("styledmap", J, ["id", "style"]); if (K.id) { this.addstyledmap(K, true); if (G[K.id]) { H.setMapTypeId(K.id); this._callback(G[K.id], J) } } this._manageEnd(G[K.id], K) }; this.clear = function (K) { var M = g(s(K, "list") || s(K, "name")), L = s(K, "last", false), N = s(K, "first", false), J = s(K, "tag"); if (J !== undefined) { J = g(J) } F.clear(M, L, N, J); this._end() }; this.get = function (K) { var L = s(K, "name") || "map", N = s(K, "first"), M = s(K, "all"), J = s(K, "tag"); L = L.toLowerCase(); if (L === "map") { return H } if (J !== undefined) { J = g(J) } if (N) { return F.get(L, false, J) } else { if (M) { return F.all(L, J) } else { return F.get(L, true, J) } } }; this.getmaxzoom = function (J) { this._resolveLatLng(J, "_getMaxZoom") }; this._getMaxZoom = function (J, K) { var L = s(J, "callback"); if (L && typeof (L) === "function") { x().getMaxZoomAtLatLng(K, function (M) { var N = M.status === google.maps.MaxZoomStatus.OK ? M.zoom : false; L.apply(I, [N, M.status]) }) } this._end() }; this.setdefault = function (J) { B(J); this._end() }; this.autofit = function (K, O) { var R, Q, M, N, L, P = true, J = new google.maps.LatLngBounds(); R = F.names(); for (N = 0; N < R.length; N++) { Q = F.all(R[N]); for (L = 0; L < Q.length; L++) { M = Q[L]; if (M.getPosition) { J.extend(M.getPosition()); P = false } else { if (M.getBounds) { J.extend(M.getBounds().getNorthEast()); J.extend(M.getBounds().getSouthWest()); P = false } else { if (M.getPaths) { M.getPaths().forEach(function (S) { S.forEach(function (T) { J.extend(T); P = false }) }) } else { if (M.getPath) { M.getPath().forEach(function (S) { J.extend(S); P = false }) } else { if (M.getCenter) { J.extend(M.getCenter()); P = false } } } } } } } if (!P) { H.fitBounds(J) } if (!O) { this._manageEnd(P ? false : J, K, O) } } } c.fn.gmap3 = function () { var F, D, H = [], G = true, E = []; for (F = 0; F < arguments.length; F++) { D = arguments[F] || {}; if (typeof (D) === "string") { D = { action: D} } H.push(D) } if (!H.length) { H.push({}) } c.each(this, function () { var I = c(this), J = I.data("gmap3"); G = false; if (!J) { J = new w(I); I.data("gmap3", J) } if ((H.length == 1) && (n(H[0]))) { E.push(J._direct(H[0])) } else { J._plan(H) } }); if (E.length) { if (E.length === 1) { return E[0] } else { return E } } if (G && (arguments.length == 2) && (typeof (arguments[0]) === "string") && (arguments[0].toLowerCase() === "setdefault")) { B(arguments[1]) } return this } } (jQuery));

/*
 * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
 *
 * Uses the built In easIng capabilities added In jQuery 1.1
 * to offer multiple easIng options
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

// t: current time, b: begInnIng value, c: change In value, d: duration

jQuery.extend( jQuery.easing,
{
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*!
* jQuery corner plugin: simple corner rounding
* Examples and documentation at: http://jquery.malsup.com/corner/
* version 2.12 (23-MAY-2011)
* Requires jQuery v1.3.2 or later
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Authors: Dave Methvin and Mike Alsup
*/

/**
*  corner() takes a single string argument:  jQuery('#myDiv').corner("effect corners width")
*
*  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). 
*  corners: one or more of: top, bottom, tr, tl, br, or bl.  (default is all corners)
*  width:   width of the effect; in the case of rounded corners this is the radius. 
*           specify this value using the px suffix such as 10px (yes, it must be pixels).
*/
; (function (jQuery) {

    var style = document.createElement('div').style,
    moz = style['MozBorderRadius'] !== undefined,
    webkit = style['WebkitBorderRadius'] !== undefined,
    radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined,
    mode = document.documentMode || 0,
    noBottomFold = jQuery.browser.msie && ((jQuery.browser.version < 8 && !mode) || mode < 8),

    expr = jQuery.browser.msie && (function () {
        var div = document.createElement('div');
        try { div.style.setExpression('width', '0+0'); div.style.removeExpression('width'); }
        catch (e) { return false; }
        return true;
    })();

    jQuery.support = jQuery.support || {};
    jQuery.support.borderRadius = moz || webkit || radius; // so you can do:  if (!jQuery.support.borderRadius) jQuery('#myDiv').corner();

    function sz(el, p) {
        return parseInt(jQuery.css(el, p)) || 0;
    };
    function hex2(s) {
        s = parseInt(s).toString(16);
        return (s.length < 2) ? '0' + s : s;
    };
    function gpc(node) {
        while (node) {
            var v = jQuery.css(node, 'backgroundColor'), rgb;
            if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') {
                if (v.indexOf('rgb') >= 0) {
                    rgb = v.match(/\d+/g);
                    return '#' + hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
                }
                return v;
            }
            if (node.nodeName.toLowerCase() == 'html')
                break;
            node = node.parentNode; // keep walking if transparent
        }
        return '#ffffff';
    };

    function getWidth(fx, i, width) {
        switch (fx) {
            case 'round': return Math.round(width * (1 - Math.cos(Math.asin(i / width))));
            case 'cool': return Math.round(width * (1 + Math.cos(Math.asin(i / width))));
            case 'sharp': return width - i;
            case 'bite': return Math.round(width * (Math.cos(Math.asin((width - i - 1) / width))));
            case 'slide': return Math.round(width * (Math.atan2(i, width / i)));
            case 'jut': return Math.round(width * (Math.atan2(width, (width - i - 1))));
            case 'curl': return Math.round(width * (Math.atan(i)));
            case 'tear': return Math.round(width * (Math.cos(i)));
            case 'wicked': return Math.round(width * (Math.tan(i)));
            case 'long': return Math.round(width * (Math.sqrt(i)));
            case 'sculpt': return Math.round(width * (Math.log((width - i - 1), width)));
            case 'dogfold':
            case 'dog': return (i & 1) ? (i + 1) : width;
            case 'dog2': return (i & 2) ? (i + 1) : width;
            case 'dog3': return (i & 3) ? (i + 1) : width;
            case 'fray': return (i % 2) * width;
            case 'notch': return width;
            case 'bevelfold':
            case 'bevel': return i + 1;
            case 'steep': return i / 2 + 1;
            case 'invsteep': return (width - i) / 2 + 1;
        }
    };

    jQuery.fn.corner = function (options) {
        // in 1.3+ we can fix mistakes with the ready state
        if (this.length == 0) {
            if (!jQuery.isReady && this.selector) {
                var s = this.selector, c = this.context;
                jQuery(function () {
                    jQuery(s, c).corner(options);
                });
            }
            return this;
        }

        return this.each(function (index) {
            var jQuerythis = jQuery(this),
            // meta values override options
            o = [jQuerythis.attr(jQuery.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(),
            keep = /keep/.test(o),                       // keep borders?
            cc = ((o.match(/cc:(#[0-9a-f]+)/) || [])[1]),  // corner color
            sc = ((o.match(/sc:(#[0-9a-f]+)/) || [])[1]),  // strip color
            width = parseInt((o.match(/(\d+)px/) || [])[1]) || 10, // corner width
            re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog|invsteep|steep/,
            fx = ((o.match(re) || ['round'])[0]),
            fold = /dogfold|bevelfold/.test(o),
            edges = { T: 0, B: 1 },
            opts = {
                TL: /top|tl|left/.test(o), TR: /top|tr|right/.test(o),
                BL: /bottom|bl|left/.test(o), BR: /bottom|br|right/.test(o)
            },
            // vars used in func later
            strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, jQueryhorz;

            if (!opts.TL && !opts.TR && !opts.BL && !opts.BR)
                opts = { TL: 1, TR: 1, BL: 1, BR: 1 };

            // support native rounding
            if (jQuery.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) {
                if (opts.TL)
                    jQuerythis.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px');
                if (opts.TR)
                    jQuerythis.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px');
                if (opts.BL)
                    jQuerythis.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px');
                if (opts.BR)
                    jQuerythis.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px');
                return;
            }

            strip = document.createElement('div');
            jQuery(strip).css({
                overflow: 'hidden',
                height: '1px',
                minHeight: '1px',
                fontSize: '1px',
                backgroundColor: sc || 'transparent',
                borderStyle: 'solid'
            });

            pad = {
                T: parseInt(jQuery.css(this, 'paddingTop')) || 0, R: parseInt(jQuery.css(this, 'paddingRight')) || 0,
                B: parseInt(jQuery.css(this, 'paddingBottom')) || 0, L: parseInt(jQuery.css(this, 'paddingLeft')) || 0
            };

            if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE
            if (!keep) this.style.border = 'none';
            strip.style.borderColor = cc || gpc(this.parentNode);
            cssHeight = jQuery(this).outerHeight();

            for (j in edges) {
                bot = edges[j];
                // only add stips if needed
                if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
                    strip.style.borderStyle = 'none ' + (opts[j + 'R'] ? 'solid' : 'none') + ' none ' + (opts[j + 'L'] ? 'solid' : 'none');
                    d = document.createElement('div');
                    jQuery(d).addClass('jquery-corner');
                    ds = d.style;

                    bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);
                    
                    if (bot && cssHeight != 'auto') {
                        if (jQuery.css(this, 'position') == 'static')
                            this.style.position = 'relative';
                        ds.position = 'absolute';
                        ds.bottom = ds.left = ds.padding = ds.margin = '0';
                        if (expr)
                            ds.setExpression('width', 'this.parentNode.offsetWidth');
                        else
                            ds.width = '100%';
                    }
                    else if (!bot && jQuery.browser.msie) {
                        if (jQuery.css(this, 'position') == 'static')
                            this.style.position = 'relative';
                        ds.position = 'absolute';
                        ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';

                        // fix ie6 problem when blocked element has a border width
                        if (expr) {
                            bw = sz(this, 'borderLeftWidth') + sz(this, 'borderRightWidth');
                            ds.setExpression('width', 'this.parentNode.offsetWidth - ' + bw + '+ "px"');
                        }
                        else
                            ds.width = '100%';
                    }
                    else {
                        ds.position = 'relative';
                        ds.margin = !bot ? '-' + pad.T + 'px -' + pad.R + 'px ' + (pad.T - width) + 'px -' + pad.L + 'px' :
                                        (pad.B - width) + 'px -' + pad.R + 'px -' + pad.B + 'px -' + pad.L + 'px';
                    }

                    for (i = 0; i < width; i++) {
                        w = Math.max(0, getWidth(fx, i, width));
                        e = strip.cloneNode(false);
                        e.style.borderWidth = '0 ' + (opts[j + 'R'] ? w : 0) + 'px 0 ' + (opts[j + 'L'] ? w : 0) + 'px';
                        bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
                    }

                    if (fold && jQuery.support.boxModel) {
                        if (bot && noBottomFold) continue;
                        for (c in opts) {
                            if (!opts[c]) continue;
                            if (bot && (c == 'TL' || c == 'TR')) continue;
                            if (!bot && (c == 'BL' || c == 'BR')) continue;

                            common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor };
                            jQueryhorz = jQuery('<div/>').css(common).css({ width: width + 'px', height: '1px' });
                            switch (c) {
                                case 'TL': jQueryhorz.css({ bottom: 0, left: 0 }); break;
                                case 'TR': jQueryhorz.css({ bottom: 0, right: 0 }); break;
                                case 'BL': jQueryhorz.css({ top: 0, left: 0 }); break;
                                case 'BR': jQueryhorz.css({ top: 0, right: 0 }); break;
                            }
                            d.appendChild(jQueryhorz[0]);

                            var jQueryvert = jQuery('<div/>').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' });
                            switch (c) {
                                case 'TL': jQueryvert.css({ left: width }); break;
                                case 'TR': jQueryvert.css({ right: width }); break;
                                case 'BL': jQueryvert.css({ left: width }); break;
                                case 'BR': jQueryvert.css({ right: width }); break;
                            }
                            d.appendChild(jQueryvert[0]);
                        }
                    }
                }
            }
        });
    };

    jQuery.fn.uncorner = function () {
        if (radius || moz || webkit)
            this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0);
        jQuery('div.jquery-corner', this).remove();
        return this;
    };

    // expose options
    jQuery.fn.corner.defaults = {
        useNative: true, // true if plugin should attempt to use native browser support for border radius rounding
        metaAttr: 'data-corner' // name of meta attribute to use for options
    };

})(jQuery);

