/*
 * deCarta JavaScript Mapping API
 * Copyright 2006-2009 deCarta. All rights reserved.
 * version DDS 4.4.1sp05
 *
 * Bundles:
 *   ExplorerCanvas
 *   Project: http://excanvas.sourceforge.net/
 *   License: Apache 2.0
 *   License Location: http://excanvas.sourceforge.net/COPYING
 *
 *   Sarissa
 *   Project: http://dev.abiss.gr/sarissa/
 *   License: Apache 2.0
 *   License Location: http://dev.abiss.gr/sarissa/licenses/asl.txt
 */
if (!document.createElement("canvas").getContext) { (function () { var w = Math; var y = w.round; var t = w.sin; var G = w.cos; var o = w.abs; var F = w.sqrt; var a = 10; var p = a / 2; function k() { return this.context_ || (this.context_ = new r(this)) } var v = Array.prototype.slice; function H(j, m, I) { var i = v.call(arguments, 2); return function () { return j.apply(m, i.concat(v.call(arguments))) } } var l = { init: function (i) { if (/MSIE/.test(navigator.userAgent) && !window.opera) { var j = i || document; j.createElement("canvas"); j.attachEvent("onreadystatechange", H(this.init_, this, j)) } }, init_: function (J) { if (!J.namespaces.g_vml_) { J.namespaces.add("g_vml_", "urn:schemas-microsoft-com:vml", "#default#VML") } if (!J.namespaces.g_o_) { J.namespaces.add("g_o_", "urn:schemas-microsoft-com:office:office", "#default#VML") } if (!J.styleSheets.ex_canvas_) { var I = J.createStyleSheet(); I.owningElement.id = "ex_canvas_"; I.cssText = "canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}" } var m = J.getElementsByTagName("canvas"); for (var j = 0; j < m.length; j++) { this.initElement(m[j]) } }, initElement: function (j) { if (!j.getContext) { j.getContext = k; j.innerHTML = ""; j.attachEvent("onpropertychange", E); j.attachEvent("onresize", b); var i = j.attributes; if (i.width && i.width.specified) { j.style.width = i.width.nodeValue + "px" } else { j.width = j.clientWidth } if (i.height && i.height.specified) { j.style.height = i.height.nodeValue + "px" } else { j.height = j.clientHeight } } return j } }; function E(j) { var i = j.srcElement; switch (j.propertyName) { case "width": i.style.width = i.attributes.width.nodeValue + "px"; i.getContext().clearRect(); break; case "height": i.style.height = i.attributes.height.nodeValue + "px"; i.getContext().clearRect(); break } } function b(j) { var i = j.srcElement; if (i.firstChild) { i.firstChild.style.width = i.clientWidth + "px"; i.firstChild.style.height = i.clientHeight + "px" } } l.init(); var f = []; for (var B = 0; B < 16; B++) { for (var A = 0; A < 16; A++) { f[B * 16 + A] = B.toString(16) + A.toString(16) } } function s() { return [[1, 0, 0], [0, 1, 0], [0, 0, 1]] } function d(I, m) { var j = s(); for (var i = 0; i < 3; i++) { for (var L = 0; L < 3; L++) { var J = 0; for (var K = 0; K < 3; K++) { J += I[i][K] * m[K][L] } j[i][L] = J } } return j } function z(j, i) { i.fillStyle = j.fillStyle; i.lineCap = j.lineCap; i.lineJoin = j.lineJoin; i.lineWidth = j.lineWidth; i.miterLimit = j.miterLimit; i.shadowBlur = j.shadowBlur; i.shadowColor = j.shadowColor; i.shadowOffsetX = j.shadowOffsetX; i.shadowOffsetY = j.shadowOffsetY; i.strokeStyle = j.strokeStyle; i.globalAlpha = j.globalAlpha; i.arcScaleX_ = j.arcScaleX_; i.arcScaleY_ = j.arcScaleY_; i.lineScale_ = j.lineScale_ } function c(m) { var K, J = 1; m = String(m); if (m.substring(0, 3) == "rgb") { var M = m.indexOf("(", 3); var j = m.indexOf(")", M + 1); var L = m.substring(M + 1, j).split(","); K = "#"; for (var I = 0; I < 3; I++) { K += f[Number(L[I])] } if (L.length == 4 && m.substr(3, 1) == "a") { J = L[3] } } else { K = m } return { color: K, alpha: J} } function u(i) { switch (i) { case "butt": return "flat"; case "round": return "round"; case "square": default: return "square" } } function r(j) { this.m_ = s(); this.mStack_ = []; this.aStack_ = []; this.currentPath_ = []; this.strokeStyle = "#000"; this.fillStyle = "#000"; this.lineWidth = 1; this.lineJoin = "miter"; this.lineCap = "butt"; this.miterLimit = a * 1; this.globalAlpha = 1; this.canvas = j; var i = j.ownerDocument.createElement("div"); i.style.width = j.clientWidth + "px"; i.style.height = j.clientHeight + "px"; i.style.overflow = "hidden"; i.style.position = "absolute"; j.appendChild(i); this.element_ = i; this.arcScaleX_ = 1; this.arcScaleY_ = 1; this.lineScale_ = 1 } var n = r.prototype; n.clearRect = function () { this.element_.innerHTML = "" }; n.beginPath = function () { this.currentPath_ = [] }; n.moveTo = function (j, i) { var m = this.getCoords_(j, i); this.currentPath_.push({ type: "moveTo", x: m.x, y: m.y }); this.currentX_ = m.x; this.currentY_ = m.y }; n.lineTo = function (j, i) { var m = this.getCoords_(j, i); this.currentPath_.push({ type: "lineTo", x: m.x, y: m.y }); this.currentX_ = m.x; this.currentY_ = m.y }; n.bezierCurveTo = function (m, j, N, M, L, J) { var i = this.getCoords_(L, J); var K = this.getCoords_(m, j); var I = this.getCoords_(N, M); q(this, K, I, i) }; function q(i, I, m, j) { i.currentPath_.push({ type: "bezierCurveTo", cp1x: I.x, cp1y: I.y, cp2x: m.x, cp2y: m.y, x: j.x, y: j.y }); i.currentX_ = j.x; i.currentY_ = j.y } n.quadraticCurveTo = function (L, m, j, i) { var K = this.getCoords_(L, m); var J = this.getCoords_(j, i); var M = { x: this.currentX_ + 2 / 3 * (K.x - this.currentX_), y: this.currentY_ + 2 / 3 * (K.y - this.currentY_) }; var I = { x: M.x + (J.x - this.currentX_) / 3, y: M.y + (J.y - this.currentY_) / 3 }; q(this, M, I, J) }; n.arc = function (O, M, N, J, j, m) { N *= a; var S = m ? "at" : "wa"; var P = O + G(J) * N - p; var R = M + t(J) * N - p; var i = O + G(j) * N - p; var Q = M + t(j) * N - p; if (P == i && !m) { P += 0.125 } var I = this.getCoords_(O, M); var L = this.getCoords_(P, R); var K = this.getCoords_(i, Q); this.currentPath_.push({ type: S, x: I.x, y: I.y, radius: N, xStart: L.x, yStart: L.y, xEnd: K.x, yEnd: K.y }) }; n.rect = function (m, j, i, I) { this.moveTo(m, j); this.lineTo(m + i, j); this.lineTo(m + i, j + I); this.lineTo(m, j + I); this.closePath() }; n.strokeRect = function (m, j, i, I) { var J = this.currentPath_; this.beginPath(); this.moveTo(m, j); this.lineTo(m + i, j); this.lineTo(m + i, j + I); this.lineTo(m, j + I); this.closePath(); this.stroke(); this.currentPath_ = J }; n.fillRect = function (m, j, i, I) { var J = this.currentPath_; this.beginPath(); this.moveTo(m, j); this.lineTo(m + i, j); this.lineTo(m + i, j + I); this.lineTo(m, j + I); this.closePath(); this.fill(); this.currentPath_ = J }; n.createLinearGradient = function (j, I, i, m) { var J = new C("gradient"); J.x0_ = j; J.y0_ = I; J.x1_ = i; J.y1_ = m; return J }; n.createRadialGradient = function (I, K, m, j, J, i) { var L = new C("gradientradial"); L.x0_ = I; L.y0_ = K; L.r0_ = m; L.x1_ = j; L.y1_ = J; L.r1_ = i; return L }; n.drawImage = function (U, m) { var N, L, P, ac, S, Q, X, ae; var O = U.runtimeStyle.width; var T = U.runtimeStyle.height; U.runtimeStyle.width = "auto"; U.runtimeStyle.height = "auto"; var M = U.width; var aa = U.height; U.runtimeStyle.width = O; U.runtimeStyle.height = T; if (arguments.length == 3) { N = arguments[1]; L = arguments[2]; S = Q = 0; X = P = M; ae = ac = aa } else { if (arguments.length == 5) { N = arguments[1]; L = arguments[2]; P = arguments[3]; ac = arguments[4]; S = Q = 0; X = M; ae = aa } else { if (arguments.length == 9) { S = arguments[1]; Q = arguments[2]; X = arguments[3]; ae = arguments[4]; N = arguments[5]; L = arguments[6]; P = arguments[7]; ac = arguments[8] } else { throw Error("Invalid number of arguments") } } } var ad = this.getCoords_(N, L); var I = X / 2; var j = ae / 2; var ab = []; var i = 10; var K = 10; ab.push(" <g_vml_:group", ' coordsize="', a * i, ",", a * K, '"', ' coordorigin="0,0"', ' style="width:', i, "px;height:", K, "px;position:absolute;"); if (this.m_[0][0] != 1 || this.m_[0][1]) { var J = []; J.push("M11=", this.m_[0][0], ",", "M12=", this.m_[1][0], ",", "M21=", this.m_[0][1], ",", "M22=", this.m_[1][1], ",", "Dx=", y(ad.x / a), ",", "Dy=", y(ad.y / a), ""); var Z = ad; var Y = this.getCoords_(N + P, L); var V = this.getCoords_(N, L + ac); var R = this.getCoords_(N + P, L + ac); Z.x = w.max(Z.x, Y.x, V.x, R.x); Z.y = w.max(Z.y, Y.y, V.y, R.y); ab.push("padding:0 ", y(Z.x / a), "px ", y(Z.y / a), "px 0;filter:progid:DXImageTransform.Microsoft.Matrix(", J.join(""), ", sizingmethod='clip');") } else { ab.push("top:", y(ad.y / a), "px;left:", y(ad.x / a), "px;") } ab.push(' ">', '<g_vml_:image src="', U.src, '"', ' style="width:', a * P, "px;", " height:", a * ac, 'px;"', ' cropleft="', S / M, '"', ' croptop="', Q / aa, '"', ' cropright="', (M - S - X) / M, '"', ' cropbottom="', (aa - Q - ae) / aa, '"', " />", "</g_vml_:group>"); this.element_.insertAdjacentHTML("BeforeEnd", ab.join("")) }; n.stroke = function (ah) { var M = []; var N = false; var at = c(ah ? this.fillStyle : this.strokeStyle); var ad = at.color; var an = at.alpha * this.globalAlpha; var J = 10; var P = 10; M.push("<g_vml_:shape", ' filled="', !!ah, '"', ' style="position:absolute;width:', J, "px;height:", P, 'px;"', ' coordorigin="0 0" coordsize="', a * J, " ", a * P, '"', ' stroked="', !ah, '"', ' path="'); var O = false; var ar = { x: null, y: null }; var Z = { x: null, y: null }; for (var am = 0; am < this.currentPath_.length; am++) { var al = this.currentPath_[am]; var aq; switch (al.type) { case "moveTo": aq = al; M.push(" m ", y(al.x), ",", y(al.y)); break; case "lineTo": M.push(" l ", y(al.x), ",", y(al.y)); break; case "close": M.push(" x "); al = null; break; case "bezierCurveTo": M.push(" c ", y(al.cp1x), ",", y(al.cp1y), ",", y(al.cp2x), ",", y(al.cp2y), ",", y(al.x), ",", y(al.y)); break; case "at": case "wa": M.push(" ", al.type, " ", y(al.x - this.arcScaleX_ * al.radius), ",", y(al.y - this.arcScaleY_ * al.radius), " ", y(al.x + this.arcScaleX_ * al.radius), ",", y(al.y + this.arcScaleY_ * al.radius), " ", y(al.xStart), ",", y(al.yStart), " ", y(al.xEnd), ",", y(al.yEnd)); break } if (al) { if (ar.x == null || al.x < ar.x) { ar.x = al.x } if (Z.x == null || al.x > Z.x) { Z.x = al.x } if (ar.y == null || al.y < ar.y) { ar.y = al.y } if (Z.y == null || al.y > Z.y) { Z.y = al.y } } } M.push(' ">'); if (!ah) { var Y = this.lineScale_ * this.lineWidth; if (Y < 1) { an *= Y } M.push("<g_vml_:stroke", ' opacity="', an, '"', ' joinstyle="', this.lineJoin, '"', ' miterlimit="', this.miterLimit, '"', ' endcap="', u(this.lineCap), '"', ' weight="', Y, 'px"', ' color="', ad, '" />') } else { if (typeof this.fillStyle == "object") { var Q = this.fillStyle; var V = 0; var ak = { x: 0, y: 0 }; var ae = 0; var T = 1; if (Q.type_ == "gradient") { var S = Q.x0_ / this.arcScaleX_; var m = Q.y0_ / this.arcScaleY_; var R = Q.x1_ / this.arcScaleX_; var au = Q.y1_ / this.arcScaleY_; var ap = this.getCoords_(S, m); var ao = this.getCoords_(R, au); var L = ao.x - ap.x; var K = ao.y - ap.y; V = Math.atan2(L, K) * 180 / Math.PI; if (V < 0) { V += 360 } if (V < 0.000001) { V = 0 } } else { var ap = this.getCoords_(Q.x0_, Q.y0_); var j = Z.x - ar.x; var I = Z.y - ar.y; ak = { x: (ap.x - ar.x) / j, y: (ap.y - ar.y) / I }; j /= this.arcScaleX_ * a; I /= this.arcScaleY_ * a; var aj = w.max(j, I); ae = 2 * Q.r0_ / aj; T = 2 * Q.r1_ / aj - ae } var ac = Q.colors_; ac.sort(function (W, i) { return W.offset - i.offset }); var X = ac.length; var ab = ac[0].color; var aa = ac[X - 1].color; var ag = ac[0].alpha * this.globalAlpha; var af = ac[X - 1].alpha * this.globalAlpha; var ai = []; for (var am = 0; am < X; am++) { var U = ac[am]; ai.push(U.offset * T + ae + " " + U.color) } M.push('<g_vml_:fill type="', Q.type_, '"', ' method="none" focus="100%"', ' color="', ab, '"', ' color2="', aa, '"', ' colors="', ai.join(","), '"', ' opacity="', af, '"', ' g_o_:opacity2="', ag, '"', ' angle="', V, '"', ' focusposition="', ak.x, ",", ak.y, '" />') } else { M.push('<g_vml_:fill color="', ad, '" opacity="', an, '" />') } } M.push("</g_vml_:shape>"); this.element_.insertAdjacentHTML("beforeEnd", M.join("")) }; n.fill = function () { this.stroke(true) }; n.closePath = function () { this.currentPath_.push({ type: "close" }) }; n.getCoords_ = function (I, j) { var i = this.m_; return { x: a * (I * i[0][0] + j * i[1][0] + i[2][0]) - p, y: a * (I * i[0][1] + j * i[1][1] + i[2][1]) - p} }; n.save = function () { var i = {}; z(this, i); this.aStack_.push(i); this.mStack_.push(this.m_); this.m_ = d(s(), this.m_) }; n.restore = function () { z(this.aStack_.pop(), this); this.m_ = this.mStack_.pop() }; function h(i) { for (var J = 0; J < 3; J++) { for (var I = 0; I < 2; I++) { if (!isFinite(i[J][I]) || isNaN(i[J][I])) { return false } } } return true } function D(j, i, I) { if (!h(i)) { return } j.m_ = i; if (I) { var J = i[0][0] * i[1][1] - i[0][1] * i[1][0]; j.lineScale_ = F(o(J)) } } n.translate = function (m, j) { var i = [[1, 0, 0], [0, 1, 0], [m, j, 1]]; D(this, d(i, this.m_), false) }; n.rotate = function (j) { var I = G(j); var m = t(j); var i = [[I, m, 0], [-m, I, 0], [0, 0, 1]]; D(this, d(i, this.m_), false) }; n.scale = function (m, j) { this.arcScaleX_ *= m; this.arcScaleY_ *= j; var i = [[m, 0, 0], [0, j, 0], [0, 0, 1]]; D(this, d(i, this.m_), true) }; n.transform = function (J, I, L, K, j, i) { var m = [[J, I, 0], [L, K, 0], [j, i, 1]]; D(this, d(m, this.m_), true) }; n.setTransform = function (K, J, M, L, I, j) { var i = [[K, J, 0], [M, L, 0], [I, j, 1]]; D(this, i, true) }; n.clip = function () { }; n.arcTo = function () { }; n.createPattern = function () { return new g }; function C(i) { this.type_ = i; this.x0_ = 0; this.y0_ = 0; this.r0_ = 0; this.x1_ = 0; this.y1_ = 0; this.r1_ = 0; this.colors_ = [] } C.prototype.addColorStop = function (j, i) { i = c(i); this.colors_.push({ offset: j, color: i.color, alpha: i.alpha }) }; function g() { } G_vmlCanvasManager = l; CanvasRenderingContext2D = r; CanvasGradient = C; CanvasPattern = g })() } function Sarissa() { } Sarissa.VERSION = "${project.version}"; Sarissa.PARSED_OK = "Document contains no parsing errors"; Sarissa.PARSED_EMPTY = "Document is empty"; Sarissa.PARSED_UNKNOWN_ERROR = "Not well-formed or other error"; Sarissa.IS_ENABLED_TRANSFORM_NODE = false; var _sarissa_iNsCounter = 0; var _SARISSA_IEPREFIX4XSLPARAM = ""; var _SARISSA_HAS_DOM_IMPLEMENTATION = document.implementation && true; var _SARISSA_HAS_DOM_CREATE_DOCUMENT = _SARISSA_HAS_DOM_IMPLEMENTATION && document.implementation.createDocument; var _SARISSA_HAS_DOM_FEATURE = _SARISSA_HAS_DOM_IMPLEMENTATION && document.implementation.hasFeature; var _SARISSA_IS_MOZ = _SARISSA_HAS_DOM_CREATE_DOCUMENT && _SARISSA_HAS_DOM_FEATURE; var _SARISSA_IS_SAFARI = navigator.userAgent.toLowerCase().indexOf("safari") != -1 || navigator.userAgent.toLowerCase().indexOf("konqueror") != -1; var _SARISSA_IS_SAFARI_OLD = _SARISSA_IS_SAFARI && parseInt((navigator.userAgent.match(/AppleWebKit\/(\d+)/) || {})[1]) < 420; var _SARISSA_IS_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1; var _SARISSA_IS_OPERA = navigator.userAgent.toLowerCase().indexOf("opera") != -1; if (!window.Node || !Node.ELEMENT_NODE) { Node = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12} } if (_SARISSA_IS_SAFARI_OLD) { HTMLHtmlElement = document.createElement("html").constructor; Node = HTMLElement = {}; HTMLElement.prototype = HTMLHtmlElement.__proto__.__proto__; HTMLDocument = Document = document.constructor; var x = new DOMParser(); XMLDocument = x.constructor; Element = x.parseFromString("<Single />", "text/xml").documentElement.constructor; x = null } if (typeof XMLDocument == "undefined" && typeof Document != "undefined") { XMLDocument = Document } if (_SARISSA_IS_IE) { _SARISSA_IEPREFIX4XSLPARAM = "xsl:"; var _SARISSA_DOM_PROGID = ""; var _SARISSA_XMLHTTP_PROGID = ""; var _SARISSA_DOM_XMLWRITER = ""; Sarissa.pickRecentProgID = function (f) { var d = false, h; for (var b = 0; b < f.length && !d; b++) { try { var a = new ActiveXObject(f[b]); var g = f[b]; d = true } catch (c) { h = c } } if (!d) { throw "Could not retrieve a valid progID of Class: " + f[f.length - 1] + ". (original exception: " + h + ")" } f = null; return g }; _SARISSA_DOM_PROGID = null; _SARISSA_THREADEDDOM_PROGID = null; _SARISSA_XSLTEMPLATE_PROGID = null; _SARISSA_XMLHTTP_PROGID = null; if (!window.XMLHttpRequest) { XMLHttpRequest = function () { if (!_SARISSA_XMLHTTP_PROGID) { _SARISSA_XMLHTTP_PROGID = Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]) } return new ActiveXObject(_SARISSA_XMLHTTP_PROGID) } } Sarissa.getDomDocument = function (d, c) { if (!_SARISSA_DOM_PROGID) { _SARISSA_DOM_PROGID = Sarissa.pickRecentProgID(["Msxml2.DOMDocument.6.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"]) } var a = new ActiveXObject(_SARISSA_DOM_PROGID); if (c) { var b = ""; if (d) { if (c.indexOf(":") > 1) { b = c.substring(0, c.indexOf(":")); c = c.substring(c.indexOf(":") + 1) } else { b = "a" + (_sarissa_iNsCounter++) } } if (d) { a.loadXML("<" + b + ":" + c + " xmlns:" + b + '="' + d + '" />') } else { a.loadXML("<" + c + " />") } } return a }; Sarissa.getParseErrorText = function (a) { var c = Sarissa.PARSED_OK; if (a && a.parseError && a.parseError.errorCode && a.parseError.errorCode != 0) { c = "XML Parsing Error: " + a.parseError.reason + "\nLocation: " + a.parseError.url + "\nLine Number " + a.parseError.line + ", Column " + a.parseError.linepos + ":\n" + a.parseError.srcText + "\n"; for (var b = 0; b < a.parseError.linepos; b++) { c += "-" } c += "^\n" } else { if (a.documentElement == null) { c = Sarissa.PARSED_EMPTY } } return c }; Sarissa.setXpathNamespaces = function (a, b) { a.setProperty("SelectionLanguage", "XPath"); a.setProperty("SelectionNamespaces", b) }; XSLTProcessor = function () { if (!_SARISSA_XSLTEMPLATE_PROGID) { _SARISSA_XSLTEMPLATE_PROGID = Sarissa.pickRecentProgID(["Msxml2.XSLTemplate.6.0", "MSXML2.XSLTemplate.3.0"]) } this.template = new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID); this.processor = null }; XSLTProcessor.prototype.importStylesheet = function (d) { if (!_SARISSA_THREADEDDOM_PROGID) { _SARISSA_THREADEDDOM_PROGID = Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0", "MSXML2.FreeThreadedDOMDocument.3.0"]) } d.setProperty("SelectionLanguage", "XPath"); d.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); var c = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); try { c.resolveExternals = true; c.setProperty("AllowDocumentFunction", true) } catch (b) { } if (d.url && d.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']") != null) { c.async = false; c.load(d.url) } else { c.loadXML(d.xml) } c.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); var a = c.selectSingleNode("//xsl:output"); this.outputMethod = a ? a.getAttribute("method") : "html"; this.template.stylesheet = c; this.processor = this.template.createProcessor(); this.paramsSet = [] }; XSLTProcessor.prototype.transformToDocument = function (c) { if (_SARISSA_THREADEDDOM_PROGID) { this.processor.input = c; var b = new ActiveXObject(_SARISSA_DOM_PROGID); this.processor.output = b; this.processor.transform(); return b } else { if (!_SARISSA_DOM_XMLWRITER) { _SARISSA_DOM_XMLWRITER = Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.6.0", "Msxml2.MXXMLWriter.3.0", "MSXML2.MXXMLWriter", "MSXML.MXXMLWriter", "Microsoft.XMLDOM"]) } this.processor.input = c; var b = new ActiveXObject(_SARISSA_DOM_XMLWRITER); this.processor.output = b; this.processor.transform(); var a = new ActiveXObject(_SARISSA_DOM_PROGID); a.loadXML(b.output + ""); return a } }; XSLTProcessor.prototype.transformToFragment = function (i, d) { this.processor.input = i; this.processor.transform(); var g = this.processor.output; var h = d.createDocumentFragment(); if (this.outputMethod == "text") { h.appendChild(d.createTextNode(g)) } else { if (d.body && d.body.innerHTML) { var b = d.createElement("div"); b.innerHTML = g; while (b.hasChildNodes()) { h.appendChild(b.firstChild) } } else { var a = new ActiveXObject(_SARISSA_DOM_PROGID); if (g.substring(0, 5) == "<?xml") { g = g.substring(g.indexOf("?>") + 2) } var c = "".concat("<my>", g, "</my>"); a.loadXML(c); var b = a.documentElement; while (b.hasChildNodes()) { h.appendChild(b.firstChild) } } } return h }; XSLTProcessor.prototype.setParameter = function (c, a, b) { b = b ? b : ""; if (c) { this.processor.addParameter(a, b, c) } else { this.processor.addParameter(a, b) } c = "" + (c || ""); if (!this.paramsSet[c]) { this.paramsSet[c] = new Array() } this.paramsSet[c][a] = b }; XSLTProcessor.prototype.getParameter = function (b, a) { b = "" + (b || ""); if (this.paramsSet[b] && this.paramsSet[b][a]) { return this.paramsSet[b][a] } else { return null } }; XSLTProcessor.prototype.clearParameters = function () { for (var b in this.paramsSet) { for (var a in this.paramsSet[b]) { if (b != "") { this.processor.addParameter(a, "", b) } else { this.processor.addParameter(a, "") } } } this.paramsSet = new Array() } } else { if (_SARISSA_HAS_DOM_CREATE_DOCUMENT) { Sarissa.__handleLoad__ = function (a) { Sarissa.__setReadyState__(a, 4) }; _sarissa_XMLDocument_onload = function () { Sarissa.__handleLoad__(this) }; Sarissa.__setReadyState__ = function (a, b) { a.readyState = b; a.readystate = b; if (a.onreadystatechange != null && typeof a.onreadystatechange == "function") { a.onreadystatechange() } }; Sarissa.getDomDocument = function (c, b) { var a = document.implementation.createDocument(c ? c : null, b ? b : null, null); if (!a.onreadystatechange) { a.onreadystatechange = null } if (!a.readyState) { a.readyState = 0 } a.addEventListener("load", _sarissa_XMLDocument_onload, false); return a }; if (window.XMLDocument) { } else { if (_SARISSA_HAS_DOM_FEATURE && window.Document && !Document.prototype.load && document.implementation.hasFeature("LS", "3.0")) { Sarissa.getDomDocument = function (c, b) { var a = document.implementation.createDocument(c ? c : null, b ? b : null, null); return a } } else { Sarissa.getDomDocument = function (c, b) { var a = document.implementation.createDocument(c ? c : null, b ? b : null, null); if (a && (c || b) && !a.documentElement) { a.appendChild(a.createElementNS(c, b)) } return a } } } } } if (!window.DOMParser) { if (_SARISSA_IS_SAFARI) { DOMParser = function () { }; DOMParser.prototype.parseFromString = function (b, c) { var a = new XMLHttpRequest(); a.open("GET", "data:text/xml;charset=utf-8," + encodeURIComponent(b), false); a.send(null); return a.responseXML } } else { if (Sarissa.getDomDocument && Sarissa.getDomDocument() && Sarissa.getDomDocument(null, "bar").xml) { DOMParser = function () { }; DOMParser.prototype.parseFromString = function (a, c) { var b = Sarissa.getDomDocument(); b.loadXML(a); return b } } } } if ((typeof (document.importNode) == "undefined") && _SARISSA_IS_IE) { try { document.importNode = function (c, b) { var a; if (c.nodeName == "#text") { return document.createTextElement(c.data) } else { if (c.nodeName == "tbody" || c.nodeName == "tr") { a = document.createElement("table") } else { if (c.nodeName == "td") { a = document.createElement("tr") } else { if (c.nodeName == "option") { a = document.createElement("select") } else { a = document.createElement("div") } } } if (b) { a.innerHTML = c.xml ? c.xml : c.outerHTML } else { a.innerHTML = c.xml ? c.cloneNode(false).xml : c.cloneNode(false).outerHTML } return a.getElementsByTagName("*")[0] } } } catch (e) { } } if (!Sarissa.getParseErrorText) { Sarissa.getParseErrorText = function (a) { var c = Sarissa.PARSED_OK; if (!a.documentElement) { c = Sarissa.PARSED_EMPTY } else { if (a.documentElement.tagName == "parsererror") { c = a.documentElement.firstChild.data; c += "\n" + a.documentElement.firstChild.nextSibling.firstChild.data } else { if (a.getElementsByTagName("parsererror").length > 0) { var b = a.getElementsByTagName("parsererror")[0]; c = Sarissa.getText(b, true) + "\n" } else { if (a.parseError && a.parseError.errorCode != 0) { c = Sarissa.PARSED_UNKNOWN_ERROR } } } } return c } } Sarissa.getText = function (h, b) { var f = ""; var c = h.childNodes; for (var d = 0; d < c.length; d++) { var g = c[d]; var a = g.nodeType; if (a == Node.TEXT_NODE || a == Node.CDATA_SECTION_NODE) { f += g.data } else { if (b == true && (a == Node.ELEMENT_NODE || a == Node.DOCUMENT_NODE || a == Node.DOCUMENT_FRAGMENT_NODE)) { f += Sarissa.getText(g, true) } } } return f }; if (!window.XMLSerializer && Sarissa.getDomDocument && Sarissa.getDomDocument("", "foo", null).xml) { XMLSerializer = function () { }; XMLSerializer.prototype.serializeToString = function (a) { return a.xml } } Sarissa.stripTags = function (a) { return a.replace(/<[^>]+>/g, "") }; Sarissa.clearChildNodes = function (a) { while (a.firstChild) { a.removeChild(a.firstChild) } }; Sarissa.copyChildNodes = function (d, f, g) { if (_SARISSA_IS_SAFARI && f.nodeType == Node.DOCUMENT_NODE) { f = f.documentElement } if ((!d) || (!f)) { throw "Both source and destination nodes must be provided" } if (!g) { Sarissa.clearChildNodes(f) } var b = f.nodeType == Node.DOCUMENT_NODE ? f : f.ownerDocument; var a = d.childNodes; if (typeof (b.importNode) != "undefined") { for (var c = 0; c < a.length; c++) { f.appendChild(b.importNode(a[c], true)) } } else { for (var c = 0; c < a.length; c++) { f.appendChild(a[c].cloneNode(true)) } } }; Sarissa.moveChildNodes = function (d, f, g) { if ((!d) || (!f)) { throw "Both source and destination nodes must be provided" } if (!g) { Sarissa.clearChildNodes(f) } var a = d.childNodes; if (d.ownerDocument == f.ownerDocument) { while (d.firstChild) { f.appendChild(d.firstChild) } } else { var b = f.nodeType == Node.DOCUMENT_NODE ? f : f.ownerDocument; if (typeof (b.importNode) != "undefined") { for (var c = 0; c < a.length; c++) { f.appendChild(b.importNode(a[c], true)) } } else { for (var c = 0; c < a.length; c++) { f.appendChild(a[c].cloneNode(true)) } } Sarissa.clearChildNodes(d) } }; Sarissa.xmlize = function (f, h, d) { d = d ? d : ""; var g = d + "<" + h + ">"; var b = false; if (!(f instanceof Object) || f instanceof Number || f instanceof String || f instanceof Boolean || f instanceof Date) { g += Sarissa.escape("" + f); b = true } else { g += "\n"; var a = f instanceof Array; for (var c in f) { g += Sarissa.xmlize(f[c], (a ? 'array-item key="' + c + '"' : c), d + "   ") } g += d } return (g += (h.indexOf(" ") != -1 ? "</array-item>\n" : "</" + h + ">\n")) }; Sarissa.escape = function (a) { return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;") }; Sarissa.unescape = function (a) { return a.replace(/&apos;/g, "'").replace(/&quot;/g, '"').replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&amp;/g, "&") }; var _XMLSerializer = new XMLSerializer(); Sarissa.serialize = function (a) { return _XMLSerializer.serializeToString(a) }; Sarissa.updateCursor = function (b, a) { if (b && b.style && b.style.cursor != undefined) { b.style.cursor = a } }; Sarissa.updateContentFromURI = function (b, c, g, j, f) { try { Sarissa.updateCursor(c, "wait"); var a = new XMLHttpRequest(); a.open("GET", b); function i() { if (a.readyState == 4) { Sarissa.updateContentFromNode(a.responseXML, c, g, j) } } a.onreadystatechange = i; if (f) { var d = "Sat, 1 Jan 2000 00:00:00 GMT"; a.setRequestHeader("If-Modified-Since", d) } a.send("") } catch (h) { Sarissa.updateCursor(c, "auto"); throw h } }; Sarissa.updateContentFromNode = function (f, h, a, g) { try { Sarissa.updateCursor(h, "wait"); Sarissa.clearChildNodes(h); var b = f.nodeType == Node.DOCUMENT_NODE ? f : f.ownerDocument; if (b.parseError && b.parseError != 0) { var d = document.createElement("pre"); d.appendChild(document.createTextNode(Sarissa.getParseErrorText(b))); h.appendChild(d) } else { if (a) { f = a.transformToDocument(f) } if (h.tagName.toLowerCase() == "textarea" || h.tagName.toLowerCase() == "input") { h.value = new XMLSerializer().serializeToString(f) } else { if (f.nodeType == Node.DOCUMENT_NODE || f.ownerDocument.documentElement == f) { h.innerHTML = new XMLSerializer().serializeToString(f) } else { h.appendChild(h.ownerDocument.importNode(f, true)) } } } if (g) { g(f, h) } } catch (c) { throw c } finally { Sarissa.updateCursor(h, "auto") } }; if (!_SARISSA_IS_IE) { if (_SARISSA_HAS_DOM_CREATE_DOCUMENT) { Sarissa.__handleLoad__ = function (a) { Sarissa.__setReadyState__(a, 4) }; function SarissaParseError() { this.errorCode = 0 } _sarissa_XMLDocument_onload = function () { Sarissa.__handleLoad__(this) }; Sarissa.__setReadyState__ = function (a, b) { a.readyState = b; a.readystate = b; if (a.onreadystatechange != null && typeof a.onreadystatechange == "function") { a.onreadystatechange() } }; Sarissa.getDomDocument = function (c, b) { var a = document.implementation.createDocument(c ? c : null, b ? b : null, null); if (!a.onreadystatechange) { a.onreadystatechange = null } if (!a.readyState) { a.readyState = 0 } if (!a.parseError) { a.parseError = new SarissaParseError() } a.addEventListener("load", _sarissa_XMLDocument_onload, false); return a }; if (window.XMLDocument) { XMLDocument.prototype._sarissa_load = XMLDocument.prototype.load; XMLDocument.prototype.load = function (d) { var a = Sarissa.getDomDocument(); Sarissa.copyChildNodes(this, a); this.parseError.errorCode = 0; Sarissa.__setReadyState__(this, 1); try { if (this.async == false && _SARISSA_SYNC_NON_IMPLEMENTED) { var b = new XMLHttpRequest(); b.open("GET", d, false); b.send(null); Sarissa.__setReadyState__(this, 2); Sarissa.copyChildNodes(b.responseXML, this); Sarissa.__setReadyState__(this, 3) } else { this._sarissa_load(d) } } catch (c) { a.parseError.errorCode = -1 } finally { if (!a.documentElement || a.documentElement.tagName == "parsererror") { a.parseError.errorCode = -1 } if (this.async == false) { Sarissa.__handleLoad__(this) } } return a } } else { if (document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("LS", "3.0")) { Document.prototype.async = true; Document.prototype.onreadystatechange = null; Document.prototype.load = function (g) { var b = Sarissa.getDomDocument(); Sarissa.copyChildNodes(this, b, false); var f = document.implementation.createLSParser(this.async ? document.implementation.MODE_ASYNCHRONOUS : document.implementation.MODE_SYNCHRONOUS, null); if (this.async) { var c = this; f.addEventListener("load", function (h) { c.readyState = 4; Sarissa.copyChildNodes(h.newDocument, c, false); c.onreadystatechange.call() }, false) } try { var a = f.parseURI(g); if (!this.async) { Sarissa.copyChildNodes(a, this, false) } } catch (d) { this.parseError.errorCode = -1 } return b }; Sarissa.getDomDocument = function (c, b) { var a = document.implementation.createDocument(c ? c : null, b ? b : null, null); if (!a.parseError) { a.parseError = { errorCode: 0} } return a } } else { Sarissa.getDomDocument = function (c, b) { var a = document.implementation.createDocument(c ? c : null, b ? b : null, null); if (a && (c || b) && !a.documentElement) { a.appendChild(a.createElementNS(c, b)) } if (!a.load) { a.load = function (h) { var d = document.implementation.createDocument(); Sarissa.copyChildNodes(this, d); this.parseError = { errorCode: 0 }; Sarissa.__setReadyState__(this, 1); if (this.async == false) { var g = new XMLHttpRequest(); g.open("GET", h, false); g.send(null); Sarissa.__setReadyState__(this, 2); Sarissa.copyChildNodes(g.responseXML, a); if (!a.documentElement || a.getElementsByTagName("parsererror").length > 0) { a.parseError.errorCode = -1 } Sarissa.__setReadyState__(this, 3); Sarissa.__setReadyState__(this, 4) } else { var f = new XMLHttpRequest(); f.open("GET", h, true); f.onreadystatechange = function () { if (f.readyState == 4) { Sarissa.copyChildNodes(f.responseXML, a); if (!a.documentElement || a.getElementsByTagName("parsererror").length > 0) { a.parseError.errorCode = -1 } } Sarissa.__setReadyState__(a, f.readyState) }; f.send(null) } return d } } return a } } } } } if (_SARISSA_HAS_DOM_FEATURE && document.implementation.hasFeature("XPath", "3.0")) { function SarissaNodeList(a) { this.length = a } SarissaNodeList.prototype = new Array(0); SarissaNodeList.prototype.constructor = Array; SarissaNodeList.prototype.item = function (a) { return (a < 0 || a >= this.length) ? null : this[a] }; SarissaNodeList.prototype.expr = ""; if (window.XMLDocument && (!XMLDocument.prototype.setProperty)) { XMLDocument.prototype.setProperty = function (a, b) { } } Sarissa.setXpathNamespaces = function (h, c) { h._sarissa_useCustomResolver = true; var a = c.indexOf(" ") > -1 ? c.split(" ") : new Array(c); h._sarissa_xpathNamespaces = new Array(a.length); for (var d = 0; d < a.length; d++) { var g = a[d]; var j = g.indexOf(":"); var k = g.indexOf("="); if (j > 0 && k > j + 1) { var f = g.substring(j + 1, k); var b = g.substring(k + 2, g.length - 1); h._sarissa_xpathNamespaces[f] = b } else { throw "Bad format on namespace declaration(s) given" } } }; XMLDocument.prototype._sarissa_useCustomResolver = false; XMLDocument.prototype._sarissa_xpathNamespaces = new Array(); XMLDocument.prototype.selectNodes = function (c, h, a) { var f = this; var b = this._sarissa_useCustomResolver ? function (l) { var i = f._sarissa_xpathNamespaces[l]; if (i) { return i } else { throw "No namespace URI found for prefix: '" + l + "'" } } : this.createNSResolver(this.documentElement); var k = null; if (!a) { var j = this.evaluate(c, (h ? h : this), b, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); var d = new SarissaNodeList(j.snapshotLength); d.expr = c; for (var g = 0; g < d.length; g++) { d[g] = j.snapshotItem(g) } k = d } else { k = j = this.evaluate(c, (h ? h : this), b, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue } return k }; Element.prototype.selectNodes = function (a) { var b = this.ownerDocument; if (b.selectNodes) { return b.selectNodes(a, this) } else { throw "Method selectNodes is only supported by XML Elements" } }; XMLDocument.prototype.selectSingleNode = function (c, b) { var a = b ? b : null; return this.selectNodes(c, a, true) }; Element.prototype.selectSingleNode = function (a) { var b = this.ownerDocument; if (b.selectSingleNode) { return b.selectSingleNode(a, this) } else { throw "Method selectNodes is only supported by XML Elements" } }; Sarissa.IS_ENABLED_SELECT_NODES = true } if (!Sarissa.IS_ENABLED_TRANSFORM_NODE && window.XSLTProcessor && self.XMLElement) { XMLElement.prototype.transformNodeToObject = function (c, b) { var a = document.implementation.createDocument("", "", null); Sarissa.copyChildNodes(this, a); a.transformNodeToObject(c, b) }; Document.prototype.transformNodeToObject = function (f, b) { var a = null; try { a = new XSLTProcessor(); if (a.reset) { a.importStylesheet(f); var c = a.transformToFragment(this, b); Sarissa.copyChildNodes(c, b) } else { a.transformDocument(this, f, b, null) } } catch (d) { if (f && b) { throw "Failed to transform document. (original exception: " + d + ")" } else { if (!f) { throw "No Stylesheet Document was provided. (original exception: " + d + ")" } else { if (!b) { throw "No Result Document was provided. (original exception: " + d + ")" } else { if (a == null) { throw "Could not instantiate an XSLTProcessor object. (original exception: " + d + ")" } else { throw d } } } } } }; XMLElement.prototype.transformNode = function (b) { var a = document.implementation.createDocument("", "", null); Sarissa.copyChildNodes(this, a); return a.transformNode(b) }; Document.prototype.transformNode = function (f) { var a = document.implementation.createDocument("", "", null); this.transformNodeToObject(f, a); var d = null; try { var b = new XMLSerializer(); d = b.serializeToString(a) } catch (c) { throw "Failed to serialize result document. (original exception: " + c + ")" } return d }; Sarissa.IS_ENABLED_TRANSFORM_NODE = true } Sarissa.setXslParameter = function (m, h, k) { try { var c = m.getElementsByTagName(_SARISSA_IEPREFIX4XSLPARAM + "param"); var b = c.length; var l = false; var a; if (k) { for (var f = 0; f < b && !l; f++) { if (c[f].getAttribute("name") == h) { a = c[f]; while (a.firstChild) { a.removeChild(a.firstChild) } if (!k || k == null) { } else { if (typeof k == "string") { a.setAttribute("select", k); l = true } else { if (k.nodeName) { a.removeAttribute("select"); a.appendChild(k.cloneNode(true)); l = true } else { if (k.item(0) && k.item(0).nodeType) { for (var d = 0; d < k.length; d++) { if (k.item(d).nodeType) { a.appendChild(k.item(d).cloneNode(true)) } } l = true } else { throw "Failed to set xsl:param " + h + " (original exception: " + g + ")" } } } } } } } return l } catch (g) { throw g; return false } }; var deCarta = {}; deCarta.Array = {}; deCarta.Encoding = {}; deCarta.Events = {}; deCarta.IdManager = {}; deCarta.Math = {}; deCarta.String = {}; deCarta.Test = {}; function GLOBALS() { } GLOBALS.HYBRID = "HYBRID"; GLOBALS.STREET = "STREET"; GLOBALS.SATELLITE = "SATELLITE"; GLOBALS.PAN_PIXEL_DISTANCE = 300; GLOBALS.DEFAULT_MAP_TILE_SIZE = 256; GLOBALS.DEFAULT_MAP_WIDTH = "800px"; GLOBALS.DEFAULT_MAP_HEIGHT = "500px"; GLOBALS.API_VERSION = "4.4.1sp05"; GLOBALS.API_BUILD = "$LastChangedRevision: 49731 $"; GLOBALS.API_RELEASECLASS = "RELEASE"; function Credentials() { } Credentials.url = "Proxy.ashx"; Credentials.clientName = "U-S-R"; Credentials.clientPassword = "P-W-D"; Credentials.configuration = "glossy-tile"; Credentials.transparentConfiguration = "transparent-tile"; Credentials.mapType = "STREET"; Credentials.ISOCountryCode = "US"; Credentials.trafficEnabled = false; Credentials.rel = "4.4.1sp05"; Credentials.dgkey = "WGBYxhSS8BmPjHgEvzly5ZQSJS4jyZrbbKgibYva2bI16SfUTpKVpadvax1NuSlt"; Credentials.imgPath = "img/"; Credentials.errorTile = Credentials.imgPath + "tile.png"; Credentials.transparentPNG = Credentials.imgPath + "tile.png"; Credentials.transparentGIF = Credentials.imgPath + "x.gif"; Credentials.infoWindowCloseButton = Credentials.imgPath + "close.png"; Credentials.requestUrlOverride = {}; function Address(f, i, c, b, h, g, d, a) { if (f || f == 0) { this.buildingNumber = f } else { this.buildingNumber = "" } this.street = i || ""; this.countrySubdivision = c || ""; this.countrySecondarySubdivision = b || ""; this.municipality = h || ""; this.postalCode = g || ""; this.municipalitySubdivision = d || ""; this.locale = a || new Locale("en", "US"); this.type = "Structured" } Address.prototype.getBuildingNumber = function () { return this.buildingNumber }; Address.prototype.setBuildingNumber = function (a) { this.buildingNumber = a }; Address.prototype.getStreet = function () { return this.street }; Address.prototype.setStreet = function (a) { this.street = a }; Address.prototype.getCountrySubdivision = function () { return this.countrySubdivision }; Address.prototype.setCountrySubdivision = function (a) { this.countrySubdivision = a }; Address.prototype.getCountrySecondarySubdivision = function () { return this.countrySecondarySubdivision }; Address.prototype.setCountrySecondarySubdivision = function (a) { this.countrySecondarySubdivision = a }; Address.prototype.getMunicipality = function () { return this.municipality }; Address.prototype.setMunicipality = function (a) { this.municipality = a }; Address.prototype.getMunicipalitySubdivision = function () { return this.municipalitySubdivision }; Address.prototype.setMunicipalitySubdivision = function (a) { this.municipalitySubdivision = a }; Address.prototype.getPostalCode = function () { return this.postalCode }; Address.prototype.setPostalCode = function (a) { this.postalCode = a }; Address.prototype.getLocale = function () { return this.locale }; Address.prototype.setLocale = function (a) { this.locale = a }; Address.prototype.toString = function () { var a = ""; if (this.buildingNumber != "") { a += this.buildingNumber + " " } if (this.street != "") { a += this.street + " " } if (this.municipality != "") { a += this.municipality + " " } if (this.countrySubdivision != "") { a += this.countrySubdivision + " " } if (this.postalCode != "") { a += this.postalCode } return a }; deCarta.Array.isArray = function (a) { return Object.prototype.toString.call(a) === "[object Array]" }; function BoundingBox(b, f) { if (!(b && (b.lat || b.lat == 0) && (b.lon || b.lon == 0)) || !(f && (f.lat || f.lat == 0) && (f.lon || f.lon == 0))) { throw new Exception("Error instantiating BoundingBox, invalid parameters: " + b + f) } this.minPosition = new Position(Math.min(b.lat, f.lat), Math.min(b.lon, f.lon)); this.maxPosition = new Position(Math.max(b.lat, f.lat), Math.max(b.lon, f.lon)); this.heightInDegrees = this.maxPosition.lat - this.minPosition.lat; this.widthInDegrees = this.maxPosition.lon - this.minPosition.lon; this.getMaxPosition = function () { return this.maxPosition }; this.setMaxPosition = function (o) { if (!(o && (o.lat || o.lat == 0) && (o.lon || o.lon == 0))) { throw new Exception("setMaxPosition: Error, invalid parameter : " + o) } var n = new Position(this.minPosition.lat, this.minPosition.lon); this.maxPosition.lat = Math.max(n.lat, o.lat); this.maxPosition.lon = Math.max(n.lon, o.lon); this.minPosition.lat = Math.min(n.lat, o.lat); this.minPosition.lon = Math.min(n.lon, o.lon) }; this.getMinPosition = function () { return this.minPosition }; this.setMinPosition = function (n) { if (!(n && (n.lat || n.lat == 0) && (n.lon || n.lon == 0))) { throw new Exception("setMaxPosition: Error, invalid parameter : " + n) } var o = new Position(this.maxPosition.lat, this.maxPosition.lon); this.maxPosition.lat = Math.max(o.lat, n.lat); this.maxPosition.lon = Math.max(o.lon, n.lon); this.minPosition.lat = Math.min(o.lat, n.lat); this.minPosition.lon = Math.min(o.lon, n.lon) }; this.getCenterPosition = function () { var o = parseFloat(this.maxPosition.lat - ((this.maxPosition.lat - this.minPosition.lat) / 2)); var n = parseFloat(this.maxPosition.lon - ((this.maxPosition.lon - this.minPosition.lon) / 2)); return new Position(o, n) }; this.getRadius = function () { if (this.heightInDegrees > this.widthInDegrees) { return (this.heightInDegrees * 111.111) / 2 } else { return (this.widthInDegrees * 111.111) / 2 } }; this.contains = function (n) { if (n.lat > this.minPosition.lat && n.lon > this.minPosition.lon && n.lat < this.maxPosition.lat && n.lon < this.maxPosition.lon) { return true } else { return false } }; this.extendedContains = function (n) { if (n.lat > this.minPosition.lat - this.heightInDegrees && n.lon > this.minPosition.lon - this.widthInDegrees && n.lat < this.maxPosition.lat + this.heightInDegrees && n.lon < this.maxPosition.lon + this.widthInDegrees) { return true } else { return false } }; this.equals = function (n) { if (n && this.minPosition.toString() == n.getMinPosition().toString() && this.maxPosition.toString() == n.getMaxPosition().toString()) { return true } else { return false } }; this.toString = function () { return this.minPosition.toString() + " " + this.maxPosition.toString() } } deCarta.CopyrightMessage = function (a) { this.init(a) }; deCarta.CopyrightMessage.prototype.map = null; deCarta.CopyrightMessage.prototype.type = "CopyrightMessage"; deCarta.CopyrightMessage.prototype.frame = null; deCarta.CopyrightMessage.prototype.cssClass = "decarta-copyright"; deCarta.CopyrightMessage.prototype.message = null; deCarta.CopyrightMessage.prototype.init = function (a) { this.message = a }; deCarta.CopyrightMessage.prototype.build = function () { this.frame = document.createElement("DIV"); this.frame.id = this.cssClass; this.frame.className = this.cssClass; this.frame.innerHTML = this.message; Utilities.setUnselectable(this.frame) }; deCarta.CopyrightMessage.prototype.appendThis = function () { if (!this.frame) { this.build() } return this.frame }; deCarta.CopyrightMessage.prototype.removeThis = function () { this.map = null; return this.frame }; deCarta.CopyrightMessage.prototype.position = function (a) { this.frame.style.top = (a.height - 20) + "px"; this.frame.style.left = "1px" }; function DDSShape() { this.borderColor = "(0.0.0)"; this.borderColorRed = 0; this.borderColorGreen = 0; this.borderColorBlue = 0; this.borderStyle = "SOLID"; this.borderWidth = "2"; this.fillColor = "(0.0.0)"; this.fillColorRed = 0; this.fillColorBlue = 0; this.fillColorGreen = 0; this.id = null; this.opacity = "65"; this.opacityFloat = 0.65; this.strokeOpacity = "65"; this.strokeOpacityFloat = 0.65; this.fillOpacity = "65"; this.fillOpacityFloat = 0.65; this.map = null; this.isVisible = true } DDSShape.prototype.inside = null; DDSShape.prototype.setBorderColor = function (b) { if (!b.match(/\([0-9]+\.[0-9]+\.[0-9]+\)/)) { throw new Exception("Error setting RGB value in DDSShape.setBorderColor. Please use format (255.255.255)"); return } this.borderColor = b; var a = b.replace("(", "").replace(")", "").split("."); this.borderColorRed = parseInt(a[0], 10); this.borderColorGreen = parseInt(a[1], 10); this.borderColorBlue = parseInt(a[2], 10) }; DDSShape.prototype.getBorderColor = function () { return this.borderColor }; DDSShape.prototype.setBorderStyle = function (a) { if (a == "SOLID" || a == "DASH" || a == "DOT" || a == "DASHDOTDOT" || a == "ALTBLACKDASH" || a == "RAIL" || a == "NONE") { this.borderStyle = a } else { throw new Exception("Error setting border style value in DDSShape.setBorderStyle. Please use format SOLID, DASH, DOT, DASHDOTDOT, ALTBLACKDASH, RAIL, NONE"); return } }; DDSShape.prototype.getBorderStyle = function () { return this.borderStyle }; DDSShape.prototype.setBorderWidth = function (a) { this.borderWidth = a }; DDSShape.prototype.getBorderWidth = function () { return this.borderWidth }; DDSShape.prototype.setFillColor = function (b) { if (!b.match(/\([0-9]+\.[0-9]+\.[0-9]+\)/)) { throw new Exception("Error setting RGB value in DDSShape.setColor. Please use format (255.255.255)"); return } this.fillColor = b; var a = b.replace("(", "").replace(")", "").split("."); this.fillColorRed = parseInt(a[0], 10); this.fillColorGreen = parseInt(a[1], 10); this.fillColorBlue = parseInt(a[2], 10) }; DDSShape.prototype.getFillColor = function () { return this.fillColor }; DDSShape.prototype.getId = function () { return this.id }; DDSShape.prototype.setOpacity = function (a) { var b = parseInt(a, 10) / 100; if (isNaN(b)) { throw new Exception("DDSShape.prototype.setOpacity: invalid argument of: " + a) } this.opacity = a; this.opacityFloat = b; this.strokeOpacityFloat = b; this.fillOpacityFloat = b }; DDSShape.prototype.getOpacity = function () { return this.opacity }; DDSShape.prototype.setStrokeOpacity = function (a) { var b = parseInt(a, 10) / 100; if (isNaN(b)) { throw new Exception("DDSShape.prototype.setStrokeOpacity: invalid argument of: " + a) } this.strokeOpacity = a; this.strokeOpacityFloat = b }; DDSShape.prototype.getStrokeOpacity = function () { return this.strokeOpacity }; DDSShape.prototype.setFillOpacity = function (a) { var b = parseInt(a, 10) / 100; if (isNaN(b)) { throw new Exception("DDSShape.prototype.setStrokeOpacity: invalid argument of: " + a) } this.fillOpacity = a; this.fillOpacityFloat = b }; DDSShape.prototype.getFillOpacity = function () { return this.fillOpacity }; DDSShape.prototype.hide = function () { if (this.isVisible == true) { this.isVisible = false; if (this.map) { if (this.map.getShapeRendering() == "client") { this.map.redraw() } else { this.map.reDrawMap() } } } }; DDSShape.prototype.show = function () { if (this.isVisible == false) { this.isVisible = true; if (this.map) { if (this.map.getShapeRendering() == "client") { this.map.redraw() } else { this.map.reDrawMap() } } } }; DDSShape.prototype.equals = function (a) { if (a && this.id == a.id) { return true } else { return false } }; DDSShape.getMercPixels = function (f, l) { if (this.mercPixels[f]) { return (this.mercPixels[f]) } var a = this.positions; if (this.generalize) { a = Utilities.generalize(a, f, 10, l); this.generalized[f] = a } var g = Utilities.radsPerPixelAtZoomLevel(l, f); var k = a.length; var c = []; for (var h = 0; h < k; h++) { var j = (a[h]); var b = Math.round(Utilities.lat2pix(j.lat, g)); var d = Math.round(Utilities.lon2pix(j.lon, g)); c[h] = new PixelPoint(d, b) } this.mercPixels[f] = c; return (this.mercPixels[f]) }; function DDSCircle(b, a) { this.id = Math.floor(Math.random() * 10000000); this.type = "circle"; this.radius = a || new Radius(100, new UOM("M")); this.position = b } DDSCircle.prototype = new DDSShape(); DDSCircle.prototype.constructor = DDSCircle; DDSCircle.prototype.setPosition = function (a) { this.position = a; if (this.map != null && this.map.getShapeRendering() == "client") { this.map.redraw() } }; DDSCircle.prototype.getPosition = function () { return this.position }; DDSCircle.prototype.setRadius = function (a) { this.radius = a; if (this.map != null && this.map.getShapeRendering() == "client") { this.map.redraw() } }; DDSCircle.prototype.getRadius = function () { return this.radius }; DDSCircle.prototype.inside = function (b) { var a = deCarta.Math.greatCircleDist(this.position, b, this.radius.uom); if (a < this.radius.distance) { return true } else { return false } }; function DDSLine(a) { this.id = Math.floor(Math.random() * 10000000); this.type = "line"; this.generalize = true; this.generalized = []; this.mercPixels = []; this.positions = []; this.width = a || 2; this.VR7 = ""; this.clip = false; this.setBorderWidth("0") } DDSLine.prototype = new DDSShape(); DDSLine.prototype.constructor = DDSLine; DDSLine.prototype.setColor = function (a) { try { this.setBorderColor(a); this.setFillColor(a) } catch (b) { throw new Exception("Error setting RGB value in DDSLine.setColor. Please use format (255.255.255)") } }; DDSLine.prototype.setPositions = function (a) { this.positions = a; this.generalized = []; this.mercPixels = []; if (this.map != null && this.map.getShapeRendering() == "client") { this.map.redraw() } }; DDSLine.prototype.getPositions = function () { return this.positions }; DDSLine.prototype.setWidth = function (a) { this.width = a }; DDSLine.prototype.getWidth = function () { return this.width }; DDSLine.prototype.setVR7 = function (a) { this.VR7 = a }; DDSLine.prototype.getVR7 = function () { return this.VR7 }; DDSLine.prototype.setGeneralize = function (a) { this.generalize = a }; DDSLine.prototype.getGeneralize = function () { return this.generalize }; DDSLine.prototype.setClip = function (a) { this.clip = (a) ? true : false }; DDSLine.prototype.getMercPixels = DDSShape.getMercPixels; DDSLine.prototype.getMercPixelsClipped = function (v, r, b) { var E, D; var l = this.getMercPixels(v, r); var f = l.length; if (f < 2) { return l } var s = []; for (E = 0; E < f - 1; E++) { s[E] = []; s[E][0] = l[E]; s[E][1] = l[E + 1] } var C = s.length; var G = Utilities.radsPerPixelAtZoomLevel(r, v); var g = Math.round(Utilities.lat2pix(b.maxPosition.lat, G)); var w = Math.round(Utilities.lat2pix(b.minPosition.lat, G)); var u = Math.round(Utilities.lon2pix(b.maxPosition.lon, G)); var c = Math.round(Utilities.lon2pix(b.minPosition.lon, G)); for (E = 0; E < C; E++) { a(s[E]) } var H = []; var h = 0; var F = "oc"; var n = "oc0"; var k = "oc1"; var z = 1; var m = 2; var q = 4; var t = 8; E = 0; while (E < C) { var d = s[E]; if (!(d[n] | d[k])) { H[h++] = d; E++; continue } else { if (d[n] & d[k]) { E++; continue } else { for (D = 0; D < 2; D++) { var A = d[F + D]; var p, o; if (!A) { continue } if (A & z) { p = d[0].x + (d[1].x - d[0].x) * (g - d[0].y) / (d[1].y - d[0].y); o = g } else { if (A & m) { p = d[0].x + (d[1].x - d[0].x) * (w - d[0].y) / (d[1].y - d[0].y); o = w } } if (A & q) { p = u; o = d[0].y + (d[1].y - d[0].y) * (u - d[0].x) / (d[1].x - d[0].x) } else { if (A & t) { p = c; o = d[0].y + (d[1].y - d[0].y) * (c - d[0].x) / (d[1].x - d[0].x) } } if (isNaN(p) || !isFinite(p) || isNaN(o) || !isFinite(o)) { E++; break } var B = new PixelPoint(p, o); d[D] = B } a(d) } } } return H; function a(i) { var M = "oc"; var K = 1; var L = 2; var J = 4; var y = 8; for (var j = 0; j < 2; j++) { var I = i[j]; i[M + j] = 0; if (I.x > u) { i[M + j] += J } else { if (I.x < c) { i[M + j] += y } } if (I.y > g) { i[M + j] = K } else { if (I.y < w) { i[M + j] = L } } } } }; function DDSPolygon() { this.id = Math.floor(Math.random() * 10000000); this.type = "polygon"; this.generalize = true; this.generalized = []; this.mercPixels = []; this.positions = []; this.VR7 = "" } DDSPolygon.prototype = new DDSShape(); DDSPolygon.prototype.constructor = DDSPolygon; DDSPolygon.prototype.setPositions = function (a) { this.positions = a; if (!this.positions[this.positions.length - 1].equals(this.positions[0])) { this.positions.push(this.positions[0].clone()) } this.generalized = []; this.mercPixels = []; if (this.map != null && this.map.getShapeRendering() == "client") { this.map.redraw() } }; DDSPolygon.prototype.getPositions = function () { return this.positions }; DDSPolygon.prototype.setVR7 = function (a) { this.VR7 = a; if (this.map != null) { this.map.redraw() } }; DDSPolygon.prototype.getVR7 = function () { return this.VR7 }; DDSPolygon.prototype.setGeneralize = function (a) { this.generalize = a }; DDSPolygon.prototype.getGeneralize = function () { return this.generalize }; DDSPolygon.prototype.inside = function (a) { return deCarta.Math.pointInPolygon(this.positions, a) }; DDSPolygon.prototype.getMercPixels = DDSShape.getMercPixels; deCarta.DOMDimensions = function (a) { this.init(a) }; deCarta.DOMDimensions.prototype.left = null; deCarta.DOMDimensions.prototype.top = null; deCarta.DOMDimensions.prototype.right = null; deCarta.DOMDimensions.prototype.bottom = null; deCarta.DOMDimensions.prototype.width = null; deCarta.DOMDimensions.prototype.height = null; deCarta.DOMDimensions.prototype.init = function (a) { try { if (!a || (a && !a.style)) { throw new Exception("passed in element not valid") } this.width = parseInt(a.clientWidth, 10); this.height = parseInt(a.clientHeight, 10); this.left = parseInt(Utilities.getAbsoluteLeft(a), 10); this.top = parseInt(Utilities.getAbsoluteTop(a), 10); this.right = this.left + this.width; this.bottom = this.top + this.height; if (isNaN(this.width) || isNaN(this.height) || isNaN(this.left) || isNaN(this.top) || isNaN(this.right) || isNaN(this.bottom)) { throw new Exception("element does not have calculable dimensions") } } catch (b) { throw new Exception("DOMDimensions: Argument not applicable: " + b.message) } }; function EventRegistry() { } EventRegistry.addListener = function (c, a, b) { if (c.type == "map" && (a == "rightclick" || a == "dblclick" || a == "click" || a == "mousedown" || a == "mouseout" || a == "mouseup" || a == "move" || a == "movestart" || a == "moveend" || a == "zoomend")) { c.addEventListener(a, b) } else { if (c.type == "pin" && (a == "rightclick" || a == "dblclick" || a == "click" || a == "mousedown" || a == "mouseover" || a == "mouseout" || a == "mouseup")) { c.addEventListener(a, b) } else { throw new Exception(a + " is unsupported event type for " + c.type) } } }; EventRegistry.clearListeners = function (b, a) { b.clearListeners(a) }; EventRegistry.clearInstanceListeners = function (a) { a.clearInstanceListeners() }; deCarta.Events.addEvent = function (d, c, b) { var a = deCarta.Events.eventKey; if (!deCarta.IdManager.checkTag(d, a)) { deCarta.IdManager.setTag(d, a, deCarta.IdManager.getUniqueId()) } if (d.attachEvent) { if (d["e" + c + b]) { return } d["e" + c + b] = b; d[c + b] = function () { d["e" + c + b](window.event) }; d.attachEvent("on" + c, d[c + b]) } else { if (d.addEventListener) { d.addEventListener(c, b, false) } else { d["on" + c] = b } } }; deCarta.Events.removeEvent = function (c, b, a) { if (c.detachEvent) { if (c[b + a]) { c.detachEvent("on" + b, c[b + a]); c["e" + b + a] = null; c[b + a] = null } } else { if (c.removeEventListener) { c.removeEventListener(b, a, false) } else { c["on" + b] = undefined } } }; deCarta.Events.checkIfTarget = function (c, b) { var a = deCarta.Events.eventKey; if (c && c[a]) { if (b && (b.target || b.srcElement)) { var d = b.target || b.srcElement; if (d[a] == c[a]) { return true } } } return false }; deCarta.Events.eventKey = "deCartaEventId"; (function () { if (Error) { Exception = Error } else { Exception = function (c) { this.message = c || "an exception has occurred"; var b = this; this.toString = function () { return b.message } } } })(); function FreeFormAddress(b, a) { if (!b || b.toString() == "") { throw new Exception("Error instantiating FreeFormAddress, invalid parameters."); return false } this.locale = a || new Locale("en", "US"); this.address = b; this.type = "FreeForm" } FreeFormAddress.prototype.getLocale = function () { return this.locale }; FreeFormAddress.prototype.toString = function () { return this.address }; function GeocodedAddress() { this.position = null; this.freeFormAddress = null; this.structuredAddress = null; this.boundingBox = null; this.matchType = "" } GeocodedAddress.prototype.toString = function () { return this.position + "\n" + this.freeFormAddress + "\n" + this.boundingBox + "\n" + this.matchType }; function Geocoder() { this.xmlRecFac = new XMLRequestFactory(); this.xmlRecFac.mapType = "STREET"; this.returnFreeForm = true; var f = []; var b = this; this.authenticate = function (k, j) { if (!k || !j || k == "" || j == "") { throw new Exception("Error authenticating Geocoder, invalid parameters."); return false } Credentials.clientName = k; Credentials.clientPassword = j; this.xmlRecFac.clientName = k; this.xmlRecFac.clientPassword = j }; this.setConfiguration = function (j) { if (!j) { throw new Exception("error calling Geocoder.setConfiguration()") } Credentials.configuration = j; this.xmlRecFac.configuration = j }; this.geocode = function (j, m) { var l = Utilities.getRequestId(); if (typeof m == "function") { f[l] = m } else { throw new Exception("Geocode.geocode: callBack must be a function, arg was: " + m) } var k = this.xmlRecFac.createGeocodeRequestDOM(j, l, this.returnFreeForm); JSRequest.send(k, b.geocodeCallback) }; this.reverseGeocode = function (j, m) { var l = Utilities.getRequestId(); if (typeof m == "function") { f[l] = m } else { throw new Exception("Geocode.reverseGeocode: callBack must be a function, arg was: " + m) } var k = this.xmlRecFac.createReverseGeocodeRequestDOM(j, l); JSRequest.send(k, b.reverseGeocodeCallback) }; this.reverseGeocodeCallback = function (l) { var r = Sarissa.getDomDocument(); r = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(l), "text/xml"); if (document.all) { r.setProperty("SelectionLanguage", "XPath"); r.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'") } var n; if (r.selectNodes("//xls:Error").length > 0) { n = Sarissa.getText(r.selectSingleNode("//xls:Response/@requestID")); if (n != -1) { f[n](new Address("", "", "", "", "", "", "")) } else { throw new Exception("Error looking up reverse geocode callback, server did not provide necessary information."); return false } return } else { var m, q, p, s, t, j, k; try { m = Sarissa.getText(r.selectSingleNode("//xls:Building/@number")) } catch (o) { m = "" } try { q = Sarissa.getText(r.selectSingleNode("//xls:Street")) } catch (o) { q = "" } try { p = Sarissa.getText(r.selectSingleNode("//xls:Place[@type='CountrySubdivision']")) } catch (o) { p = "" } try { s = Sarissa.getText(r.selectSingleNode("//xls:Place[@type='CountrySecondarySubdivision']")) } catch (o) { s = "" } try { t = Sarissa.getText(r.selectSingleNode("//xls:Place[@type='Municipality']")) } catch (o) { t = "" } try { j = Sarissa.getText(r.selectSingleNode("//xls:Place[@type='MunicipalitySubdivision']")) } catch (o) { j = "" } try { k = Sarissa.getText(r.selectSingleNode("//xls:PostalCode")) } catch (o) { k = "" } n = Sarissa.getText(r.selectSingleNode("//xls:Response/@requestID")); f[n](new Address(m, q, p, s, t, k, j)) } }; this.geocodeCallback = function (F) { var v = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(F), "text/xml"); if (document.all) { v.setProperty("SelectionLanguage", "XPath"); v.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'") } var s = []; var k = []; var E = []; var w; var r = v.selectNodes("//xls:Error"); if (r.length > 0) { w = Sarissa.getText(v.selectSingleNode("//xls:Response/@requestID")); if (typeof f[w] == "function") { f[w](null); f[w] = undefined } } else { var u; try { u = v.selectNodes("//xls:GeocodedAddress") } catch (D) { w = Sarissa.getText(v.selectSingleNode("//xls:Response/@requestID")); f[w](s, k, E); f[w] = undefined; return } for (var A = 0; A < u.length; A++) { var t = new GeocodedAddress(); var B = (Sarissa.serialize((u[A]))); var p; if (B.indexOf("<gml:pos/>") > 0) { p = "0.0 0.0" } else { p = B.substring(B.indexOf("<gml:pos>") + "<gml:pos>".length, B.indexOf("</gml:pos>")) } t.position = new Position(p); var n; if (B.indexOf("<xls:freeFormAddress>") > 0) { if (B.indexOf("<xls:freeFormAddress/>") > 0) { n = "NO ADDRESS FOUND" } else { n = B.substring(B.indexOf("<xls:freeFormAddress>") + "<xls:freeFormAddress>".length, B.indexOf("</xls:freeFormAddress>")) } n = new FreeFormAddress(n); t.freeFormAddress = n } else { n = new Address(); var y; var z; if (B.indexOf('<xls:Building number="') > 0) { y = B.indexOf('<xls:Building number="') + '<xls:Building number="'.length; z = B.indexOf('"/>', y); n.buildingNumber = B.substring(y, z) } if (B.indexOf("<xls:Street>") > 0) { y = B.indexOf("<xls:Street>") + "<xls:Street>".length; z = B.indexOf("</xls:Street>", y); n.street = B.substring(y, z) } if (B.indexOf('<xls:Place type="CountrySubdivision">') > 0) { y = B.indexOf('<xls:Place type="CountrySubdivision">') + '<xls:Place type="CountrySubdivision">'.length; z = B.indexOf("</xls:Place>", y); n.countrySubdivision = B.substring(y, z) } if (B.indexOf('<xls:Place type="CountrySecondarySubdivision">') > 0) { y = B.indexOf('<xls:Place type="CountrySecondarySubdivision">') + '<xls:Place type="CountrySecondarySubdivision">'.length; z = B.indexOf("</xls:Place>", y); n.countrySecondarySubdivision = B.substring(y, z) } if (B.indexOf('<xls:Place type="Municipality">') > 0) { y = B.indexOf('<xls:Place type="Municipality">') + '<xls:Place type="Municipality">'.length; z = B.indexOf("</xls:Place>", y); n.municipality = B.substring(y, z) } if (B.indexOf('<xls:Place type="MunicipalitySubdivision">') > 0) { y = B.indexOf('<xls:Place type="MunicipalitySubdivision">') + '<xls:Place type="MunicipalitySubdivision">'.length; z = B.indexOf("</xls:Place>", y); n.MunicipalitySubdivision = B.substring(y, z) } if (B.indexOf("<xls:PostalCode>") > 0) { y = B.indexOf("<xls:PostalCode>") + "<xls:PostalCode>".length; z = B.indexOf("</xls:PostalCode>", y); n.postalCode = B.substring(y, z) } t.structuredAddress = n } var o; if (B.indexOf("<xls:BoundingBox>") < 0) { o = null } else { var C = B.substring(B.indexOf("<xls:BoundingBox>") + "<xls:BoundingBox>".length, B.indexOf("</xls:BoundingBox>")); var m = C.substring(C.indexOf('">') + '">'.length, C.indexOf("</gml")); var j = C.substring(C.indexOf("</gml") + 5, C.length); var l = j.substring(j.indexOf('">') + '">'.length, j.indexOf("</gml")); o = new BoundingBox(new Position(m), new Position(l)) } t.boundingBox = o; var q; if (B.indexOf("matchType") < 0) { q = null } else { q = B.substring(B.indexOf("matchType=")); q = q.substring(q.indexOf('"') + 1); q = q.substring(0, q.indexOf('"')) } t.matchType = q; s.push(new Position(p)); k.push(n); E.push(t) } w = Sarissa.getText(v.selectSingleNode("//xls:Response/@requestID")); f[w](s, k, E); f[w] = undefined } } } function Icon(g, d, b, f, a, c) { if (!g || (d != 0 && !d) || (b != 0 && !b) || (f != 0 && !f) || (a != 0 && !a)) { throw new Exception("Error instantiating Icon, missing parameters. Icon(src,iconAnchorX,iconAnchorY,width,height) all required. The last parameter overlay is optional.") } this._previousX = null; this._previousY = null; this.src = g; this.anchorX = d; this.anchorY = b; this.width = f; this.height = a; this.overlay = c || new TextOverlay("", 1, 1) } Icon.prototype.getAnchorX = function () { return this.anchorX }; Icon.prototype.getAnchorY = function () { return this.anchorY }; Icon.prototype.getHeight = function () { return this.height }; Icon.prototype.getOverlay = function () { return this.overlay }; Icon.prototype.getSrc = function () { return this.src }; Icon.prototype.getWidth = function () { return this.width }; Icon.prototype.setAnchorX = function (a) { this._previousX = this.anchorX; this.anchorX = a }; Icon.prototype.setAnchorY = function (a) { this._previousY = this.anchorY; this.anchorY = a }; Icon.prototype.setHeight = function (a) { this.height = a }; Icon.prototype.setOverlay = function (a) { this.overlay = a }; Icon.prototype.setSrc = function (a) { this.src = a }; Icon.prototype.setWidth = function (a) { this.width = a }; deCarta.IdManager.getUniqueId = function (c) { var b = deCarta.IdManager.getUniqueId.seedNumber++; var a = null; if (c) { a = "" + c + b } else { a = b } return a }; deCarta.IdManager.getUniqueId.seedNumber = 10000; deCarta.IdManager.setTag = function (c, a, d) { var b = deCarta.IdManager.tagDitionary; if (!c[b]) { c[b] = {} } if (d) { c[b][a] = d } else { c[b][a] = true } }; deCarta.IdManager.checkTag = function (c, a) { var b = deCarta.IdManager.tagDitionary; if (c && a) { if (c[b]) { return c[b][a] } } return undefined }; deCarta.IdManager.tagDitionary = "deCartaTagDictionary"; function InfoWindow(a, c, d, b) { this.init(a, c, d, b) } InfoWindow.prototype.xOffset = -20; InfoWindow.prototype.yOffset = 0; InfoWindow.prototype.bubble = null; InfoWindow.prototype.bubbleClassName = "decarta-bubble"; InfoWindow.prototype.bubbleContent = null; InfoWindow.prototype.bubbleContentClassName = "decarta-bubbleContent"; InfoWindow.prototype.bubbleClose = null; InfoWindow.prototype.bubbleCloseClassName = "decarta-close"; InfoWindow.prototype.associatedPin = null; InfoWindow.prototype.init = function (a, c, d, b) { this.initBubble(); if (a) { this.bubble = a; this.bubble.id = "decarta-bubble"; this.bubbleContent.style.position = "absolute"; this.bubble.appendChild(this.bubbleContent); this.bubble.appendChild(this.bubbleClose) } if (b) { this.bubbleClose.src = b.src; this.bubbleClose.style.top = b.anchorY + "px"; this.bubbleClose.style.left = b.anchorX + "px"; if (b.height) { this.bubbleClose.style.height = b.height + "px" } if (b.width) { this.bubbleClose.style.width = b.width + "px" } if (Utilities.ie6 && this.bubbleClose.src.match(new RegExp("\\bpng\\b", "g"))) { Utilities.fixPng(this.bubbleClose) } this.bubbleClose.style.position = "absolute" } if (c) { this.xOffset = c } if (d) { this.yOffset = d } }; InfoWindow.prototype.initBubble = function () { try { this.bubble = document.createElement("div"); this.bubble.id = this.bubbleClassName; this.bubble.className = this.bubbleClassName; this.bubbleContent = document.createElement("div"); this.bubbleContent.id = this.bubbleContentClassName; this.bubbleContent.className = this.bubbleContentClassName; this.bubbleClose = document.createElement("img"); this.bubbleClose.src = Credentials.infoWindowCloseButton; this.bubbleClose.id = this.bubbleCloseClassName; this.bubbleClose.className = this.bubbleCloseClassName; this.bubbleClose.owner = this; this.bubbleClose.onclick = function (b) { b = b || event; b.stoppropagation ? b.stoppropagation() : b.cancelBubble = true; this.owner.hide() }; this.bubble.appendChild(this.bubbleContent); this.bubble.appendChild(this.bubbleClose) } catch (a) { throw new Exception("initBubble error:" + a.message) } }; InfoWindow.prototype.setPosition = function (b, a) { a = a || 0; b = b || 0; this.bubble.style.top = a - this.yOffset + "px"; this.bubble.style.left = b - this.xOffset + "px" }; InfoWindow.prototype.setContent = function (a) { if (a) { this.bubbleContent.innerHTML = a } else { this.bubbleContent.innerHTML = "" } }; InfoWindow.prototype.show = function (a) { this.bubble.style.zIndex = Pin.zIndexCounter + 10000; this.bubbleContent.style.zIndex = Pin.zIndexCounter + 10000; this.bubbleClose.style.zIndex = Pin.zIndexCounter + 10000; this.bubble.style.display = "block"; if (a) { this.associatedPin = a } else { this.associatedPin = null } }; InfoWindow.prototype.hide = function () { this.bubble.style.display = "none" }; function JSRequest() { } JSRequest.host = null; JSRequest.interceptorRequestFunction = null; JSRequest.interceptorResponseFunction = null; JSRequest.TIMEOUT = 60000; JSRequest.timeoutHandler = function () { throw new Exception("JSRequest timeout") }; JSRequest.xmlhttp = true; JSRequest.hostInProgress = false; JSRequest.holder = []; JSRequest.xmlHTTPRequestIntercepter = null; JSRequest.registerXMLHTTPRequestInterceptor = function (a) { JSRequest.xmlHTTPRequestIntercepter = a }; JSRequest.registerXMLRequestInterceptor = function (a) { JSRequest.interceptorRequestFunction = a }; JSRequest.registerXMLResponseInterceptor = function (a) { JSRequest.interceptorResponseFunction = a }; JSRequest.callbackFunctions = new Array(); JSRequest.callbackRegistry = function (f) { var b = f; try { if (b && b.response != null && b.response.indexOf("problem connecting to DDS") > 0) { throw new Exception("Problem connecting to DDS: Please try again later or contact support") } if (b.response != null) { try { if (typeof JSRequest.interceptorResponseFunction === "function") { var a = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(b.response), "text/xml"); if (b.response.indexOf("RUOK") == -1) { b.response = Sarissa.serialize(JSRequest.interceptorResponseFunction(a)) } } } catch (c) { throw new Exception("Application Error: API user application response interceptor function threw error: " + c.message) } if (JSRequest.callbackFunctions[b.requestID]) { JSRequest.callbackFunctions[b.requestID](b.response) } JSRequest.callbackFunctions[b.requestID] = null } else { } if (document.getElementById(b.requestID + ":" + b.chunkNo)) { document.getElementsByTagName("head").item(0).removeChild(document.getElementById(b.requestID + ":" + b.chunkNo)) } } catch (c) { throw new Exception(c.message) } }; JSRequest.checkTimeout = function (b) { var a = (b.split(":"))[0]; if (JSRequest.callbackFunctions[a] != null) { JSRequest.host = null; JSRequest.timeoutHandler(a); JSRequest.callbackFunctions[a] = null; document.getElementsByTagName("head").item(0).removeChild(document.getElementById(b)) } }; JSRequest.timeoutHandler = function (b, a) { JSRequest.timeoutHandler = b; JSRequest.TIMEOUT = a || 60000 }; JSRequest.send = function (z, h) {
    if (!z) { return } if (JSRequest.xmlhttp) {
        try {
            if (!document.all) {
                try {
                    //netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")
                } catch (u) { } 
            } var A = new XMLHttpRequest(); var n = JSRequest.getRequestOverrideUrl(z); if (!n) { A.open("POST", Credentials.url, true) } else { A.open("POST", n, true) } 
        } catch (u) { throw new Exception(u.message + "Depending on your browser settings you may have troubles running JavaScript code that uses the XMLHTTPRequest from your local file system.  XMLHTTPRequest verifies that the request to the server is from a script that is downloaded from that same server.  To remedy this problem, place your app inside tomcat and access from localhost.  Or see the 4.2.2 feature of using dynamic script tags (JSON/GET) to bypass this security issue.") } A.onreadystatechange = function () { if (A.readyState == 4) { if (A.responseText == "") { throw new Exception("Problem connecting to DDS Web Services: Please try again later or contact support") } if (A.responseText && A.responseText != null && A.responseText.indexOf("problem connecting to DDS") > 0) { throw new Exception("Problem connecting to DDS: Please try again later or contact support") } h(A.responseText) } }; if (JSRequest.xmlHTTPRequestIntercepter) { JSRequest.xmlHTTPRequestIntercepter(A) } A.send(z); return
    } if (JSRequest.host == null) { JSRequest.holder.push(z); JSRequest.holder.push(h); if (JSRequest.hostInProgress) { return } JSRequest.hostInProgress = true; var j = new XMLRequestFactory(); var b = j.createRUOKRequestDOM(Utilities.getRequestId()); z = b; h = JSRequest.getHost } try { if (typeof JSRequest.interceptorRequestFunction === "function") { if (!JSRequest.xmlhttp && JSRequest.host == null) { var d = Sarissa.serialize(z) } else { var d = Sarissa.serialize(JSRequest.interceptorRequestFunction(z)) } } else { var d = Sarissa.serialize(z) } } catch (u) { throw new Exception("Application Error: API user application request interceptor function threw error: " + u.message) } var g = Credentials.url; var r = 1800; var v = g.length; var a = 80; var t = (encodeURIComponent(d)).length; var l; var s = 1; while (true) { if (v + a + (t / s) < r) { l = s; break } s++ } var o = ""; var w = Math.ceil(d.length / l); var p = Utilities.getRequestId(); var m = 0; for (var s = 1; s <= l; s++) { JSRequest.callbackFunctions[p] = h; if (m == 0) { var f = Math.round(w * s - w) } else { var f = m } var c = Math.round(w * s); m = c; var k = d.substring(f, c); o = encodeURIComponent(k); var y = document.createElement("script"); y.setAttribute("type", "text/javascript"); var q = g + "?reqID=" + p + "&chunkNo=" + s + "&numChunks=" + l + "&callback=JSRequest.callbackRegistry&data=" + o; q = q.replace(new RegExp("\\+", "g"), "%2b"); y.setAttribute("src", q); y.setAttribute("id", p + ":" + s); document.getElementsByTagName("head").item(0).appendChild(y); setTimeout("JSRequest.checkTimeout('" + p + ":" + s + "')", JSRequest.TIMEOUT) } 
}; JSRequest.getHost = function (h) { var f = Sarissa.getDomDocument(); f = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(h), "text/xml"); f.setProperty("SelectionLanguage", "XPath"); f.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'"); if (f.selectNodes("//xls:Error").length > 0) { throw new Exception("Error Message: " + (f.selectNodes("//@message"))[0].value) } var d = f.selectSingleNode("//xls:RUOKResponse/@hostName").value; var a = Credentials.url; var g, j; if (a.indexOf("https://") > -1) { g = "https://" } else { g = "http://" } var c = a.substring(g.length); if (c.indexOf(":") > -1) { j = c.substring(c.indexOf(":")) } else { j = c.substring(c.indexOf("/")) } JSRequest.host = g + d + j; Credentials.url = JSRequest.host; for (var b = 0; b < JSRequest.holder.length; b++) { JSRequest.send(JSRequest.holder[b], JSRequest.holder[b + 1]); b = b + 1 } JSRequest.holder = []; JSRequest.hostInProgress = false }; JSRequest.setXMLHTTPMode = function () { JSRequest.xmlhttp = true; if (Credentials.url.indexOf("JSON") > -1) { var a = Credentials.url.substring(0, Credentials.url.indexOf("/JSON")); Credentials.url = a + "/openls" } }; JSRequest.setDynamicScriptTagMode = function () { JSRequest.xmlhttp = false; if (Credentials.url.indexOf("/openls/openls") > -1) { var a = Credentials.url.substring(0, Credentials.url.indexOf("/openls/openls")); Credentials.url = a + "/openls/JSON" } }; JSRequest.getRequestOverrideUrl = function (b) { var a = ""; var c = b.selectSingleNode("//xls:XLS/xls:Request").getAttribute("methodName"); if (Credentials.requestUrlOverride[c]) { a = Credentials.requestUrlOverride[c] } return a }; function KML(c, a, b) { if (!c) { throw new Exception("Error constructing a KML object, geometry is required") } this.geometry = c; this.name = a || null; this.description = b || null } function KMLGeometry(a, b) { this.type = a; this.coordinates = b } deCarta.LinkedList = function () { this.length = 0; this.head = null; this.index = deCarta.LinkedList.Config.genIndex() }; deCarta.LinkedList.Config = {}; deCarta.LinkedList.Config.itemBackPointer = "dCLLItemPointer"; deCarta.LinkedList.Config.itemBackPointerIndex = 0; deCarta.LinkedList.Config.genIndex = function () { return (deCarta.LinkedList.Config.itemBackPointer + deCarta.LinkedList.Config.itemBackPointerIndex++) }; deCarta.LinkedList.prototype.add = function (a) { var b = null; try { b = new deCarta.LinkedListItem(a, this.index) } catch (c) { throw new Exception("Error LinkedList.add(): " + c.message) } if (!this.head) { this.head = b; this.head.next = null; this.head.prev = null } else { this.head.prev = b; b.next = this.head; b.prev = null; this.head = b } this.length++ }; deCarta.LinkedList.prototype.remove = function (b) { var c = null; var a = null; if (this.length <= 0) { return null } if (!b) { c = this.head; this.head = c.next } else { if ((b.data) && b.data.hasOwnProperty(this.index)) { c = b } else { if (b.hasOwnProperty(this.index)) { c = b[this.index] } else { throw new Exception("Attempting to remove an item that's not really a part of the LinkedList.") } } } if (c.prev) { c.prev.next = c.next } else { this.head = c.next } if (c.next) { c.next.prev = c.prev } a = c.destroy(this.index); this.length--; return a }; deCarta.LinkedList.prototype.removeByKey = function (g, b) { var f; var d = this.length; var a = this.head; var c; var h = new Array(); if (!g || !b) { throw new Exception("Attempt to removeByKey keyName: " + g + " and keyVal: " + b) } if (this.length <= 0) { return null } for (f = 0; f < d; f++) { c = a; a = c.next; if (b == c.data[g.toString()]) { h.push(this.remove(c)) } } if (!h.length) { return null } else { return h } }; deCarta.LinkedList.prototype.removeById = function (c, h) { var g; var f = this.length; var b = this.head; var d; var a = null; if (!c || !h) { throw new Exception("Attempt to removeByKey keyName: " + c + " and keyVal: " + h) } if (this.length <= 0) { return null } for (g = 0; g < f; g++) { d = b; b = d.next; if (h == d.data[c.toString()]) { a = this.remove(d); return a } } return null }; deCarta.LinkedList.prototype.removeAll = function () { var a = []; var b = null; while (this.length > 0) { b = this.remove(); a.push(b) } return a }; deCarta.LinkedList.prototype.returnAsArray = function () { var a = []; var b; var d = this.head; var c = null; for (b = 0; b < this.length; b++) { a.push(d.data); c = d.next; d = c } return a }; deCarta.LinkedList.prototype.operateOnData = function (a) { var b; var d = this.head; var c = null; if (typeof a != "function") { throw new Exception("Attempt operateOnData without a function.") } for (b = 0; b < this.length; b++) { a(d.data); c = d.next; d = c } }; deCarta.LinkedListItem = function (b, a) { if (!b || (typeof b != "object") || !a) { throw new Exception("LinkedList Error: Attempt to add null or primitive.") } if (b.hasOwnProperty(a)) { throw new Exception("LinkedList Error: newData already containsproperty backpointer: " + a) } this.data = b; b[a] = this; this.next = null; this.prev = null }; deCarta.LinkedListItem.prototype.destroy = function (b) { var a = this.data; this.data = null; this.next = null; this.prev = null; delete a[b]; return a }; function Locale(b, a) { this.language = b.toUpperCase(); this.country = a.toUpperCase() } Locale.prototype.getLanguage = function () { return this.language }; Locale.prototype.setLanguage = function (a) { this.language = a.toUpperCase() }; Locale.prototype.getCountry = function () { return this.country }; Locale.prototype.setCountry = function (a) { this.country = a.toUpperCase() }; Locale.prototype.toString = function () { return this.country + "_" + this.language }; function Map(aF) { deCarta.StyleManager.init(); if (!(aF && aF.style)) { throw new Exception("Must supply a div element to construct the map.") } this.mapDiv = aF; if (!(this.mapDiv.style.height)) { this.mapDiv.style.height = GLOBALS.DEFAULT_MAP_HEIGHT } if (!(this.mapDiv.style.width)) { this.mapDiv.style.width = GLOBALS.DEFAULT_MAP_WIDTH } this.type = "map"; this.routePreference = new RoutePreference("Fastest", new UOM("MI")); var aK = this; var bi = {}; var a = undefined; var u = null; var bN = null; var bO = null; var aH = null; var R = new XMLRequestFactory(); R.mapType = GLOBALS.STREET; var bD = "server"; var b5 = false; var bS = null; var bm = null; var bn = []; var bF = new Array(); var aO = new deCarta.LinkedList(); var bZ = []; var a4 = null; var m = null; var ad = document.all; var T = "px"; var ai = 0; var L = true; var bj = false; var ah = 0; var ag = 0; var ba = false; var N = false; var bR = 0; var bQ = 0; var bL = false; var a5 = true; var t = true; var bV = new Date(); var bP = new Date(); var af = false; var aX = false; var aW = false; var g = null; var bf = null; var C = GLOBALS.DEFAULT_MAP_TILE_SIZE; var aV = C; var G = 0; var ao = 0; var d = 2; var i = new PixelPoint(0, 0); var aS = 0; var aQ = 0; var c = 0; var b = 0; var bb = 0; var a1 = 0; var az = 0; var aw = 0; this.authenticate = function (b8, b7) { if (!b8 || !b7 || b8 == "" || b7 == "") { throw new Exception("Error calling Map.authenticate(), bad params") } Credentials.clientName = b8; Credentials.clientPassword = b7; R.clientName = b8; R.clientPassword = b7 }; this.setURL = function (b7) { Credentials.url = b7 }; this.setConfiguration = function (b7) { if (!b7) { throw new Exception("error calling Map.setConfiguration() with argument: " + b7) } Credentials.configuration = b7; R.configuration = b7 }; this.setTransparentConfiguration = function (b7) { if (!b7) { throw new Exception("error calling Map.setTransparentConfiguration() with arg: " + b7) } Credentials.transparentConfiguration = b7; R.transparentConfiguration = b7 }; this.setMapStyle = function (b8) { Credentials.configuration = b8; R.configuration = b8; if (bS) { bS = (new DOMParser()).parseFromString(Sarissa.serialize(bS), "text/xml"); bS.setProperty("SelectionLanguage", "XPath"); bS.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'"); var b7 = bS.selectSingleNode("/xls:XLS/xls:RequestHeader"); b7.setAttribute("configuration", b8); bZ[2].refUrl.setParameter("config", b8); bZ[2].refresh() } }; this.setMapFormat = function (b8) { R.streetImgFormat = b8; if (bS) { bS = (new DOMParser()).parseFromString(Sarissa.serialize(bS), "text/xml"); bS.setProperty("SelectionLanguage", "XPath"); bS.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'"); var b7 = bS.selectSingleNode("/xls:XLS/xls:Request/xls:PortrayMapRequest/xls:Output"); b7.setAttribute("format", b8); bZ[2].refUrl.setParameter("format", b8); bZ[2].refresh() } }; this.changeCurrentMapStyle = function (b7) { setMapStyle(b7) }; this.reDrawMap = function (b7) { if (bS == null) { return false } aK.centerOnPosition(aK.getCenterPosition(), b7); return true }; this.addCopyrightMessage = function (b8, b7, b9) { if (deCarta.String.isString(b8)) { u = new deCarta.CopyrightMessage(b8) } else { u = b8 } aK.addMapControl(u); if (b7 && b9) { u.position = function () { }; u.frame.style.top = b9 + T; u.frame.style.left = b7 + T } }; this.centerOnAddress = function (ca, b8, b7) { bv(); var b9 = Utilities.getRequestId(); if (typeof b8 == "function") { bn[b9] = b8 } else { bn[b9] = null } aK.hidePinsBeforeZoom(); bS = R.createMapAddressRequestDOM(ca, C, b9, bN.getGXConvertedZoomLevel(), b7); JSRequest.send(bS, aG) }; this.centerOnPosition = function (b7, b9, b8) { g = b7.clone(); bv(); var ca = Utilities.getRequestId(); if (typeof b9 == "function") { bn[ca] = b9 } else { bn[ca] = null } aK.hidePinsBeforeZoom(); bS = R.createMapRequestDOM(b7, C, ca, bN.getGXConvertedZoomLevel(), b8); JSRequest.send(bS, aM) }; this.panToPosition = function (ce, cb) { var b7 = ce.clone(); var ca = aK.getCenterPosition(); var cd = this.posToMercPix(ca); var b9 = this.posToMercPix(b7); var b8 = new PixelPoint(Math.round(cd.x - b9.x), Math.round(cd.y - b9.y)); if (b8.x == 0 && b8.y == 0) { return } var cc = Utilities.centerContextToBoundingBox(ca, bN.getRadius()); if (cc.extendedContains(b7)) { if (typeof cb == "function") { bn.panToPosition = cb } else { bn.panToPosition = null } aT(b8.x, -1 * b8.y) } else { this.centerOnPosition(b7, cb) } }; this.getCenterPosition = function () { if (!g) { throw new Exception("Center Position not set") } var b9 = c - bb; var b8 = b - a1; if (b9 == 0 && b8 == 0) { return g } var b7 = aK.posToMercPix(g); b7.x -= b9; b7.y += b8; var ca = aK.mercPixToPos(b7); return ca }; this.addCustomInfoWindow = function (b7) { if (m && aH) { m.removeChild(aH.bubble) } aH = b7; if (m) { m.appendChild(aH.bubble) } }; this.addAndCenterOnPin = function (b7) { this.addPin(b7); this.panToPosition(b7.position) }; this.addPin = function (b7) { if (g == null) { throw new Exception("Error adding Pin, you can not add a pin until the center Position is set. Please use the callback of map.centerPosition().") } try { aO.add(b7) } catch (b8) { return } b7.map = aK; b7.setPosition(b7.position); m.appendChild(b7.pinImg); if (b7.pinTxt) { m.appendChild(b7.pinTxt) } }; this.getPins = function () { return aO.returnAsArray() }; this.hidePins = function () { aO.operateOnData(function (b7) { if (!b7) { return } b7.pinImg.style.display = "none"; b7.pinTxt.style.display = "none" }) }; this.showPins = function () { aO.operateOnData(function (b7) { b7.pinImg.style.display = "block"; b7.pinTxt.style.display = "block" }) }; this.removeAllPins = function () { var b7; while (aO.length > 0) { b7 = aO.remove(); if (ad) { Utilities.purge(b7.pinImg) } m.removeChild(b7.pinImg); b7.pinImg = null; if (b7.pinTxt) { if (ad) { Utilities.purge(b7.pinTxt) } m.removeChild(b7.pinTxt); b7.pinTxt = null } } }; this.removePin = function (b8) { var b7 = null; try { b7 = aO.remove(b8) } catch (b9) { return } if (!b7) { return } b7.destroy() }; this.removePinById = function (b9) { try { var b7 = aO.removeById("id", b9) } catch (b8) { return } if (!b7) { return } if (b7.pinTxt) { Utilities.purge(b7.pinTxt); m.removeChild(b7.pinTxt); b7.pinTxt = null } Utilities.purge(b7.pinImg); m.removeChild(b7.pinImg) }; this.removePinsById = function (cb) { var b7 = null; var b9 = null; var b8; try { b7 = aO.removeByKey("id", cb) } catch (ca) { return } if (!b7) { return } for (b8 = 0, b9 = b7.length; b8 < b9; b8++) { if (b7[b8].pinTxt) { Utilities.purge(b7[b8].pinTxt); m.removeChild(b7[b8].pinTxt); b7[b8].pinTxt = null } Utilities.purge(b7[b8].pinImg); m.removeChild(b7[b8].pinImg) } }; this.setDragEnabled = function (b7) { if (!"boolean" == (typeof b7)) { throw new Exception("Map.setDragEnabled requires boolean") } L = b7 }; this.setShapeClippingEnabled = function (b7) { if (!"boolean" == (typeof b7)) { throw new Exception("Map.setShapeClippingEnabled requires boolean") } b5 = b7 }; this.setDoubleClickRecenteringEnabled = function (b7) { if (!"boolean" == (typeof b7)) { throw new Exception("Map.setDoubleClickRecenteringEnabled requires boolean") } t = b7 }; this.setDoubleClickRecenterAndZoom = function (b7) { if (b7) { aX = true } else { aX = false } }; this.setDigitalZoomEnabled = function (b7) { if (b7) { a5 = true } else { a5 = false } }; this.addOverlay = function (b7) { if (deCarta.Array.isArray(b7)) { var b9 = b7.length; for (var b8 = 0; b8 < b9; b8++) { b7[b8].map = aK; R.overlays.push(b7[b8]) } } else { b7.map = aK; R.overlays.push(b7) } aE() }; this.getOverlays = function () { var b8 = []; var b9 = R.overlays.length; for (var b7 = 0; b7 < b9; b7++) { b8[b7] = R.overlays[b7] } return b8 }; this.removeOverlay = function (b7) { b7.map = null; var b9 = new Array(); for (var b8 = 0; b8 < R.overlays.length; b8++) { if (R.overlays[b8] && !R.overlays[b8].equals(b7)) { b9.push(R.overlays[b8]) } } R.overlays = b9; if (b9.length == 0) { aE(true) } else { aE() } }; this.removeOverlayById = function (b9) { var b8 = new Array(); for (var b7 = 0; b7 < R.overlays.length; b7++) { if (R.overlays[b7] && R.overlays[b7].id != (b9)) { b8.push(R.overlays[b7]) } else { R.overlays[b7].map = null } } R.overlays = b8; if (b8.length == 0) { aE(true) } else { aE() } }; this.removeAllOverlays = function () { if (R && R.overlays && (R.overlays.length <= 0)) { return } R.overlays = []; aE(true) }; this.setShapeRendering = function (b7) { if (!b7 || !b7 == "client" || !b7 == "server") { throw new Exception("map.setShapeRendering() error: use 'client' or 'server'") } if (b7 == "server") { bT() } else { aE() } bD = b7; R.rendering = b7 }; this.getShapeRendering = function () { return bD }; this.redraw = function () { aE() }; this.panWest = function () { aT(GLOBALS.PAN_PIXEL_DISTANCE, 0) }; this.panEast = function () { aT(-GLOBALS.PAN_PIXEL_DISTANCE, 0) }; this.panNorth = function () { aT(0, GLOBALS.PAN_PIXEL_DISTANCE) }; this.panSouth = function () { aT(0, -GLOBALS.PAN_PIXEL_DISTANCE) }; this.panSouthEast = function () { aT(-GLOBALS.PAN_PIXEL_DISTANCE, -GLOBALS.PAN_PIXEL_DISTANCE) }; this.panNorthEast = function () { aT(-GLOBALS.PAN_PIXEL_DISTANCE, GLOBALS.PAN_PIXEL_DISTANCE) }; this.panSouthWest = function () { aT(GLOBALS.PAN_PIXEL_DISTANCE, -GLOBALS.PAN_PIXEL_DISTANCE) }; this.panNorthWest = function () { aT(GLOBALS.PAN_PIXEL_DISTANCE, GLOBALS.PAN_PIXEL_DISTANCE) }; this.addScaleBar = function (b7) { a = b7; aK.addMapControl(a) }; this.addMapTypeController = function (b7) { if (!b7) { throw new Exception("error adding mapTypeController to map") } bO = b7; aK.addMapControl(bO) }; this.setMapType = function (b7) { if (!(b7 == GLOBALS.STREET || b7 == GLOBALS.HYBRID || b7 == GLOBALS.SATELLITE)) { throw new Exception("unsupported mapType. Use '" + GLOBALS.STREET + "' || '" + GLOBALS.HYBRID + "' || '" + GLOBALS.SATELLITE + "'") } R.mapType = b7; if (bZ.length > 0) { if (b7 == GLOBALS.STREET) { bZ[0].hide(); bZ[1].hide(); bZ[2].show() } else { if (b7 == GLOBALS.HYBRID) { bZ[0].show(); bZ[1].show(); bZ[2].hide() } else { if (b7 == GLOBALS.SATELLITE) { bZ[0].show(); bZ[1].hide(); bZ[2].hide() } } } } }; this.setRoutePreference = function (b7) { aK.routePreference = b7 }; this.getRoutePreference = function () { return aK.routePreference }; this.routeMap = function (b9, b7) { var b8 = Utilities.getRequestId(); if (typeof b7 == "function") { bn[b8] = b7 } else { bn[b8] = null } if (aK.routePreference.alternateRoutes > 0) { throw new Exception("Alternate routes only available through RouteQuery for use with client side shape rendering.") } aK.hidePinsBeforeZoom(); bm = R.createRouteGeometryRequestDOM(b9, b8, aK.routePreference); JSRequest.send(bm, an) }; this.routeMapById = function (b9, b7) { var b8 = Utilities.getRequestId(); if (typeof b7 == "function") { bn[b8] = b7 } else { bn[b8] = null } if (aK.routePreference.alternateRoutes > 0) { throw new Exception("Alternate routes only available through RouteQuery for use with client side shape rendering.") } bm = R.createRouteGeometryByIdRequestDOM(b9, b8, null, false); JSRequest.send(bm, an) }; this.clearRoute = function () { if (bS == null) { return false } R.routeID = null; var b8 = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(Sarissa.serialize(bS)), "text/xml"); b8.setProperty("SelectionLanguage", "XPath"); b8.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'"); var b7 = b8.selectSingleNode("//xls:PortrayMapRequest"); try { b7.removeChild(b7.selectSingleNode("//xls:Overlay")) } catch (b9) { } return true }; this.addZoomController = function (b7) { bN = b7; aK.addMapControl(bN) }; this.getZoomController = function () { return bN }; this.resize = function (b7, b8, b9) { aK.mapDiv.style.height = parseInt(b7) + T; aK.mapDiv.style.width = parseInt(b8) + T; aK.positionMapControls(); bL = true; if (m) { aK.reDrawMap(b9) } }; this.getBoundingBox = function () { var ca = aK.posToMercPix(aK.getCenterPosition()); var b8 = (ao * C / 2); var ce = (G * C / 2); var cb = new PixelPoint(ca.x + ce, ca.y + b8); var cc = new PixelPoint(ca.x - ce, ca.y - b8); var b7 = aK.mercPixToPos(cb); var b9 = aK.mercPixToPos(cc); var cd = new BoundingBox(b9, b7); return cd }; this.getBoundingBoxViewable = function () { var b9 = aK.posToMercPix(aK.getCenterPosition()); var b8 = parseInt(aK.mapDiv.style.height) / 2; var ce = parseInt(aK.mapDiv.style.width) / 2; var cc = new PixelPoint(b9.x + ce, b9.y + b8); var cb = new PixelPoint(b9.x - ce, b9.y - b8); var cd = aK.mercPixToPos(cc); var b7 = aK.mercPixToPos(cb); var ca = new BoundingBox(b7, cd); return ca }; this.getGridSize = function () { return ao + " " + G }; this.setTileBuffer = function (b7) { if (b7) { d = 2 } else { d = 1 } }; this.setTileBorder = function (b8) { if (b8) { ai = 1 } else { ai = 0 } for (var b9 = 0; b9 < ao; ++b9) { for (var b7 = 0; b7 < G; ++b7) { bZ[0].tileArray[b7][b9].border = ai; bZ[1].tileArray[b7][b9].border = ai; bZ[2].tileArray[b7][b9].border = ai } } }; this.getTileSize = function () { return C }; this.setTileSize = function (b7) { C = parseInt(b7, 10); aV = C; bL = true }; this.getMapLayers = function () { return bZ }; this.positionToMapLayerPixel = function (cd) { if (!cd || !g) { throw new Exception("Map.positionToMapLayerPixel: bad input: " + cd) } var b9 = aK.posToMercPix(aK.getCenterPosition()); var b7 = parseInt(aK.mapDiv.style.height) / 2; var cc = parseInt(aK.mapDiv.style.width) / 2; var ca = new PixelPoint(b9.x - cc + c, b9.y + b7 - b); var b8 = this.posToMercPix(cd); var cb = new PixelPoint(-(ca.roundX() - b8.roundX()), (ca.roundY() - b8.roundY())); return cb }; this.addMapControl = function (b9) { if (!b9) { throw new Exception("adding invalid control to map.") } else { if (!b9.type || b9.map) { throw new Exception("adding invalid control to map, with properties type:" + b9.type + " map:" + b9.map) } } var b7 = b9.type; if (this.existsMapControl(b7)) { this.removeMapControl(b7) } bi[b7] = b9; this.getMapDiv().appendChild(b9.appendThis()); b9.map = this; var b8 = new deCarta.DOMDimensions(this.getMapDiv()); b9.position(b8) }; this.existsMapControl = function (b7) { if (bi[b7]) { return true } else { return false } }; this.removeMapControl = function (b7) { if (!b7 || !(b7 && bi[b7])) { return } var b8 = bi[b7]; bi[b7] = undefined; this.getMapDiv().removeChild(b8.removeThis()); Utilities.purge(b8) }; this.positionMapControls = function () { var b7; var b8 = new deCarta.DOMDimensions(this.getMapDiv()); for (b7 in bi) { if (bi.hasOwnProperty(b7) && bi[b7].position) { bi[b7].position(b8) } } }; this.getMapLayers = function () { return bZ }; this.hide = function () { this.getMapDiv().style.display = "none" }; this.show = function () { this.getMapDiv().style.display = "block"; this.positionMapControls() }; this.setCompatibility = function (b8, b7) { switch (b8) { case "restrictDragToDiv": if (b7) { this.addEventListener("mouseout", ay) } else { this.clearListeners("mouseout") } break; default: throw new Exception("Map.setCompatibility: illegal flag: " + b8.toString() + " passed in as argument."); break } }; function a6() { aH = new InfoWindow() } this.addEventListener = function (b9, ca) { var b8 = false; for (var b7 = 0; b7 < bF.length; b7++) { if (bF[b7] == b9) { bF[b9] = ca; b8 = true; break } } if (!b8) { bF.push(b9); bF[b9] = ca } }; this.clearInstanceListeners = function () { for (var b7 = 0; b7 < bF.length; b7++) { bF[bF[b7]] = null; bF[b7] = null } }; this.clearListeners = function (b8) { for (var b7 = 0; b7 < bF.length; b7++) { if (bF[b7] == b8) { bF[bF[b7]] = null; bF[b7] = null } } }; function Q(b9) { b9 = b9 ? b9 : window.event; var b7; if (b9.target) { b7 = b9.target } else { if (b9.srcElement) { b7 = b9.srcElement } } if (b7 && b7.nodeType == 3) { b7 = b7.parentNode } if (deCarta.IdManager.checkTag(b7, "ingoreForMapEvents")) { return false } if (b9.type == "mouseup") { if (bF.mouseup) { var ca = new PixelPoint(b9.clientX, b9.clientY); var b8 = aK.screenPixToPos(ca); bF.mouseup(b8) } ay(b9); bP = new Date() } else { if (b9.type == "dblclick") { bc(b9) } else { if (b9.type == "click" && ((bP - bV) < 300)) { bq(b9) } } } } function bq(b9) { b9 = b9 ? b9 : window.event; var b7; if (b9.target) { b7 = b9.target } else { if (b9.srcElement) { b7 = b9.srcElement } } if (b7 && b7.nodeType == 3) { b7 = b7.parentNode } if (deCarta.IdManager.checkTag(b7, "ingoreForMapEvents")) { return false } aK.mapDiv.style.cursor = "pointer"; aK.mapDiv.unselectable = "on"; var ca = new PixelPoint(b9.clientX, b9.clientY); var b8 = aK.screenPixToPos(ca); if (bF.rightclick && (ad && b9.button == 2) || (!ad && b9.which == 3)) { bF.rightclick(b8); return } if (bF.dblclick && b9.type == "dblclick") { bF.dblclick(b8); return } if (bF.click && b9.type == "click") { bF.click(b8) } } function am(b9) { b9 = b9 ? b9 : window.event; if ((!ad && b9.which == 3) || (ad && b9.button == 2)) { if (bF.rightclick) { bq(b9) } return true } if ((!ad && b9.which == 2) || (ad && b9.button == 4)) { return true } var b7; if (b9.target) { b7 = b9.target } else { if (b9.srcElement) { b7 = b9.srcElement } } if (b7 && b7.nodeType == 3) { b7 = b7.parentNode } if (deCarta.IdManager.checkTag(b7, "ingoreForMapEvents")) { return false } bV = new Date(); if (bF.mousedown) { var ca = new PixelPoint(b9.clientX, b9.clientY); var b8 = aK.screenPixToPos(ca); bF.mousedown(b8) } bj = true; aK.mapDiv.style.cursor = "move"; ah = b9.clientX; ag = b9.clientY; document.body.onmousemove = bB; return false } function ay(b7) { bj = false; aK.mapDiv.style.cursor = "default"; document.body.onmousemove = null; if (aW && bF.moveend) { bF.moveend(); aW = false } if (a) { a.calculate() } return false } function bc(cd) { var cb; if (cd.target) { cb = cd.target } else { if (cd.srcElement) { cb = cd.srcElement } } if (cb && cb.nodeType == 3) { cb = cb.parentNode } if (deCarta.IdManager.checkTag(cb, "ingoreForMapEvents")) { return false } af = true; if (bF.dblclick) { bq(cd) } if (!t) { return } var ce = cd.clientX; var cc = cd.clientY; var b8 = Utilities.getAbsoluteLeft(aK.mapDiv) - Utilities.getScrollLeft(); var b7 = Utilities.getAbsoluteTop(aK.mapDiv) - Utilities.getScrollTop(); var ca = (parseInt(ce - b8) - Math.round(parseInt(aK.mapDiv.style.width) / 2)) * -1; var b9 = (parseInt(cc - b7) - Math.round(parseInt(aK.mapDiv.style.height) / 2)) * -1; aT(ca, b9) } function bB(ca) { var cb; var b9; ca = ca ? ca : window.event; if (!aW) { if (bF.movestart) { bF.movestart() } } if (bF.move) { cb = new PixelPoint(ca.clientX, ca.clientY); b9 = aK.screenPixToPos(cb); bF.move(b9) } if (!L) { if (ca.type == "mouseup" && bF.mouseup) { cb = new PixelPoint(ca.clientX, ca.clientY); b9 = aK.screenPixToPos(cb); bF.mouseup(b9); ay(ca) } return false } aW = true; if (!bj) { return false } var b8 = ca.clientX - ah; var b7 = ca.clientY - ag; az += b8; aw += b7; if (Math.abs(az) > aV || Math.abs(aw) > aV) { bJ() } c += b8; b += b7; aa(c, b); ah = ca.clientX; ag = ca.clientY; return false } function a8(b9) { if (!b9) { b9 = window.event } var b8 = b9.target ? b9.target : b9.srcElement; var b7 = (b9.relatedTarget) ? b9.relatedTarget : b9.toElement; try { if (b7 && b8 && (b7.id == b8.id)) { return } } catch (b9) { } if (bF.mouseout) { bF.mouseout() } } this.getMapDiv = function () { return aK.mapDiv }; this.getBubble = function () { return aH }; this.getChooser = function () { return bO }; this.getCopyright = function () { return u }; this.getTileDiv = function () { return m }; this.getZoomLck = function () { return ba }; this.hidePinsBeforeZoom = function () { aO.operateOnData(function (b7) { if (b7) { b7.zoomHide() } }) }; this.showPinsAfterZoom = function () { aO.operateOnData(function (b7) { if (b7) { b7.zoomShow() } }) }; function bw() { aO.operateOnData(function (b7) { if (!b7) { return } b7.setPosition(b7.position); b7.hideInfoWindow() }); aK.showPinsAfterZoom() } this.zoomMap = function (b7) { if (bS == null) { throw new Exception("Map not yet initialized. Map must be initialized before zooming.") } if (ba) { return false } var b9 = bN.selected; if (b9 == b7) { return false } aK.hidePinsBeforeZoom(); ba = true; var b8 = aK.getCenterPosition(); b9 = bN.getGXConvertedZoomLevel(); bN.setZoomLevel(b7); b7 = bN.getGXConvertedZoomLevel(); if (a5 && (Math.abs(b9 - b7) <= 2)) { if ((R && R.mapType == "HYBRID") || (!R.mapType && Credentials.mapType == "HYBRID")) { bZ[1].hide() } for (var ca = 0; ca < bZ.length; ca++) { bZ[ca].zoom(b7 - b9, a4, az, aw) } } bS = R.zoomMapRequestDOM(bS, 0, 0, 0, 0, b7, b9, b8, (bN.getRadiusX() * 1000 / G)); bv(); JSRequest.send(bS, bz); return true }; function bx() { return false } this.setCountryCode = function (b7) { if (!b7) { throw new Exception("error calling Map.setCountryCode()") } Credentials.ISOCountryCode = b7 }; this.getGXPixelPoint = function (b7) { this.posToMercPix(b7) }; this.posToMercPix = function (ca) { var b8 = Utilities.radsPerPixelAtZoom(C, bN.getGXConvertedZoomLevel()); var b9 = Utilities.lat2pix(ca.lat, b8); var b7 = Utilities.lon2pix(ca.lon, b8); return new PixelPoint(b7, b9) }; this.mercPixToPos = function (b7) { var ca = Utilities.radsPerPixelAtZoom(C, bN.getGXConvertedZoomLevel()); var b8 = Utilities.pix2lat(b7.y, ca); var b9 = Utilities.pix2lon(b7.x, ca); return new Position(b8, b9) }; this.screenPixToPos = function (ca) { var cb = ca.y - Utilities.getAbsoluteTop(aK.mapDiv) + Utilities.getScrollTop(); var b8 = ca.x - Utilities.getAbsoluteLeft(aK.mapDiv) + Utilities.getScrollLeft(); var cd = aK.posToMercPix(aK.getCenterPosition()); var ce = cd.x - (parseInt(aK.mapDiv.style.width) / 2); var cf = cd.y + (parseInt(aK.mapDiv.style.height) / 2); var b9 = new PixelPoint(ce, cf); var cc = new PixelPoint(b9.x + b8, b9.y - cb); var b7 = aK.mercPixToPos(cc); return b7 }; function an(ca) { var cf = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(ca), "text/xml"); cf.setProperty("SelectionLanguage", "XPath"); cf.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'"); var cd; var ch = cf.selectNodes("//xls:Error"); if (ch.length > 0) { cd = Sarissa.getText(cf.selectSingleNode("//xls:Response/@requestID")); if (typeof bn[cd] == "function") { bn[cd](null); bn[cd] = undefined } return } bv(); var b8 = cf.selectSingleNode("//xls:RouteID"); var b9 = (cf.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[0].data; var cb = (cf.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[1].data; var ci = new BoundingBox(new Position(b9), new Position(cb)); var cc = ci.getRadius(); bN.setRadius(cc); g = ci.getCenterPosition(); var ce = bN.getZoomLevelToFitBoundingBox(ci); bN.setZoomLevel(ce); var b7 = R.createCenterContext(ci.getCenterPosition(), bN.getRadius()); bS = R.createRouteMapDOM(b7, b8, Utilities.getRequestId(), C, bN.getGXConvertedZoomLevel(), aK.routePreference); var cg = Utilities.parseRoutes(cf); cd = Sarissa.getText(cf.selectSingleNode("//xls:Response/@requestID")); if (bn[cd]) { bn[cd](cg); bn[cd] = undefined } JSRequest.send(bS, aM) } function aG(ce) { var ck = Sarissa.getDomDocument(); ck = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(ce), "text/xml"); ck.setProperty("SelectionLanguage", "XPath"); ck.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'"); var cl = ck.selectNodes("//xls:Error"); var cg; if (cl.length > 0) { cg = Sarissa.getText(ck.selectSingleNode("//xls:Response/@requestID")); if (typeof bn[cg] == "function") { bn[cg](null); bn[cg] = undefined } return } try { g.lat = parseFloat(ck.selectSingleNode("//xls:Pan[@direction='N']").getAttribute("toLat")); g.lon = parseFloat(ck.selectSingleNode("//xls:Pan[@direction='E']").getAttribute("toLon")); if (isNaN(g.lat) || isNaN(g.lon)) { throw new Exception("Exception: likely no toLon or toLat attributes in Pan") } } catch (ci) { g = new Position(ck.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data) } bf = new Position(ck.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data); var cc = ck.selectSingleNode("//xls:Pan[@direction='N']"); var ch = ck.selectSingleNode("//xls:Pan[@direction='E']"); i.x = parseFloat(ch.getAttribute("numTiles")) * C; i.y = -(parseFloat(cc.getAttribute("numTiles")) * C); var ca = ck.selectSingleNode("//xls:Radius"); bN.setRadius((parseFloat(Sarissa.getText(ca)) / 1000) * G); var cf; try { cf = parseInt(ck.selectSingleNode("//xls:GridLayer[@name='deCarta']").getAttribute("maxImageHostAliases"), 10) } catch (ci) { cf = 0 } var cm = ck.selectNodes("//xls:URL"); b1(cm, cf); try { var b9 = Sarissa.getText(ck.selectSingleNode("//xls:freeFormAddress")); if (b9 == "") { b9 = "NO ADDRESS FOUND" } var cd = new FreeFormAddress(b9); bw(); cg = Sarissa.getText(ck.selectSingleNode("//xls:Response/@requestID")); if (bn[cg]) { bn[cg](cd, aK.getCenterPosition()); bn[cg] = undefined } var b7 = ck.selectSingleNode("//xls:CenterContext"); bS = (new DOMParser()).parseFromString(Sarissa.serialize(bS), "text/xml"); bS.setProperty("SelectionLanguage", "XPath"); bS.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'"); var cj = bS.selectSingleNode("//xls:CenterAddress"); var cb = bS.selectSingleNode("//xls:Output"); cb.removeChild(cj); var cn = bS.selectSingleNode("//xls:TileGrid"); var b8 = b7.cloneNode(true); cb.insertBefore(b8, cn) } catch (ci) { throw new Exception("Error updating the request center context from the response for subsequent requests: " + ci.name + ", " + ci.message) } } function aM(b9) { var ce = Sarissa.getDomDocument(); ce = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(b9), "text/xml"); ce.setProperty("SelectionLanguage", "XPath"); ce.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'"); var cb; var cf = ce.selectNodes("//xls:Error"); if (cf.length > 0) { cb = Sarissa.getText(ce.selectSingleNode("//xls:Response/@requestID")); if (typeof bn[cb] == "function") { bn[cb](null); bn[cb] = undefined } return } try { g.lat = parseFloat(ce.selectSingleNode("//xls:Pan[@direction='N']").getAttribute("toLat")); g.lon = parseFloat(ce.selectSingleNode("//xls:Pan[@direction='E']").getAttribute("toLon")); if (isNaN(g.lat) || isNaN(g.lon)) { throw new Exception("Exception: likely no toLon or toLat attributes in Pan") } } catch (cd) { g = new Position(ce.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data) } bf = new Position(ce.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data); var b8 = ce.selectSingleNode("//xls:Pan[@direction='N']"); var cc = ce.selectSingleNode("//xls:Pan[@direction='E']"); i.x = parseFloat(cc.getAttribute("numTiles")) * C; i.y = -(parseFloat(b8.getAttribute("numTiles")) * C); var b7 = ce.selectSingleNode("//xls:Radius"); bN.setRadius((parseFloat(Sarissa.getText(b7)) / 1000) * G); var ca; try { ca = parseInt(ce.selectSingleNode("//xls:GridLayer[@name='deCarta']").getAttribute("maxImageHostAliases"), 10) } catch (cd) { ca = 0 } var cg = ce.selectNodes("//xls:URL"); b1(cg, ca); bw(); cb = Sarissa.getText(ce.selectSingleNode("//xls:Response/@requestID")); if (bn[cb]) { bn[cb](aK.getCenterPosition()); bn[cb] = undefined } } function bz(b9) { var cd = Sarissa.getDomDocument(); cd = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(b9), "text/xml"); cd.setProperty("SelectionLanguage", "XPath"); cd.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'"); var ce = cd.selectNodes("//xls:Error"); if (ce.length > 0) { return } try { g.lat = parseFloat(cd.selectSingleNode("//xls:Pan[@direction='N']").getAttribute("toLat")); g.lon = parseFloat(cd.selectSingleNode("//xls:Pan[@direction='E']").getAttribute("toLon")); if (isNaN(g.lat) || isNaN(g.lon)) { throw new Exception("Exception: likely no toLon or toLat attributes in Pan") } } catch (cc) { g = new Position(cd.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data) } bf = new Position(cd.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data); var b8 = cd.selectSingleNode("//xls:Pan[@direction='N']"); var cb = cd.selectSingleNode("//xls:Pan[@direction='E']"); i.x = parseFloat(cb.getAttribute("numTiles")) * C; i.y = -(parseFloat(b8.getAttribute("numTiles")) * C); var b7 = cd.selectSingleNode("//xls:Radius"); bN.setRadius((parseFloat(Sarissa.getText(b7)) / 1000) * G); var ca; try { ca = parseInt(cd.selectSingleNode("//xls:GridLayer[@name='deCarta']").getAttribute("maxImageHostAliases"), 10) } catch (cc) { ca = 0 } var cf = cd.selectNodes("//xls:URL"); b1(cf, ca); ba = false; bw(); if (bF.zoomend) { bF.zoomend() } } function b1(b7, cb) { if (a) { a.calculate() } bh(); cb = cb || 0; var ca = new deCarta.MapLayerReferenceUrl(Sarissa.getText(b7[1])); ca.createGlobeXplorerUrl(); var b8 = new deCarta.MapLayerReferenceUrl(Sarissa.getText(b7[0]), cb); b8.createDeCartaTransparentUrl(); b8.setParameter("config", R.transparentConfiguration); var b9 = new deCarta.MapLayerReferenceUrl(Sarissa.getText(b7[0]), cb); b9.createDeCartaUrl(); b9.setParameter("config", R.configuration); bZ[0].populate(ca); bZ[1].populate(b8); bZ[2].populate(b9); az -= i.x; aw -= i.y; aE() } function bv() { if (!m) { aj(); return } else { if (m && bL) { bL = false; A(); return } else { if (m && !bL) { return } else { throw new Exception("populateTiles fell through to default.") } } } } function aj() { var b7 = "decarta-mapviewport"; if (!aK.mapDiv.className) { aK.mapDiv.className = b7 } else { aK.mapDiv.className += " " + b7 } Utilities.setUnselectable(aK.mapDiv); window.onmouseup = ay; aK.mapDiv.oncontextmenu = bx; aK.mapDiv.onmousedown = am; aK.mapDiv.onmouseout = a8; aK.mapDiv.onmouseup = Q; aK.mapDiv.ondblclick = Q; aK.mapDiv.onclick = Q; m = document.createElement("div"); var b8 = "decarta-tiles"; m.id = b8; m.className = b8; m.style.top = 0 + T; m.style.left = 0 + T; Utilities.setUnselectable(m); aK.mapDiv.appendChild(m); if (!bN) { bN = new ZoomController(); aK.addMapControl(bN); bN.hide() } if (!aH) { a6() } m.appendChild(aH.bubble); ar() } function ar() { if (bZ[0] || bZ[1] || bZ[2]) { throw new Exception("buildDefaultTileGrid called on existing tile grid") } var b8; var b9 = parseInt(aK.mapDiv.style.height); var b7 = parseInt(aK.mapDiv.style.width); ao = Math.ceil(b9 / C) + d; if (ao % 2 == 0) { ao++ } G = Math.ceil(b7 / C) + d; if (G % 2 == 0) { G++ } aS = -((G * C) - b7) / 2; aQ = -((ao * C) - b9) / 2; bZ[0] = new deCarta.MapLayer(G, ao, aS, aQ, C, "decarta-satellite", 1); bZ[1] = new deCarta.MapLayer(G, ao, aS, aQ, C, "decarta-transparent", 2); bZ[2] = new deCarta.MapLayer(G, ao, aS, aQ, C, "decarta-street", 3); bZ[2].show(); for (b8 = 0; b8 < bZ.length; b8++) { bZ[b8].appendTiles(m) } a4 = new deCarta.ZoomLayer(G, ao, C); a4.appendTiles(m) } function A() { if (!m) { throw new Exception("resizeMap called without an existing map.") } var b7; for (b7 = 0; b7 < bZ.length; b7++) { bZ[b7].hide(); bZ[b7].destroy(); bZ[b7] = null } bZ = []; m.style.top = 0 + T; m.style.left = 0 + T; ar(); c = 0; b = 0; ah = 0; ag = 0; bj = false; az = 0; aw = 0 } function bh() { bb = c; a1 = b; for (var b8 = 0; b8 < bZ.length; b8++) { bZ[b8].reset(-c - i.x, -b - i.y) } var b7 = []; if (R.mapType == GLOBALS.STREET) { b7.push(bZ[2]) } else { if (R.mapType == GLOBALS.HYBRID) { b7.push(bZ[0]); b7.push(bZ[1]) } else { if (R.mapType == GLOBALS.SATELLITE) { b7.push(bZ[0]) } else { throw new Exception("Map.reset: encountered unexpected _xmlRecFac.mapType of " + R.mapType) } } } a0(b7); ah = 0; ag = 0; bj = false; az = 0; aw = 0 } function a0(cf) { var cb = cf; var b9 = cb.length; var cc; if (!ba || !a5) { for (cc = 0; cc < b9; cc++) { cb[cc].show() } return } for (cc = 0; cc < b9; cc++) { cb[cc].delayedLoading = true } var b7 = 250; var cd = G * ao; var ce = cd * 0.8; var b8 = 6; setTimeout(ca, b7); function ca() { if (cb[0].numTilesLoaded >= ce || b8 <= 0) { for (cc = 0; cc < b9; cc++) { cb[cc].show(); cb[cc].delayedLoading = false } a4.hide(); return } b8--; setTimeout(ca, b7) } } function bJ() { var b7; var b8 = bZ.length; if (az <= -aV) { az = az + aV; for (b7 = 0; b7 < b8; b7++) { bZ[b7].rotateTiles(0, 1) } aE() } else { if (az >= aV) { az = az - aV; for (b7 = 0; b7 < b8; b7++) { bZ[b7].rotateTiles(0, -1) } aE() } } if (aw <= -aV) { aw = aw + aV; for (b7 = 0; b7 < b8; b7++) { bZ[b7].rotateTiles(-1, 0) } aE() } else { if (aw >= aV) { aw = aw - aV; for (b7 = 0; b7 < b8; b7++) { bZ[b7].rotateTiles(1, 0) } aE() } } } function aa(b7, b8) { m.style.left = b7 + T; m.style.top = b8 + T } function aT(b7, b8) { if (N) { return } if (b7 > 1) { m.style.left = parseInt(m.style.left) + 1 + T } else { if (b7 < -1) { m.style.left = parseInt(m.style.left) - 1 + T } } if (b8 > 1) { m.style.top = parseInt(m.style.top) + 1 + T } else { if (b8 < -1) { m.style.top = parseInt(m.style.top) - 1 + T } } N = true; y(b7, b8, true) } function y(b7, cb, ca) { if (ca) { bR = b7; bQ = cb } var b9 = Math.round(Math.abs(bR) * 0.3); var b8 = Math.round(Math.abs(bQ) * 0.3); if (b9 > 0 || b8 > 0) { if (bR < 0) { bR += b9; az -= b9; c -= b9 } else { if (bR > 0) { bR -= b9; az += b9; c += b9 } } if (bQ < 0) { bQ += b8; aw -= b8; b -= b8 } else { if (bQ > 0) { bQ -= b8; aw += b8; b += b8 } } aa(c, b); if (Math.abs(az) > aV || Math.abs(aw) > aV) { bJ() } setTimeout(y, 1) } else { if (bF.moveend) { bF.moveend() } if (bn.panToPosition) { bn.panToPosition(aK.getCenterPosition()); bn.panToPosition = undefined } if (a) { a.calculate() } if (af && aX) { aK.getZoomController().zoomInOneLevel() } N = false; af = false; aE() } } function bG() { if (!aK.getTileDiv()) { return null } var b7 = document.getElementById("canvas"); if (b7) { b7.style.position = "relative"; b7.style.zIndex = 100; aK.getTileDiv().appendChild(b7) } else { b7 = document.getElementsByTagName("body")[0].appendChild(document.createElement("canvas")); b7.id = "canvas"; if (typeof G_vmlCanvasManager != "undefined") { b7 = G_vmlCanvasManager.initElement(b7) } b7.style.position = "relative"; b7.style.zIndex = 100; aK.getTileDiv().appendChild(b7) } return b7 } function bT() { if (bD == "server") { return } var b8 = bG(); var b7 = b8.getContext("2d"); b7.clearRect(0, 0, b8.width, b8.height) } function aE(cp) { cp = cp || false; if (bD == "server" || !aK.getTileDiv()) { return } if (R.overlays.length == 0 && !cp) { return } if (N) { return } var b9 = bG(); var cA, cz; var cB = aK.getGridSize().split(" "); var cC = parseInt(cB[1]) * C; var cu = parseInt(cB[0]) * C; b9.width = cC; b9.height = cu; var cG = aK.mapDiv; var b8 = -(cC - parseInt(cG.style.width)) / 2; var b7 = -(cu - parseInt(cG.style.height)) / 2; var ct = m; b9.style.left = b8 - parseInt(ct.style.left) + T; b9.style.top = b7 - parseInt(ct.style.top) + T; var ce = b9.getContext("2d"); ce.lineCap = "round"; ce.lineJoin = "round"; var cr = bN.getZoomLevel(); var cb = Utilities.radsPerPixelAtZoomLevel(C, cr); var cd = aK.getBoundingBox(); var ca = new Position(cd.maxPosition.lat + " " + cd.minPosition.lon); var cf = Math.round(Utilities.lat2pix(ca.lat, cb)); var cg = Math.round(Utilities.lon2pix(ca.lon, cb)); var cH = R.overlays; for (var co = 0; co < cH.length; co++) { var cc = cH[co]; if (!cc.isVisible) { continue } ce.lineWidth = cc.getBorderWidth(); ce.fillStyle = "rgba(" + cc.fillColorRed + "," + cc.fillColorGreen + "," + cc.fillColorBlue + "," + cc.fillOpacityFloat + ")"; ce.strokeStyle = "rgba(" + cc.borderColorRed + "," + cc.borderColorGreen + "," + cc.borderColorBlue + "," + cc.strokeOpacityFloat + ")"; var ci = []; ce.beginPath(); if (cc.type == "polygon" || cc.type == "line") { var cF = []; var cE = []; if (cc.type == "line") { ce.lineWidth = cc.getWidth(); if (cc.clip || b5) { ci = cc.getMercPixelsClipped(cr, C, cd) } else { ci[0] = cc.getMercPixels(cr, C) } } else { if (cc.type == "polygon") { ci[0] = cc.getMercPixels(cr, C) } else { throw new Exception("Map inner function draw: fell through to unacceptable situation with line/polygon client side rendering.") } } var ch = ci.length; for (cA = 0; cA < ch; cA++) { var cn = ci[cA].length; cF[cA] = []; cE[cA] = []; for (cz = 0; cz < cn; cz++) { var cx = ci[cA][cz]; cF[cA][cz] = parseInt(cg - cx.x); cE[cA][cz] = parseInt(cf - cx.y); if (cz == 0) { ce.moveTo((cF[cA][cz] * -1), (cE[cA][cz])) } else { ce.lineTo((cF[cA][cz] * -1), (cE[cA][cz])) } } } ce.stroke(); if (cc.type == "line") { continue } if (!ad) { ce.fill() } else { ce.beginPath(); var cD = cF.length; for (cA = 0; cA < cD; cA++) { var cw = cF[cA].length; for (cz = 0; cz < cw; cz++) { if (cz == 0) { ce.moveTo((cF[cA][cz] * -1), (cE[cA][cz])) } else { ce.lineTo((cF[cA][cz] * -1), (cE[cA][cz])) } } } ce.closePath(); ce.fill() } } else { if (cc.type == "circle") { var cm = cc.getPosition(); var cj = Math.round(Utilities.lat2pix(cm.lat, cb)); var cl = Math.round(Utilities.lon2pix(cm.lon, cb)); var cs = parseInt(cg - cl); var cq = parseInt(cf - cj); var cv = cc.getRadius().getDegrees(); var cy = Math.round(Utilities.lat2pix(cm.lat + cv, cb)); var ck = parseInt(cy - cj); ce.arc((cs * -1), cq, Math.abs(ck), 0, Math.PI * 2, true); ce.fill(); if (!ad) { ce.stroke() } else { ce.arc((cs * -1), cq, Math.abs(ck), 0, Math.PI * 2, true); ce.stroke() } } } } } } deCarta.MapLayer = function (a, h, d, g, f, c, b) { this.init(a, h, d, g, f, c, b) }; deCarta.MapLayer.prototype.xTiles = null; deCarta.MapLayer.prototype.yTiles = null; deCarta.MapLayer.prototype.xOffset = 0; deCarta.MapLayer.prototype.yOffset = 0; deCarta.MapLayer.prototype.leftIndex = 0; deCarta.MapLayer.prototype.topIndex = 0; deCarta.MapLayer.prototype.tileSize = null; deCarta.MapLayer.prototype.layerName = "mapLayer"; deCarta.MapLayer.prototype.cssClass = "decarta-maptile"; deCarta.MapLayer.prototype.cssZIndex = 0; deCarta.MapLayer.prototype.tileArray = null; deCarta.MapLayer.prototype.srcOnHidden = null; deCarta.MapLayer.prototype.srcOnError = null; deCarta.MapLayer.prototype.isVisible = false; deCarta.MapLayer.prototype.numTilesLoaded = 0; deCarta.MapLayer.prototype.delayedLoading = false; deCarta.MapLayer.prototype.refUrl = null; deCarta.MapLayer.prototype.init = function (c, h, f, a, j, d, b) { var i, g; this.xTiles = c; this.yTiles = h; this.xOffset = f; this.yOffset = a; this.tileSize = j; if (d) { this.layerName = d } if (b) { this.cssZIndex = b } this.tileArray = []; this.setDefaultSrc(); for (i = 0; i < this.xTiles; i++) { this.tileArray[i] = []; for (g = 0; g < this.yTiles; g++) { this.tileArray[i][g] = this.mapTileFactory(i, g) } } }; deCarta.MapLayer.prototype.setDefaultSrc = function () { if (!Utilities.ie6) { this.srcOnHidden = Credentials.transparentPNG; this.srcOnError = Credentials.transparentPNG } else { this.srcOnHidden = Credentials.transparentGIF; this.srcOnError = Credentials.transparentGIF } }; deCarta.MapLayer.prototype.mapTileOnError = function (b) { var a; if (!b) { a = window.event.srcElement } else { a = b.currentTarget } if (a && a.src && a.srcOnError) { a.src = a.srcOnError } }; deCarta.MapLayer.prototype.mapTileFactory = function (a, f) { var d = Math.floor(this.xTiles / 2); var b = Math.floor(this.yTiles / 2); var c = document.createElement("IMG"); c.ownerLayer = this; c.fromCenterX = a - d; c.fromCenterY = b - f; c.className = this.cssClass; c.altSrc = this.srcOnHidden; c.src = this.srcOnHidden; c.style.zIndex = this.cssZIndex; c.style.height = this.tileSize + "px"; c.style.width = this.tileSize + "px"; c.onerror = this.mapTileOnError; c.style.left = (a * this.tileSize) + this.xOffset + "px"; c.style.top = (f * this.tileSize) + this.yOffset + "px"; Utilities.setUnselectable(c); c.setSrc = deCarta.MapLayer.setSrc; if (Utilities.ie6) { c.loader = document.createElement("img"); c.loader.owner = c; c.loader.loadTile = function () { this.owner.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "')"; this.owner.src = Credentials.transparentGIF; this.owner.ownerLayer.numTilesLoaded++; return true }; c.loader.onload = c.loader.loadTile } else { c.loader = document.createElement("img"); c.loader.owner = c; c.loader.loadTile = function () { this.owner.src = this.src; this.owner.ownerLayer.numTilesLoaded++; return true }; c.loader.onload = c.loader.loadTile } return c }; deCarta.MapLayer.setSrc = function (a) { this.altSrc = a; if (this.ownerLayer.isVisible || this.ownerLayer.delayedLoading) { this.src = this.ownerLayer.srcOnHidden; this.loader.src = a } }; deCarta.MapLayer.prototype.appendTiles = function (b) { for (var a = 0; a < this.xTiles; a++) { for (var c = 0; c < this.yTiles; c++) { b.appendChild(this.tileArray[a][c]) } } }; deCarta.MapLayer.prototype.hide = function () { if (!this.isVisible) { return } var a, b; this.isVisible = false; for (a = 0; a < this.xTiles; a++) { for (b = 0; b < this.yTiles; b++) { this.tileArray[a][b].style.visibility = "hidden" } } }; deCarta.MapLayer.prototype.show = function () { if (this.isVisible) { return } var a, c; this.isVisible = true; for (a = 0; a < this.xTiles; a++) { for (c = 0; c < this.yTiles; c++) { var b = this.tileArray[a][c]; b.loader.src = b.altSrc; b.style.visibility = "visible" } } }; deCarta.MapLayer.prototype.reset = function (g, d) { var a, h; var c, b; var f = "px"; g = g || 0; d = d || 0; this.numTilesLoaded = 0; this.isVisible = false; this.leftIndex = 0; this.topIndex = 0; this.updateFromCenterVals(); for (a = 0; a < this.xTiles; a++) { c = this.xOffset + g + (a * this.tileSize); for (h = 0; h < this.yTiles; h++) { this.tileArray[a][h].src = this.srcOnHidden; this.tileArray[a][h].style.visibility = "hidden"; b = this.yOffset + d + (h * this.tileSize); this.tileArray[a][h].style.left = c + f; this.tileArray[a][h].style.top = b + f } } }; deCarta.MapLayer.prototype.refresh = function () { var a, c; for (a = 0; a < this.xTiles; a++) { for (c = 0; c < this.yTiles; c++) { var b = this.tileArray[a][c]; b.setSrc(this.refUrl.getRelSrc(b.fromCenterY, b.fromCenterX)) } } }; deCarta.MapLayer.prototype.rotateTiles = function (j, g) { var k, h; var i = this.yTiles; var d = this.xTiles; var m = this.tileSize; var b; var f; var l = 0; var a; var c; if (j) { if (j > 0) { this.topIndex -= 1; if (this.topIndex < 0) { this.topIndex = i - 1 } f = this.topIndex; l -= i * m; a = 1 } else { f = this.topIndex; this.topIndex += 1; if (this.topIndex >= i) { this.topIndex = 0 } l += i * m; a = -1 } this.updateFromCenterVals(); this.refUrl.pan(a, 0); for (k = 0; k < d; k++) { b = this.tileArray[k][f]; c = parseInt(b.style.top) + l; b.style.top = (c) + "px"; b.setSrc(this.refUrl.getRelSrc(b.fromCenterY, b.fromCenterX)) } return } if (g) { if (g > 0) { f = this.leftIndex; this.leftIndex += 1; if (this.leftIndex >= d) { this.leftIndex = 0 } l += d * m; a = 1 } else { this.leftIndex -= 1; if (this.leftIndex < 0) { this.leftIndex = d - 1 } f = this.leftIndex; l -= d * m; a = -1 } this.updateFromCenterVals(); this.refUrl.pan(0, a); for (h = 0; h < i; h++) { b = this.tileArray[f][h]; c = parseInt(b.style.left) + l; b.style.left = (c) + "px"; b.setSrc(this.refUrl.getRelSrc(b.fromCenterY, b.fromCenterX)) } } }; deCarta.MapLayer.prototype.zoom = function (d, c, b, a) { if (!this.isVisible) { return } c.zoom(d, this, b, a) }; deCarta.MapLayer.prototype.populate = function (f) { this.refUrl = f; var j, g, b; var d = []; var c = 0; var k; for (j = 0; j < this.xTiles; j++) { for (g = 0; g < this.yTiles; g++) { d[c] = this.tileArray[j][g]; c++ } } k = d.length; h(d); for (b = 0; b < k; b++) { d[b].setSrc(f.getRelSrc(d[b].fromCenterY, d[b].fromCenterX)) } function h(m) { for (var l = 1; l < m.length; l++) { for (var i = 0; i < m.length - 1; i++) { if ((Math.abs(m[i].fromCenterX) + Math.abs(m[i].fromCenterY)) > (Math.abs(m[i + 1].fromCenterX) + Math.abs(m[i + 1].fromCenterY))) { a(m, i, i + 1) } } } } function a(l, n, i) { var m; m = l[n]; l[n] = l[i]; l[i] = m } }; deCarta.MapLayer.prototype.updateFromCenterVals = function () { var j = this.xTiles; var m = this.yTiles; var b = Math.floor(j / 2); var g = -b; var a = Math.floor(m / 2); var f = -a; var p = this.leftIndex; var c = this.topIndex; var i, h; if (p > b) { i = p - b - 1 } else { i = p + b } if (c > a) { h = c - a - 1 } else { h = c + a } var d = this.tileArray; var o, l; for (o = 0; o < j; o++) { for (l = 0; l < m; l++) { var k = d[o][l]; var q = o - i; if (q > b) { k.fromCenterX = q - j } else { if (q < g) { k.fromCenterX = q + j } else { k.fromCenterX = q } } var n = h - l; if (n > a) { k.fromCenterY = n - m } else { if (n < f) { k.fromCenterY = n + m } else { k.fromCenterY = n } } } } }; deCarta.MapLayer.prototype.destroy = function () { var a, b; for (a = 0; a < this.xTiles; a++) { for (b = 0; b < this.yTiles; b++) { Utilities.purge(this.tileArray[a][b]) } } }; deCarta.ZoomLayer = function (a, c, b) { this.init(a, c, b) }; deCarta.ZoomLayer.prototype.framesTotal = 3; deCarta.ZoomLayer.prototype.msPerFrame = 100; deCarta.ZoomLayer.prototype.xTiles = null; deCarta.ZoomLayer.prototype.yTiles = null; deCarta.ZoomLayer.prototype.tileSize = null; deCarta.ZoomLayer.prototype.layerName = "zoomLayer"; deCarta.ZoomLayer.prototype.cssClass = "decarta-maptile"; deCarta.ZoomLayer.prototype.cssZIndex = 0; deCarta.ZoomLayer.prototype.tileArray = null; deCarta.ZoomLayer.prototype.srcOnHidden = null; deCarta.ZoomLayer.prototype.srcOnError = null; deCarta.ZoomLayer.prototype.isVisible = false; deCarta.ZoomLayer.prototype.init = function (b, f, c) { var a, d; this.xTiles = b; this.yTiles = f; this.tileSize = c; this.tileArray = []; this.setDefaultSrc(); for (a = 0; a < this.xTiles; a++) { this.tileArray[a] = []; for (d = 0; d < this.yTiles; d++) { this.tileArray[a][d] = this.mapTileFactory(a, d) } } }; deCarta.ZoomLayer.prototype.setDefaultSrc = function () { if (!Utilities.ie6) { this.srcOnHidden = Credentials.transparentPNG; this.srcOnError = Credentials.transparentPNG } else { this.srcOnHidden = Credentials.transparentGIF; this.srcOnError = Credentials.transparentGIF } }; deCarta.ZoomLayer.prototype.mapTileOnError = function (b) { var a; if (!b) { a = window.event.srcElement } else { a = b.currentTarget } if (a && a.src && a.srcOnError) { a.src = a.srcOnError } }; deCarta.ZoomLayer.prototype.mapTileFactory = function (a, g) { var b = "px"; var f = Math.floor(this.xTiles / 2); var c = Math.floor(this.yTiles / 2); var d = document.createElement("IMG"); d.fromCenterX = a - f; d.fromCenterY = c - g; d.className = this.cssClass; d.altSrc = this.srcOnHidden; d.src = this.srcOnHidden; d.style.zIndex = this.cssZIndex; d.style.height = this.tileSize + b; d.style.width = this.tileSize + b; d.onerror = this.mapTileOnError; Utilities.setUnselectable(d); d.setSrc = deCarta.ZoomLayer.setSrc; return d }; deCarta.ZoomLayer.setSrc = function (a) { this.src = a }; deCarta.ZoomLayer.prototype.appendTiles = function (b) { for (var a = 0; a < this.xTiles; a++) { for (var c = 0; c < this.yTiles; c++) { b.appendChild(this.tileArray[a][c]) } } }; deCarta.ZoomLayer.prototype.hide = function () { if (!this.isVisible) { return } var a, b; this.isVisible = false; for (a = 0; a < this.xTiles; a++) { for (b = 0; b < this.yTiles; b++) { this.tileArray[a][b].setSrc(this.srcOnHidden); this.tileArray[a][b].style.visibility = "hidden" } } }; deCarta.ZoomLayer.prototype.show = function () { if (this.isVisible) { return } var a, b; this.isVisible = true; for (a = 0; a < this.xTiles; a++) { for (b = 0; b < this.yTiles; b++) { this.tileArray[a][b].style.visibility = "visible" } } }; deCarta.ZoomLayer.prototype.transferSrcFromMapLayer = function (c) { var a, g, f, d; var b = "px"; for (a = 0; a < c.xTiles; a++) { f = a + c.leftIndex; if (f >= c.xTiles) { f -= c.xTiles } for (g = 0; g < c.yTiles; g++) { d = g + c.topIndex; if (d >= c.yTiles) { d -= c.yTiles } this.tileArray[a][g].setSrc(this.srcOnHidden); this.tileArray[a][g].style.top = c.tileArray[f][d].style.top; this.tileArray[a][g].style.left = c.tileArray[f][d].style.left; this.tileArray[a][g].style.height = c.tileSize + b; this.tileArray[a][g].style.width = c.tileSize + b; this.tileArray[a][g].setSrc(c.tileArray[f][d].src) } } }; deCarta.ZoomLayer.prototype.zoom = function (l, c, s, r) { var t = this; t.show(); t.transferSrcFromMapLayer(c); c.hide(); var g = s; var f = r; var h = Math.pow(2, l); var b = l > 0 ? +1 : -1; var o = this.framesTotal; var m = this.msPerFrame; var j = Math.floor((h * t.tileSize - t.tileSize) / (o)); var d = -1 * Math.floor(t.xTiles / 2); var p = d; var i = -1 * Math.floor(t.yTiles / 2); var a = i; var k; var n; if (l > 0) { k = Math.floor(h * b * g / (2 * o)); n = Math.floor(h * b * f / (2 * o)) } else { k = Math.floor(h * b * g / (o)); n = Math.floor(h * b * f / (o)) } q(); function q() { var u, z; var w = "px"; for (u = 0; u < t.xTiles; u++) { for (z = 0; z < t.yTiles; z++) { var v = t.tileArray[u][z]; v.style.width = parseInt(v.style.width) + j + w; v.style.height = parseInt(v.style.height) + j + w; v.style.left = parseInt(v.style.left) - j / 2 + d * j + k + w; v.style.top = parseInt(v.style.top) - j / 2 + i * j + n + w; i += 1 } d += 1; i = a } d = p; o -= 1; if (o) { setTimeout(q, m) } } }; deCarta.ZoomLayer.prototype.destroy = function () { var a, b; for (a = 0; a < this.xTiles; a++) { for (b = 0; b < this.yTiles; b++) { Utilities.purge(this.tileArray[a][b]) } } }; deCarta.MapLayerReferenceUrl = function (a, b) { this.init(a, b) }; deCarta.MapLayerReferenceUrl.prototype.baseUrl = null; deCarta.MapLayerReferenceUrl.prototype.imageHosts = null; deCarta.MapLayerReferenceUrl.prototype.numImageHosts = null; deCarta.MapLayerReferenceUrl.prototype.nextImageHost = null; deCarta.MapLayerReferenceUrl.prototype.staticProps = null; deCarta.MapLayerReferenceUrl.prototype.dynamicProps = null; deCarta.MapLayerReferenceUrl.prototype.urlregx = new RegExp("\\amp;", "g"); deCarta.MapLayerReferenceUrl.prototype.init = function (a, b) { this.baseUrl = a; this.dynamicProps = {}; this.dynamicProps.northing = 0; this.dynamicProps.easting = 0; this.dynamicProps.format = ""; this.dynamicProps.config = ""; this.imageHosts = []; this.nextImageHost = 0; if (b) { this.numImageHosts = b + 1 } else { this.numImageHosts = 1 } }; deCarta.MapLayerReferenceUrl.prototype.getFullHostName = function () { var d = this.baseUrl.indexOf("?"); var c = this.baseUrl.substr(0, d + 1); var b = /^[\S]*\/\/([\S]+)/; var a = c.replace(b, "$1"); var f = a.split("/")[0]; return f }; deCarta.MapLayerReferenceUrl.prototype.getProtocol = function () { var c = this.baseUrl.indexOf("?"); var b = this.baseUrl.substr(0, c + 1); var a = /^([a-zA-Z:]*\/\/)([\s\S]*)/; var d = b.replace(a, "$1"); return d }; deCarta.MapLayerReferenceUrl.prototype.generateHostAliases = function () { var d; this.imageHosts = []; var j = this.baseUrl.indexOf("?"); var k = this.baseUrl.substr(0, j + 1); if (this.numImageHosts == 1) { this.imageHosts[0] = k + this.staticProps; return } else { var g = k.split("."); if (g.length > 1) { var m = g[0]; var f = g.slice(1).join("."); m = m.replace(/-[0-9]+$/, ""); this.imageHosts[0] = m + "." + f + this.staticProps; for (d = 1; d < this.numImageHosts; d++) { if (d < 10) { this.imageHosts[d] = m + "-0" + d + "." + f + this.staticProps; continue } else { this.imageHosts[d] = m + "-" + d + "." + f + this.staticProps } } } else { var l = this.getProtocol(); var a = this.getFullHostName(); var b = ""; if (a.split(":").length > 1) { b = ":" + a.split(":")[1]; a = a.split(":")[0] } a = a.replace(/-[0-9]+$/, ""); var c = this.baseUrl.indexOf("/", l.length); var h = this.baseUrl.substr(c, j + 1 - c); this.imageHosts[0] = l + a + b + h + this.staticProps; for (d = 1; d < this.numImageHosts; d++) { if (d < 10) { this.imageHosts[d] = l + a + "-0" + d + b + h + this.staticProps; continue } else { this.imageHosts[d] = l + a + "-" + d + b + h + this.staticProps } } } } }; deCarta.MapLayerReferenceUrl.prototype.createGlobeXplorerUrl = function () { var c, d, h; var b = []; var f = this.baseUrl.indexOf("?") + 1; var a = this.baseUrl.slice(f).split("&"); var g = a.length; for (c = 0; c < g; c++) { d = a[c]; if (d.indexOf("N=") == 0) { this.dynamicProps.northing = parseInt(d.split("=")[1], 10); d = null } else { if (d.indexOf("E=") == 0) { this.dynamicProps.easting = parseInt(d.split("=")[1], 10); d = null } else { if (d.indexOf("key=") == 0) { if (d.length > 4) { } else { h = Credentials.dgkey || ""; d = "key=" + h } } } } if (d != null) { b.push(d) } } this.staticProps = b.join("&"); this.generateHostAliases() }; deCarta.MapLayerReferenceUrl.prototype.createDeCartaTransparentUrl = function () { var c, d; var b = []; this.baseUrl = this.baseUrl.replace(this.urlregx, ""); var f = this.baseUrl.indexOf("?") + 1; var a = this.baseUrl.slice(f).split("&"); var g = a.length; for (c = 0; c < g; c++) { d = a[c]; if (d.indexOf("N=") == 0) { this.dynamicProps.northing = parseInt(d.split("=")[1], 10); d = null } else { if (d.indexOf("E=") == 0) { this.dynamicProps.easting = parseInt(d.split("=")[1], 10); d = null } else { if (d.indexOf("FORMAT=") == 0) { this.dynamicProps.format = "PNG"; d = null } else { if (d.indexOf("CONFIG=") == 0) { this.dynamicProps.config = d.split("=")[1]; d = null } } } } if (d != null) { b.push(d) } } this.staticProps = b.join("&"); this.generateHostAliases() }; deCarta.MapLayerReferenceUrl.prototype.createDeCartaUrl = function () { var c, d; var b = []; this.baseUrl = this.baseUrl.replace(this.urlregx, ""); var f = this.baseUrl.indexOf("?") + 1; var a = this.baseUrl.slice(f).split("&"); var g = a.length; for (c = 0; c < g; c++) { d = a[c]; if (d.indexOf("N=") == 0) { this.dynamicProps.northing = parseInt(d.split("=")[1], 10); d = null } else { if (d.indexOf("E=") == 0) { this.dynamicProps.easting = parseInt(d.split("=")[1], 10); d = null } else { if (d.indexOf("FORMAT=") == 0) { this.dynamicProps.format = "PNG"; d = null } else { if (d.indexOf("CONFIG=") == 0) { this.dynamicProps.config = d.split("=")[1]; d = null } } } } if (d != null) { b.push(d) } } this.staticProps = b.join("&"); this.generateHostAliases() }; deCarta.MapLayerReferenceUrl.prototype.getNextImageHost = function () { if (this.numImageHosts == 1) { return this.imageHosts[0] } else { var a = this.imageHosts[this.nextImageHost++]; if (this.nextImageHost >= this.numImageHosts) { this.nextImageHost = 0 } return a } }; deCarta.MapLayerReferenceUrl.prototype.pan = function (a, b) { this.dynamicProps.northing += a; this.dynamicProps.easting += b }; deCarta.MapLayerReferenceUrl.prototype.getRelSrc = function (g, b) { var f = this.getNextImageHost(); var d = this.dynamicProps.northing + g; var i = this.dynamicProps.easting + b; var a = this.dynamicProps.config || ""; if (a) { a = "&CONFIG=" + a } var c = this.dynamicProps.format || ""; if (c) { c = "&FORMAT=" + c } var h = f + c + a + "&N=" + d + "&E=" + i; return h }; deCarta.MapLayerReferenceUrl.prototype.setParameter = function (j, h) { var c; var g = this.dynamicProps; for (c in g) { if (g.hasOwnProperty(c)) { if (c == j) { g[j] = h; return } } } var f = this.staticProps.split("&"); var d = f.length; var b = j + "="; var a = false; for (c = 0; c < d; c++) { if (f[c].indexOf(b) == 0) { f[c] = b + h; a = true; break } } if (!a) { f[d] = b + h } this.staticProps = f.join("&"); this.generateHostAliases() }; deCarta.MapLayerReferenceUrl.prototype.getParameter = function (h) { var b; var g = null; var f = this.dynamicProps; for (b in f) { if (f.hasOwnProperty(b)) { if (b == h) { g = f[h]; return g } } } var d = this.staticProps.split("&"); var c = d.length; var a = h + "="; for (b = 0; b < c; b++) { if (d[b].indexOf(a) == 0) { g = d[b].split("=")[1]; return g } } return null }; deCarta.MapLayerReferenceUrl.prototype.deleteParameter = function (c) { var g; var d = this.dynamicProps; for (g in d) { if (d.hasOwnProperty(g)) { if (g == c) { d[c] = null; return true } } } var h = this.staticProps.split("&"); var k = []; var a; var b = false; var f = h.length; var j = c + "="; for (g = 0; g < f; g++) { a = h[g]; if (a.indexOf(j) == 0) { a = null; b = true } if (a) { k.push(a) } } if (b) { this.staticProps = k.join("&"); this.generateHostAliases(); return true } else { return false } }; function MapTypeController() { this.init() } MapTypeController.prototype.map = null; MapTypeController.prototype.type = "MapTypeController"; MapTypeController.prototype.frame = null; MapTypeController.prototype.cssClass = "decarta-mapTypeController"; MapTypeController.prototype.linkCssClass = "decarta-mapTypeControllerLink"; MapTypeController.prototype.streetLabel = GLOBALS.STREET; MapTypeController.prototype.hybridLabel = GLOBALS.HYBRID; MapTypeController.prototype.satelliteLabel = GLOBALS.SATELLITE; MapTypeController.prototype.init = function () { }; MapTypeController.prototype.build = function () { this.frame = document.createElement("DIV"); this.frame.id = this.cssClass; this.frame.className = this.cssClass; deCarta.IdManager.setTag(this.frame, "ingoreForMapEvents"); var c = document.createElement("span"); c.innerHTML = " | "; deCarta.IdManager.setTag(c, "ingoreForMapEvents"); var a = document.createElement("span"); a.innerHTML = " | "; deCarta.IdManager.setTag(a, "ingoreForMapEvents"); var f = document.createElement("a"); f.className = this.linkCssClass; f.innerHTML = this.streetLabel; f.href = "#"; f.mapType = GLOBALS.STREET; f.owner = this; f.onclick = this.handleClick; deCarta.IdManager.setTag(f, "ingoreForMapEvents"); var b = document.createElement("a"); b.className = this.linkCssClass; b.innerHTML = this.hybridLabel; b.href = "#"; b.mapType = GLOBALS.HYBRID; b.owner = this; b.onclick = this.handleClick; deCarta.IdManager.setTag(b, "ingoreForMapEvents"); var d = document.createElement("a"); d.className = this.linkCssClass; d.innerHTML = this.satelliteLabel; d.href = "#"; d.owner = this; d.mapType = GLOBALS.SATELLITE; d.onclick = this.handleClick; deCarta.IdManager.setTag(d, "ingoreForMapEvents"); this.frame.appendChild(f); this.frame.appendChild(c); this.frame.appendChild(b); this.frame.appendChild(a); this.frame.appendChild(d) }; MapTypeController.prototype.appendThis = function () { if (!this.frame) { this.build() } return this.frame }; MapTypeController.prototype.removeThis = function () { this.map = null; return this.frame }; MapTypeController.prototype.position = function (a) { this.frame.style.top = "5px"; this.frame.style.left = a.width - 207 + "px" }; MapTypeController.prototype.handleClick = function () { this.owner.map.setMapType(this.mapType); return false }; deCarta.Math.MercatorSpherical = function () { var i = null; var d = null; var o = null; var q = null; function a(s) { return (s * Math.PI / 180) } function r(s) { return (s * 180 / Math.PI) } function j(t) { var w = a(t); var u = Math.sin(w); var v = Math.log((1 + u) / (1 - u)) / 2; var s = r(v); return s } function g(t) { var w = a(t); var u = Math.exp(2 * w); var v = Math.asin((u - 1) / (u + 1)); var s = r(v); return s } function m() { if (!i || (!d && d !== 0) || (!o && o !== 0)) { return false } q = o / Math.abs(i.maxPosition.lon - i.minPosition.lon); return true } this.getBoundingBox = function () { return i }; this.setBoundingBox = function (s) { if (s.minPosition == undefined || s.maxPosition == undefined) { throw new Exception("deCarta.Math.MercatorSpherical.setPixelHeight passed invalid boundingBox of: " + s) } else { i = s } }; this.getPixelHeight = function () { return d }; this.setPixelHeight = function (s) { var t = parseInt(s, 10); if (isNaN(t) || (t < 0)) { throw new Exception("deCarta.Math.MercatorSpherical.setPixelHeight passed invalid height of: " + s) } else { d = t } }; this.getPixelWidth = function () { return o }; this.setPixelWidth = function (t) { var s = parseInt(t, 10); if (isNaN(s) || (s < 0)) { throw new Exception("deCarta.Math.MercatorSpherical.setPixelWidth passed invalid width of: " + t) } else { o = s } }; this.positionToPixels = function (v) { if (!m() || !v || (!v.lat && v.lat != 0) || (!v.lon && v.lon != 0)) { throw new Exception("deCarta.Math.MercatorSpherical.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating positionToPixels") } var t = new PixelPoint(0, 0); t.x = q * (i.minPosition.lon - v.lon) * -1; var u = j(i.maxPosition.lat) - j(v.lat); var s = j(i.maxPosition.lat) - j(i.minPosition.lat); t.y = d * u / s; return t }; this.pixelsToPosition = function (t) { if (!m() || !t || (!t.x && t.x != 0) || (!t.y && t.y != 0)) { throw new Exception("deCarta.Math.MercatorSpherical.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating pixelsToPositiion") } var v = new Position(0, 0); v.lon = i.minPosition.lon + (t.x / q); var s = j(i.maxPosition.lat) - j(i.minPosition.lat); var u = (t.y / d) * s; v.lat = g(j(i.maxPosition.lat) - u); return v } }; deCarta.Math.MercatorEllipsoidal = function () { var h = null; var b = null; var n = null; var q = null; function a(s) { return (s * Math.PI / 180) } function r(s) { return (s * 180 / Math.PI) } function i(v) { var u = 0.081819190842; var y = a(v); var s = u * Math.sin(y); var w = Math.log(Math.pow(((1 - s) / (1 + s)), u / 2) * Math.tan((Math.PI / 4) + (y / 2))); var t = r(w); return t } function g(u) { var y = a(u); var w = Math.pow(Math.E, -y); var t = z(); for (var v = 0; v < 6; v++) { t = A(t) } var s = r(t); return s; function z() { return Math.PI / 2 - 2 * Math.atan(w) } function A(F) { var C = 0.0818191908426216; var B = C * Math.sin(F); var E = w * Math.pow((1 - B) / (1 + B), C / 2); var D = (Math.PI / 2) - (2 * Math.atan(E)); return D } } function m() { if (!h || (!b && b !== 0) || (!n && n !== 0)) { return false } q = n / Math.abs(h.maxPosition.lon - h.minPosition.lon); return true } this.getBoundingBox = function () { return h }; this.setBoundingBox = function (s) { if (s.minPosition == undefined || s.maxPosition == undefined) { throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelHeight passed invalid boundingBox of: " + s) } else { h = s } }; this.getPixelHeight = function () { return b }; this.setPixelHeight = function (s) { var t = parseInt(s, 10); if (isNaN(t) || (t < 0)) { throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelHeight passed invalid height of: " + s) } else { b = t } }; this.getPixelWidth = function () { return n }; this.setPixelWidth = function (t) { var s = parseInt(t, 10); if (isNaN(s) || (s < 0)) { throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelWidth passed invalid width of: " + t) } else { n = s } }; this.positionToPixels = function (v) { if (!m() || !v || (!v.lat && v.lat != 0) || (!v.lon && v.lon != 0)) { throw new Exception("deCarta.Math.MercatorEllipsoidal.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating positionToPixels") } var t = new PixelPoint(0, 0); t.x = q * (h.minPosition.lon - v.lon) * -1; var u = i(h.maxPosition.lat) - i(v.lat); var s = i(h.maxPosition.lat) - i(h.minPosition.lat); t.y = b * u / s; return t }; this.pixelsToPosition = function (t) { if (!m() || !t || (!t.x && t.x != 0) || (!t.y && t.y != 0)) { throw new Exception("deCarta.Math.MercatorEllipsoidal.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating pixelsToPositiion") } var v = new Position(0, 0); v.lon = h.minPosition.lon + (t.x / q); var s = i(h.maxPosition.lat) - i(h.minPosition.lat); var u = (t.y / b) * s; v.lat = g(i(h.maxPosition.lat) - u); return v } }; deCarta.Math.greatCircleDist = function (l, k, a) { if (!l || !k) { throw new Exception("Utilities.greatCircleDist: must have valid coords") } var d = Math.PI * l.lat / 180; var h = Math.cos(d); var i = Math.PI * l.lon / 180; var c = Math.PI * k.lat / 180; var g = Math.cos(c); var f = Math.PI * k.lon / 180; var j = Math.abs(Math.abs(i) - Math.abs(f)); var n = 6372795; var b; var m = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(((c - d) / 2)), 2) + (h * g * Math.pow(Math.sin(j / 2), 2)))); b = n * m; if (!a || a.value == "M") { return b } switch (a.value) { case "KM": b /= 1000; break; case "MI": b /= 1609; break; case "FT": b *= 3.28084; break; default: throw new Exception("Utilities.greatCircleDist: unexpected uom value of: " + a.value); break } return b }; deCarta.Math.pointInPolygon = function (h, g) { function n(q, s, r) { if (s.lat < r.lat) { if (q) { return false } else { return true } } else { if (!q) { return false } else { return true } } } function p(r, s, q) { if (s.lon < q.lon) { if (!r) { return false } else { return true } } else { if (r) { return false } else { return true } } } var b; var i; var a = 0; var o = 0; if (g.lat < h[0].lat) { i = true } else { i = false } if (g.lon < h[0].lon) { b = false } else { b = true } for (var l in h) { var f = p(b, g, h[l]); var k = n(i, g, h[l]); if (f && k) { var c = h[l].lat - h[l - 1].lat; var d = h[l].lon - h[l - 1].lon; var j = c / d; c = g.lat - h[l - 1].lat; d = g.lon - h[l - 1].lon; var m = c / d; if ((b && !i) || (!b && !i)) { if (m > j) { o++ } else { a++ } } if ((!b && i) || (b && i)) { if (m < j) { o++ } else { a++ } } b = !b; i = !i } else { if (f) { b = !b } if (k) { i = !i; if (b) { a++ } else { o++ } } } } if (a % 2 == 0) { return false } else { return true } }; deCarta.Math.headingFromPositions = function (c, a) { if (!c || (!c.lat && c.lat != 0) || (!c.lon && c.lon != 0) || !a || (!a.lat && a.lat != 0) || (!a.lon && a.lon != 0)) { throw new Exception("deCarta.Math.headingFromPosition: bad arguments.") } var f = Math.PI / 180; var h = c.lat * f; var d = c.lon * f; var g = a.lat * f; var b = a.lon * f; var i = Math.atan2(Math.sin(b - d) * Math.cos(g), Math.cos(h) * Math.sin(g) - Math.sin(h) * Math.cos(g) * Math.cos(b - d)); return i / f }; function OpenSearchQuery() { this.url = null; this.callback = null; this.params = null } OpenSearchQuery.prototype.setCallback = function (a) { this.callback = a }; OpenSearchQuery.prototype.setURL = function (a) { this.url = a }; OpenSearchQuery.prototype.setParams = function (b) { this.params = "?"; for (var a in b) { if (b.hasOwnProperty(a)) { this.params += a + "=" + b[a] + "&" } } }; OpenSearchQuery.prototype.send = function () {
    var b = this; if (!document.all) {
        try {
            //netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")
        } catch (c) { } 
    } var a = new XMLHttpRequest(); a.open("POST", this.url + this.params, true); a.onreadystatechange = function () { if (a.readyState == 4) { b.callback(a.responseText) } }; a.send(null)
}; function POI(d, a, b, c, f) { this.name = d; this.position = a; this.address = b; this.phoneNumber = c; this.properties = f || {}; this.toString = function () { return this.name + " " + this.position + " " + this.address + " " + this.phoneNumber } } function POIQuery() { this.xmlRecFac = new XMLRequestFactory(); var d = []; var b = this; this.authenticate = function (h, g) { if (!h || !g || h == "" || g == "") { throw new Exception("Error authenticating POIQuery, invalid parameters."); return false } Credentials.clientName = h; Credentials.clientPassword = g; this.xmlRecFac.clientName = h; this.xmlRecFac.clientPassword = g }; this.query = function (h, j) { var i = Utilities.getRequestId(); if (typeof j == "function") { d[i] = j } else { throw new Exception("POIQuery.query: callBack must be a function, arg was: " + j) } var g = this.xmlRecFac.createPOIRequestDOM(h, i); JSRequest.send(g, b.queryCallback) }; this.queryCallback = function (z) { var n = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(z), "text/xml"); if (document.all) { n.setProperty("SelectionLanguage", "XPath"); n.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'") } var j = []; var r; var m = n.selectNodes("//xls:Error"); if (m.length > 0) { r = Sarissa.getText(n.selectSingleNode("//xls:Response/@requestID")); if (typeof d[r] == "function") { d[r](null); d[r] = undefined } } else { if (n.selectNodes("//xls:POI").length == 0) { r = Sarissa.getText(n.selectSingleNode("//xls:Response/@requestID")); d[r](j); d[r] = undefined } else { var u = n.selectNodes("//xls:POIContext"); for (var w = 0; w < u.length; w++) { var t = Sarissa.serialize((u[w])); var o = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(t), "text/xml"); if (document.all) { o.setProperty("SelectionLanguage", "XPath"); o.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'") } var v = "xls:"; if (navigator.userAgent.toLowerCase().indexOf("safari") != -1 && navigator.userAgent.toLowerCase().indexOf("3.1") == -1) { v = "" } try { var A = Sarissa.getText(o.selectSingleNode("//" + v + "POI/@POIName")); var l = Sarissa.getText(o.selectSingleNode("//" + v + "POI/@phoneNumber")) } catch (y) { } var k = t.substring(t.indexOf("<gml:pos>") + "<gml:pos>".length, t.indexOf("</gml:pos>")); var g = {}; var h; if (o.selectSingleNode("//" + v + "freeFormAddress")) { h = new FreeFormAddress(Sarissa.getText(o.selectSingleNode("//" + v + "freeFormAddress"))) } else { h = new Address(); try { h.buildingNumber = Sarissa.getText(o.selectSingleNode("//" + v + "Building/@number")) } catch (y) { } try { h.street = Sarissa.getText(o.selectSingleNode("//" + v + "Street")) } catch (y) { } try { h.countrySubdivision = Sarissa.getText(o.selectSingleNode("//" + v + "Place[@type='CountrySubdivision']")) } catch (y) { } try { h.countrySecondarySubdivision = Sarissa.getText(o.selectSingleNode("//" + v + "Place[@type='CountrySecondarySubdivision']")) } catch (y) { } try { h.municipality = Sarissa.getText(o.selectSingleNode("//" + v + "Place[@type='Municipality']")) } catch (y) { } try { h.postalCode = Sarissa.getText(o.selectSingleNode("//" + v + "PostalCode")) } catch (y) { } } try { var s = o.selectNodes("//" + v + "POIInfo"); for (var q = 0; q < s.length; q++) { g[s[q].getAttribute("name")] = s[q].getAttribute("value") } } catch (y) { } j.push(new POI(A, new Position(k), h, l, g)) } r = Sarissa.getText(n.selectSingleNode("//xls:Response/@requestID")); d[r](j); d[r] = undefined } } } } function Pin(F, k, I, n) { if (!F) { throw new Exception("Error instantiating Pin, must at least provide a Position."); return false } var i = this; var L = new Array(); var A = 170; var J = null; var u = null; var r = false; var Z = false; var ac = null; var d = null; var c = null; this.type = "pin"; this.position = null; if (F && F.clone) { this.position = F.clone() } this.icon = n || new Icon(Credentials.imgPath + "greenDot.png", 12, 12, 24, 24); this.map = null; this.isVisible = true; this.id = ""; this.pinImg = null; this.pinImg = document.createElement("img"); var P = "decarta-pin"; this.pinImg.className = P; this.pinImg.style.position = "absolute"; this.pinImg.id = F.toString(); this.pinImg.src = this.icon.src; this.pinImg.style.width = parseInt(this.icon.width) + "px"; this.pinImg.style.height = parseInt(this.icon.height) + "px"; Pin.zIndexCounter++; this.pinImg.style.zIndex = Pin.zIndexCounter; this.pinImg.style.cursor = "pointer"; this.pinImg.style.display = "block"; this.pinImg.msg = k || ""; if (Utilities.ie6 && this.pinImg.src.match(new RegExp("\\bpng\\b", "g"))) { Utilities.fixPng(this.pinImg) } deCarta.IdManager.setTag(this.pinImg, "ingoreForMapEvents"); this.pinTxt = null; this.pinTxt = document.createElement("DIV"); this.pinTxt.id = "decarta-textoverlay"; this.pinTxt.innerHTML = this.icon.overlay.text; this.pinTxt.className = this.icon.overlay.className; this.pinTxt.style.position = "absolute"; this.pinTxt.style.color = this.icon.overlay.color; this.pinTxt.style.fontSize = this.icon.overlay.size; this.pinTxt.style.fontFamily = this.icon.overlay.fontFamily; Pin.zIndexCounter++; this.pinTxt.style.zIndex = Pin.zIndexCounter; this.pinTxt.style.cursor = "pointer"; deCarta.IdManager.setTag(this.pinTxt, "ingoreForMapEvents"); this.getZIndex = function () { return (this.pinImg.style.zIndex) }; this.setZIndex = function (af) { var ae = parseInt(af, 10); if (!isNaN(ae)) { this.pinImg.style.zIndex = ae } else { this.pinImg.style.zIndex = 0 } }; this.setId = function (ae) { this.id = ae }; this.getId = function () { return this.id }; this.setCursorStyle = function (ae) { this.pinImg.style.cursor = ae; this.pinTxt.style.cursor = ae }; this.getCursorStyle = function () { return this.pinImg.style.cursor }; this.setIcon = function (ae) { i.pinImg.src = ae.src; if (i.icon.anchorY == ae.anchorY && i.icon.anchorX == ae.anchorX && ae._previousY && ae._previousX) { i.pinImg.style.top = (parseInt(i.pinImg.style.top) + ae._previousY - ae.anchorY) + "px"; i.pinImg.style.left = (parseInt(i.pinImg.style.left) + ae._previousX - ae.anchorX) + "px" } else { i.pinImg.style.top = (parseInt(i.pinImg.style.top) + i.icon.anchorY - ae.anchorY) + "px"; i.pinImg.style.left = (parseInt(i.pinImg.style.left) + i.icon.anchorX - ae.anchorX) + "px" } i.pinImg.style.width = ae.width + "px"; i.pinImg.style.height = ae.height + "px"; i.icon = ae; if (ae.overlay.text != "") { i.pinTxt.innerHTML = this.icon.overlay.text; i.pinTxt.style.position = "absolute"; if (ae.overlay.className) { i.pinTxt.style.className = ae.overlay.className } if (ae.overlay.color) { i.pinTxt.style.color = ae.overlay.color } if (ae.overlay.size) { i.pinTxt.style.fontSize = ae.overlay.size } if (ae.overlay.fontFamily) { i.pinTxt.style.fontFamily = ae.overlay.fontFamily } i.pinTxt.style.left = (parseInt(i.pinImg.style.left) + parseInt(i.icon.overlay.anchorX)) + "px"; i.pinTxt.style.top = (parseInt(i.pinImg.style.top) + parseInt(i.icon.overlay.anchorY)) + "px" } else { i.pinTxt.innerHTML = "" } if (Utilities.ie6 && this.pinImg.src.match(new RegExp("\\bpng\\b", "g"))) { var af = this.pinImg.src; this.pinImg.src = Credentials.transparentGIF; this.pinImg.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + af + "',sizingMethod='scale')" } }; this.getIcon = function () { return i.icon }; this.setX = function (ae) { i.pinImg.style.left = (ae - i.icon.anchorX) + "px"; if (i.pinTxt) { i.pinTxt.style.left = (ae - i.icon.anchorX + i.icon.overlay.anchorX) + "px" } }; this.setY = function (ae) { i.pinImg.style.top = (ae - i.icon.anchorY) + "px"; if (i.pinTxt) { i.pinTxt.style.top = (ae - i.icon.anchorY + i.icon.overlay.anchorY) + "px" } }; this.getPosition = function () { return i.position }; this.setPosition = function (af) { if (i.map != null) { var ae = i.map.positionToMapLayerPixel(af); i.setX(ae.x); i.setY(ae.y) } i.position = af }; this.setMessage = function (ae) { i.pinImg.msg = ae; if (i.map && i.pinImg && i.map.getBubble() && (i == i.map.getBubble().associatedPin)) { i.map.getBubble().setContent(ae) } }; this.getMessage = function () { return i.pinImg.msg }; this.hide = function () { i.isVisible = false; i.pinImg.style.display = "none"; i.pinTxt.style.display = "none" }; this.show = function () { i.isVisible = true; i.pinImg.style.display = "block"; i.pinTxt.style.display = "block" }; this.zoomHide = function () { if (!i.isVisible) { return } i.pinImg.style.display = "none"; i.pinTxt.style.display = "none" }; this.zoomShow = function () { if (!i.isVisible) { return } i.pinImg.style.display = "block"; i.pinTxt.style.display = "block" }; this.showInfoWindow = function () { i.map.getBubble().setPosition(parseInt(i.pinImg.style.left), parseInt(i.pinImg.style.top)); i.map.getBubble().setContent(i.pinImg.msg); i.map.getBubble().show(i) }; this.hideInfoWindow = function () { i.map.getBubble().hide() }; this.addEventListener = function (af, ag) { var ah = false; for (var ae = 0; ae < L.length; ae++) { if (L[ae] == af) { L[af] = ag; ah = true; break } } if (!ah) { L.push(af); L[af] = ag; if (af == "click" || af == "dblclick" || af == "rightclick") { deCarta.Events.addEvent(i.pinImg, "mousedown", t); deCarta.Events.addEvent(i.pinImg, "mouseup", H); deCarta.Events.addEvent(i.pinTxt, "mousedown", t); deCarta.Events.addEvent(i.pinTxt, "mouseup", H) } else { if (af == "mouseover") { deCarta.Events.addEvent(i.pinImg, "mouseover", X) } else { if (af == "mouseout") { deCarta.Events.addEvent(i.pinImg, "mouseout", ab) } } } } }; this.clearInstanceListeners = function () { for (var ae = 0; ae < L.length; ae++) { L[L[ae]] = null; L[ae] = null } }; this.clearListeners = function (af) { for (var ae = 0; ae < L.length; ae++) { if (L[ae] == af) { L[L[ae]] = null } } L[ae] = null }; function t(ae) { if (ae.button == 2 || ae.which == 3) { r = true; return false } if (L.mousedown) { L.mousedown(i) } return false } function H(ae) { if (r) { m(); return false } if (L.mouseup) { L.mouseup(i) } if (!J) { u = setTimeout(G, A); J = new Date() } else { clearTimeout(u); z() } return false } function G() { T(); if (L.click) { L.click(i) } } function z() { T(); if (L.dblclick) { L.dblclick(i) } } function m() { T(); if (L.rightclick) { L.rightclick(i) } } this.pickup = function () { if (Z) { return } deCarta.Events.addEvent(window.document, "mousemove", g) }; this.drop = function () { if (!Z) { return } W() }; function g(ah) { var ag = ah.clientX; var af = ah.clientY; if (!Z) { Z = true; ac = new PixelPoint(ag, af); var aj = parseInt(i.pinImg.style.left, 10); var ai = parseInt(i.pinImg.style.top, 10); d = new PixelPoint(aj, ai); var ae = parseInt(i.pinTxt.style.left, 10); var am = parseInt(i.pinTxt.style.top, 10); c = new PixelPoint(ae, am); return false } var al = ag - ac.x; var ak = af - ac.y; i.pinImg.style.left = d.x + al + "px"; i.pinImg.style.top = d.y + ak + "px"; i.pinTxt.style.left = c.x + al + "px"; i.pinTxt.style.top = c.y + ak + "px"; return false } function W(ah) { deCarta.Events.removeEvent(window.document, "mousemove", g); var am = parseInt(i.pinImg.style.left, 10) - d.x; var al = -(parseInt(i.pinImg.style.top, 10) - d.y); var an = i.map.getZoomController().getGXConvertedZoomLevel(); var ag = Utilities.radsPerPixelAtZoom(i.map.getTileSize(), an); var ak = Utilities.lon2pix(i.position.lon, ag); var aj = Utilities.lat2pix(i.position.lat, ag); var ae = Utilities.pix2lon((ak + am), ag); var ai = Utilities.pix2lat((aj + al), ag); var af = new Position(ai, ae); i.setPosition(af); Z = false; ac = null; d = null; c = null; return false } function X() { if (L.mouseover) { L.mouseover(i) } } function ab() { if (L.mouseout) { L.mouseout(i) } } function T() { J = null; u = null; r = false } if (I && (I == "onmouseover" || I == "mouseover")) { i.addEventListener("mouseover", i.showInfoWindow); i.addEventListener("mouseout", i.hideInfoWindow) } else { if (I && (I == "onclick" || I == "click")) { i.addEventListener("click", i.showInfoWindow) } } this.destroy = function () { if (i && i.map) { if (i.pinImg) { i.pinImg = i.map.getTileDiv().removeChild(i.pinImg); if (i.pinImg) { Utilities.purge(i.pinImg) } i.pinImg = null } if (i.pinTxt) { i.pinTxt = i.map.getTileDiv().removeChild(i.pinTxt); if (i.pinTxt) { Utilities.purge(i.pinTxt) } i.pinTxt = null } } i = null }; this.toString = function () { return i.position.toString() }; this.equals = function (ae) { if (ae && ae.toString() == this.toString() && ae.pinImg == this.pinImg) { return true } else { return false } }; this.getViewableBoundingBox = function (ai) { var am = Utilities.lat2pix(i.position.lat, ai); var af = Utilities.lon2pix(i.position.lon, ai); var al = am + i.icon.anchorY; var ar = af + parseInt(i.pinImg.style.width) - i.icon.anchorX; var aq = am - parseInt(i.pinImg.style.height) + i.icon.anchorY; var aj = af - i.icon.anchorX; var an = Utilities.pix2lat(al, ai); var ae = Utilities.pix2lon(ar, ai); var ao = Utilities.pix2lat(aq, ai); var ag = Utilities.pix2lon(aj, ai); var ak = new Position(an, ae); var ah = new Position(ao, ag); var ap = new BoundingBox(ah, ak); return ap } } Pin.zIndexCounter = 100; function PixelPoint(a, c) { try { this.x = parseFloat(a); this.y = parseFloat(c); if (isNaN(this.x) || isNaN(this.y)) { throw new Exception("") } } catch (b) { throw new Exception("PixelPoint: bad constructor values for x: " + a + " and y: " + c) } } PixelPoint.prototype.getX = function () { return this.x }; PixelPoint.prototype.roundX = function () { return Math.round(this.x) }; PixelPoint.prototype.setX = function (a) { this.x = parseFloat(a); if (isNaN(this.x)) { throw new Exception("PixelPoint: setX bad argument x: " + a) } }; PixelPoint.prototype.getY = function () { return this.y }; PixelPoint.prototype.roundY = function () { return Math.round(this.y) }; PixelPoint.prototype.setY = function (a) { this.y = parseFloat(a); if (isNaN(this.y)) { throw new Exception("PixelPoint: setY bad argument y: " + a) } }; PixelPoint.prototype.toString = function () { return this.x + " " + this.y }; PixelPoint.prototype.equals = function (a) { if (a && a.toString() == this.toString()) { return true } else { return false } }; function Position(d, a) { this.lat = 0; this.lon = 0; if (arguments.length == 1) { var c = d.split(" "); if (c.length != 2) { throw new Exception("error initializing Position object") } try { this.lat = parseFloat(c[0]); this.lon = parseFloat(c[1]); if (isNaN(this.lat) || isNaN(this.lon)) { throw new Exception() } } catch (b) { throw new Exception("error initializing Position object") } } else { if (arguments.length == 2) { try { this.lat = parseFloat(d); this.lon = parseFloat(a); if (isNaN(this.lat) || isNaN(this.lon)) { throw new Exception() } } catch (b) { throw new Exception("error initializing Position object") } } else { throw new Exception("error initializing Position object") } } if (this.lat > 90) { this.lat = 89.5 } if (this.lat < -90) { this.lat = -89.5 } } Position.prototype.clone = function () { return new Position(this.toString()) }; Position.prototype.getLat = function () { return this.lat }; Position.prototype.getLon = function () { return this.lon }; Position.prototype.setLat = function (a) { this.lat = a }; Position.prototype.setLon = function (a) { this.lon = a }; Position.prototype.getLatLon = function () { return this.lat + " " + this.lon }; Position.prototype.getLatCommaLon = function () { return this.lat + ", " + this.lon }; Position.prototype.equals = function (a) { if (a && a.getLatLon() == this.getLatLon()) { return true } else { return false } }; Position.prototype.toString = function () { return this.lat + " " + this.lon }; function Radius(f, d) { this.distance = f; this.uom = d || new UOM("KM"); var c; if (d == "KM") { c = "K" } else { if (d == "M") { c = "M" } else { if (d == "MI") { c = "R" } else { if (d == "FT") { c = "F" } } } } this.uomdds = c; this.toString = function () { return this.distance + " " + this.uom }; this.getDegrees = function () { if (d == "KM") { return this.distance / 111.111 } else { if (d == "M") { return (this.distance / 1000) / 111.111 } else { if (d == "MI") { return (this.distance * 1.609) / 111.111 } else { if (d == "FT") { return ((this.distance / 3.28) / 1000) / 111.111 } } } } } } function Route() { this.alternates = []; this.TotalTime = ""; this.TotalDistance = ""; this.viaPointSequence = ""; this.RouteInstructions = []; this.RouteGeometry = []; this.routeID = ""; this.boundingBox = null; this.centerPosition = null; this.uom = null } function RouteInstruction() { this.Instruction = ""; this.distance = ""; this.duration = ""; this.position = null; this.tour = "" } function RoutePreference(b, c, a) { this.routePreference = b || "Fastest"; this.uom = c || new UOM("KM"); this.routeQueryType = a || "RTXT"; this.rules = null; this.optimized = false; this.expectedStartTime = null; this.alternateRoutes = 0; this.avoidList = []; this.generalizationFactor = 0; this.generalizationBBox = null; this.logisticsPreference = null } RoutePreference.prototype.setOptimized = function (a) { this.optimized = a }; RoutePreference.prototype.getOptimized = function () { return this.optimized }; RoutePreference.prototype.setRules = function (a) { this.rules = a }; RoutePreference.prototype.getRules = function () { return this.rules }; RoutePreference.prototype.setExpectedStartTime = function (a) { this.expectedStartTime = a }; RoutePreference.prototype.getExpectedStartTime = function () { return this.expectedStartTime }; RoutePreference.prototype.getAvoidList = function () { return this.avoidList }; RoutePreference.prototype.setAvoidList = function (a) { if (typeof a == "string" || a instanceof "String") { switch (a.toLowerCase()) { case "ferry": this.avoidList.push("Ferry"); return; case "toll": this.avoidList.push("Toll"); return; case "tunnels": this.avoidList.push("Tunnels"); return; case "bridges": this.avoidList.push("Bridges"); return; default: break } } throw new Exception("RoutePreference.setAvoidList: invalid argument: feature: " + a) }; RoutePreference.prototype.getGeneralizationFactor = function () { return this.generalizationFactor }; RoutePreference.prototype.setGeneralizationFactor = function (a, c) { try { this.generalizationBBox = Utilities.positionsToBoundingBox(a); this.generalizationFactor = Utilities.generalizationFactor(this.generalizationBBox, c) } catch (b) { throw b } }; RoutePreference.prototype.enableLogistics = function () { this.logisticsPreference = {}; this.logisticsPreference.preferredRoute = ""; this.logisticsPreference.hazmat = ""; this.logisticsPreference.vehicleParameters = ""; this.logisticsPreference.vehicleTypes = ""; this.logisticsPreference.preferredTurn = "" }; function RouteQuery() { this.xmlRecFac = new XMLRequestFactory(); var f = []; var c = this; this.authenticate = function (i, h) { if (!i || !h || i == "" || h == "") { throw new Exception("Error authenticating RouteQuery, invalid parameters."); return false } Credentials.clientName = i; Credentials.clientPassword = h; this.xmlRecFac.clientName = i; this.xmlRecFac.clientPassword = h }; this.query = function (h, j, l) { var k = Utilities.getRequestId(); if (typeof l == "function") { f[k] = l } else { throw new Exception("RouteQuery.query: callBack must be a function, arg was: " + l) } var i = this.xmlRecFac.createRouteGeometryRequestDOM(h, k, j, true); JSRequest.send(i, c.queryCallback) }; this.queryById = function (k, j) { var i = Utilities.getRequestId(); if (typeof j == "function") { f[i] = j } else { throw new Exception("RouteQuery.queryById: callBack must be a function, arg was: " + j) } var h = this.xmlRecFac.createRouteGeometryByIdRequestDOM(k, i, null, true); JSRequest.send(h, c.queryCallback) }; this.queryCallback = function (k) { var j = null; var i = (new DOMParser()).parseFromString(Utilities.normalizePrefixes(k), "text/xml"); if (document.all) { i.setProperty("SelectionLanguage", "XPath"); i.setProperty("SelectionNamespaces", "xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'") } var l = i.selectNodes("//xls:Error"); if (l.length > 0) { j = Sarissa.getText(i.selectSingleNode("//xls:Response/@requestID")); if (typeof f[j] == "function") { f[j](null); f[j] = undefined } } else { var h = Utilities.parseRoutes(i); j = Sarissa.getText(i.selectSingleNode("//xls:Response/@requestID")); if (j && j > 0) { f[j](h); f[j] = undefined } } } } function ScaleBar() { this.init() } ScaleBar.prototype.map = null; ScaleBar.prototype.type = "ScaleBar"; ScaleBar.prototype.frameHeight = 40; ScaleBar.prototype.frameWidth = 120; ScaleBar.prototype.frame = null; ScaleBar.prototype.cssClass = "decarta-scaleBar"; ScaleBar.prototype.measureImperial = null; ScaleBar.prototype.measureMetric = null; ScaleBar.prototype.measureCssClass = "decarta-scaleBarMeasure"; ScaleBar.prototype.scaleImperial = null; ScaleBar.prototype.scaleImperialCssClass = "decarta-scaleBarImperialScale"; ScaleBar.prototype.scaleMetric = null; ScaleBar.prototype.scaleMetricCssClass = "decarta-scaleBarMetricScale"; ScaleBar.prototype.init = function () { }; ScaleBar.prototype.build = function () { this.measureImperial = document.createElement("div"); this.measureImperial.className = this.measureCssClass; Utilities.setUnselectable(this.measureImperial); this.scaleImperial = document.createElement("div"); this.scaleImperial.className = this.scaleImperialCssClass; if (Utilities.ie6) { this.scaleImperial.innerHTML = "&nbsp;" } Utilities.setUnselectable(this.scaleImperial); this.measureMetric = document.createElement("div"); this.measureMetric.className = this.measureCssClass; Utilities.setUnselectable(this.measureMetric); this.scaleMetric = document.createElement("div"); this.scaleMetric.className = this.scaleMetricCssClass; if (Utilities.ie6) { this.scaleMetric.innerHTML = "&nbsp;" } Utilities.setUnselectable(this.scaleMetric); this.frame = document.createElement("div"); this.frame.id = this.cssClass; this.frame.className = this.cssClass; Utilities.setUnselectable(this.frame); this.frame.appendChild(this.measureImperial); this.frame.appendChild(this.scaleImperial); this.frame.appendChild(this.scaleMetric); this.frame.appendChild(this.measureMetric) }; ScaleBar.prototype.appendThis = function () { if (!this.frame) { this.build() } return this.frame }; ScaleBar.prototype.removeThis = function () { this.map = null; return this.frame }; ScaleBar.prototype.position = function (b) { if (!this.map) { return } var a = "px"; this.frame.style.top = b.height - this.frameHeight + a; this.frame.style.left = b.width - this.frameWidth + a }; ScaleBar.prototype.calculate = function () { if (!this.map || !this.map.getZoomController()) { return } try { this.map.getCenterPosition() } catch (l) { return } var s = this.map.getZoomController().getGXConvertedZoomLevel(); var f = Utilities.radsPerPixelAtZoom(this.map.getTileSize(), s); var d = this.map.getCenterPosition(); var a = Math.cos(((d.lat) * (Math.PI / 180))); var b = Utilities.lon2pix(d.lon, f); var r = Utilities.pix2lon(b + 1, f); var q = Utilities.pix2lon(b, f); var c = r - q; var k = parseFloat(a * 111325); var g = (c * k); var n = g * 3.28; var m = this.frameWidth - 15; this.scaleMetric.style.width = o(g, m) + "px"; this.scaleImperial.style.width = j(n, m) + "px"; this.measureMetric.innerHTML = i(g, m); this.measureImperial.innerHTML = h(n, m); function j(y, p) { var u = [25, 50, 100, 200, 500, 1000, 2000, 5280, 10560, 26400, 52800, 132000, 264000, 396000, 528000, 1056000, 1584000, 2640000, 3168000, 3696000, 4224000, 4752000, 5280000, 10560000, 15840000, 21120000, 26400000]; var z = y * p; var v; var t = u.length; for (v = 0; v < t; v++) { if (z <= u[v]) { break } } v = (v - 1 > 0) ? v - 1 : 0; var w = u[v] / y; return w } function h(w, p) { var u = [25, 50, 100, 200, 500, 1000, 2000, 5280, 10560, 26400, 52800, 132000, 264000, 396000, 528000, 1056000, 1584000, 2640000, 3168000, 3696000, 4224000, 4752000, 5280000, 10560000, 15840000, 21120000, 26400000]; var z = ["25 ft", "50 ft", "100 ft", "200 ft", "500 ft", "1000 ft", "2000 ft", "1 mi", "2 mi", "5 mi", "10 mi", "25 mi", "50 mi", "75 mi", "100 mi", "200 mi", "300 mi", "500 mi", "600 mi", "700 mi", "800 mi", "900 mi", "1000 mi", "2000 mi", "3000 mi", "4000 mi", "5000 mi"]; var y = w * p; var v; var t = u.length; for (v = 0; v < t; v++) { if (y <= u[v]) { break } } v = (v - 1 > 0) ? v - 1 : 0; return z[v] } function o(t, p) { var v = [10, 25, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 25000, 50000, 75000, 100000, 200000, 300000, 500000, 600000, 700000, 800000, 900000, 1000000, 2000000, 3000000, 4000000, 5000000]; var z = t * p; var w; var u = v.length; for (w = 0; w < u; w++) { if (z <= v[w]) { break } } w = (w - 1 > 0) ? w - 1 : 0; var y = v[w] / t; return y } function i(t, p) { var v = [10, 25, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 25000, 50000, 75000, 100000, 200000, 300000, 500000, 600000, 700000, 800000, 900000, 1000000, 2000000, 3000000, 4000000, 5000000]; var z = ["10 m", "25 m", "50 m", "100 m", "200 m", "500 m", "1 km", "2 km", "5 km", "10 km", "25 km", "50 km", "75 km", "100 km", "200 km", "300 km", "500 km", "600 km", "700 km", "800 km", "900 km", "1000 km", "2000 km", "3000 km", "4000 km", "5000 km"]; var y = t * p; var w; var u = v.length; for (w = 0; w < u; w++) { if (y <= v[w]) { break } } w = (w - 1 > 0) ? w - 1 : 0; return z[w] } }; ScaleBar.prototype.getDiv = function () { return this.frame }; function SearchCriteria(f, b, a, d, c) { if (d > 100) { throw new Exception("maximumResponses cannot exceed 100"); return } this.queryString = f; this.position = b.clone(); this.radius = a || new Radius(0.5); this.maximumResponses = d || 10; this.database = c || null; this.sortDirection = "Ascending"; this.sortCriteria = "Distance"; this.allowAggregates = false; this.properties = {} } function ServerMonitor() {
    this.xmlRecFac = new XMLRequestFactory(); var a = null; this.query = function () { var d = Utilities.getRequestId(); a = this.xmlRecFac.createRUOKRequestDOM(d); this.sendServerMonitorQueryRequest() }; this.sendServerMonitorQueryRequest = function () {
        if (!document.all) {
            try {
                //netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")
}catch(f){}}var d=new XMLHttpRequest();d.open("POST",Credentials.url,true);d.onreadystatechange= function(){if(d.readyState==4){try{if(d.status!=200){throw new Exception(ServerMonitor.WS_ERR)}}catch(h){throw new Exception(ServerMonitor.WS_ERR)}var g=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(d.responseText),"text/xml");if(document.all){g.setProperty("SelectionLanguage","XPath");g.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}if(g.selectNodes("//xls:Error").length>0){if(((g.selectNodes("//@message"))[0].value).indexOf("internal problem connecting to DDS")>-1){throw new Exception(ServerMonitor.DDS_ERR)}else{if(((g.selectNodes("//@message"))[0].value).indexOf("'rel' attribute")>-1){throw new Exception(ServerMonitor.VER_ERR)}else{throw new Exception((g.selectNodes("//@message"))[0].value)}}return false}}};d.send(a)}}ServerMonitor.WS_ERR="ERROR\n\nThere was an error connecting to the server.  Please verify that the server is running before you continue.";ServerMonitor.DDS_ERR="ERROR\n\ndeCarta Web Services is running, but it is unable to connect to the Drill Down Server.\n\nPlease check Drill Down Server or contact the administrator.";ServerMonitor.VER_ERR="ERROR\n\nThere is a version incompatibility between this version of the deCarta JavaScript API and deCarta DDS Web Services.";deCarta.String.isString= function(a){if(typeof a==="string"||a instanceof String){return true}else{return false}};deCarta.String.trim= function(a){return a.replace(/^\s*/,"").replace(/\s*$/,"")};deCarta.String.rtrim= function(a){return a.replace(/\s*$/,"")};deCarta.String.ltrim= function(a){return a.replace(/^\s*/,"")};deCarta.StyleManager={};deCarta.StyleManager.stylesCreated=false;deCarta.StyleManager.cssString=".decarta-log{position:absolute; top:4em; left:50em; width:60em; height:30em; font-family:monospace; font-size: 0.9em; border: 1px inset #cccccc; background-color:#eeeeee;}.decarta-logControlPanel{width:100%;}.deCarta-logButton{float:left; width:2em; height:1.3em; border: 1px solid #cccccc; background-color:#FdFdFd; text-align:center}.deCarta-logFilter{float:left; width:9em; height:1.3em; padding:0; margin:0; border:1px solid #cccccc; font-family:monospace; background-color:#FdFdFd;}.decarta-logConsole{width:100%; height:100%; overflow:scroll;}.decarta-logentryTable{width:100%;}.decarta-logentryOdd{width:100%; padding:0; margin:0; background-color:#eeeeee;}.decarta-logentryEven{width:100%; padding:0; margin:0; background-color:#e4e4e4;}.decarta-logentryNumber{width:10%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.decarta-logentryTime{width:10%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.decarta-logentryFlags{width:10%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.decarta-logentryCaller{width:10%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.decarta-logentryMessage{width:60%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.decarta-close{position:absolute; width:20px; height:20px; top:2px; left:178px; display:block; cursor:pointer;}.decarta-bubbleContent{padding:16px;}.decarta-bubble{display:none; width:200px; background-color:#ffffff; opacity:50; filter:alpha(opacity=90); opacity:0.9; border: 1px solid #cccccc; position:absolute; z-index:10000; color:#000000; font-size:11px;}.decarta-copyright{background-color:#ffffff; opacity:50; filter:alpha(opacity=80); opacity:0.8; padding:1px; font-family:arial; color:#000000; font-size:11px; border:1px solid #cccccc; display:block; position:absolute; z-index:9999;}.decarta-mapTypeController{background-color:#ffffff; opacity:50; filter:alpha(opacity=80); opacity:0.8; padding:3px; font-family:Arial; color:#000000; font-size:11px; font-weight:bold; border:1px solid #cccccc; display:block; position:absolute; visibility:visible; z-index:9999;}.decarta-mapTypeControllerLink{text-decoration:none;}.decarta-zoomButton{padding:0; margin:0; display:block;}.decarta-zoom{cursor: pointer; width: 20px; top: 1px; left: 1px; opacity: 50; filter: alpha(opacity=80); opacity: 0.8; position: absolute; z-index: 9999;}.decarta-scaleBar{position:absolute; width:120px; text-align:left; z-index:9999;}.decarta-scaleBarMeasure{font-family:arial; font-size:8pt; padding:0px 0px 0px 3px; margin:0;}.decarta-scaleBarImperialScale{display:block; padding:0; margin:0; font-size:6px; height:6px; border-left:2px solid #000; border-right:2px solid #000; border-bottom:1px solid #000;}.decarta-scaleBarMetricScale{display:block; padding:0; margin:0; font-size:6px; height:6px; border-left:2px solid #000; border-right:2px solid #000; border-top:1px solid #000;}.decarta-mapviewport{position:relative; z-index:0; overflow:hidden;}.decarta-tiles{position:absolute; left:0px; top:0px; z-index:0;}.decarta-maptile{z-index:0; position:absolute; visibility:hidden;}.decarta-json-type{color:#b84ab8}.decarta-json-relation{color:#bbb}.decarta-json-string{color:#ce7b00}.decarta-json-number{color:#0000e6}";deCarta.StyleManager.init= function(){if(deCarta.StyleManager.stylesCreated){return}if(document.styleSheets[0]&&document.styleSheets[0].cssText){document.styleSheets[0].cssText+=deCarta.StyleManager.cssString}else{var a=document.createElement("style");a.appendChild(document.createTextNode(deCarta.StyleManager.cssString));document.getElementsByTagName("head")[0].appendChild(a)}deCarta.StyleManager.stylesCreated=true};deCarta.StyleManager.getCurrentStyle= function(b,a){var c=b.style[d(a)];if(!c){if(document.defaultView){c=document.defaultView.getComputedStyle(b,"").getPropertyValue(a)}else{if(b.currentStyle){c=b.currentStyle[d(a)]}}}return c;function d(f){for(var g=/-([a-z])/;g.test(f);f=f.replace(g,RegExp.$1.toUpperCase())){}return f}};function TextOverlay(h,b,i,c,d,a,f){this.text=h||"";this.anchorX=b||0;this.anchorY=i||0;this.color=c||null;this.size=d||null;this.fontFamily=a||null;this.className=f||null;this.toString= function(){return this.text+" "+this.anchorX+" "+this.anchorY+" "+this.size+" "+this.fontFamily+" "+this.className}}TextOverlay.prototype.getAnchorX= function(){return this.anchorX};TextOverlay.prototype.getAnchorY= function(){return this.anchorY};TextOverlay.prototype.getText= function(){return this.text};TextOverlay.prototype.getClassName= function(){return this.className};TextOverlay.prototype.getColor= function(){return this.color};TextOverlay.prototype.getSize= function(){return this.size};TextOverlay.prototype.getFontFamily= function(){return this.fontFamily};TextOverlay.prototype.setAnchorX= function(a){this.anchorX=a};TextOverlay.prototype.setAnchorY= function(a){this.anchorY=a};TextOverlay.prototype.setText= function(a){this.text=a};TextOverlay.prototype.setClassName= function(a){this.className=a};TextOverlay.prototype.setColor= function(a){this.color=a};TextOverlay.prototype.setSize= function(a){this.size=a};TextOverlay.prototype.setFontFamily= function(a){this.fontFamily=a};function TrafficIncident(a,c){this.position=a;this.description=c;this.toString= function(){return this.position+"  "+this.description}}function TrafficIncidentQuery(){this.xmlRecFac=new XMLRequestFactory();var f=null;var d=[];var a=this;this.authenticate= function(i,h){if(!i||!h){throw new Exception("Error authenticating TrafficIncidentQuery, invalid parameters.")}Credentials.clientName=i;Credentials.clientPassword=h;this.xmlRecFac.clientName=i;this.xmlRecFac.clientPassword=h};this.query= function(h,j){var i=Utilities.getRequestId();if(typeof j=="function"){d[i]=j}else{throw new Exception("TrafficIncidentQuery.query: callBack must be a function, arg was: "+j)}f=this.xmlRecFac.createTrafficIncidentRequestDOM(h,i);JSRequest.send(f,a.queryCallback)};this.queryCallback= function(k){var n=null;var q=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(k),"text/xml");if(document.all){q.setProperty("SelectionLanguage","XPath");q.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var h=[];var s=q.selectNodes("//xls:Error");if(s.length>0){n=Sarissa.getText(q.selectSingleNode("//xls:Response/@requestID"));if(typeof d[n]=="function"){d[n](null);d[n]=undefined}}else{if(q.selectNodes("//xls:Incident").length==0){n=Sarissa.getText(q.selectSingleNode("//xls:Response/@requestID"));d[n](h);d[n]=undefined}else{var j=q.selectNodes("//xls:Incident");for(var l=0;l<j.length;l++){var o=Sarissa.serialize((j[l]));var r=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(o),"text/xml");if(document.all){r.setProperty("SelectionLanguage","XPath");r.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var t=Sarissa.getText(r.selectSingleNode("//@severity"));var m=Sarissa.getText(r.selectSingleNode("//xls:Description"));var p=Sarissa.getText(r.selectSingleNode("//xls:Position"));h.push(new TrafficIncident(new Position(p),m))}n=Sarissa.getText(q.selectSingleNode("//xls:Response/@requestID"));d[n](h);d[n]=undefined}}}}function TrafficIncidentSearchCriteria(b,a,c,d){if(c>100){throw new Exception("maximumResponses cannot exceed 100")}this.position=b.clone();this.radius=a;this.maximumResponses=c;this.minimumSeverity=d}function UOM(b){if(b!="KM"&&b!="M"&&b!="MI"&&b!="FT"){throw new Exception("invalid UOM type,  KM M MI FT")}this.value=b;this.toString= function(){return this.value}}function Utilities(){}Utilities.regx2=new RegExp("\\s","g");Utilities.parseKML= function(k){var b=new RegExp("&","g");k=k.replace(b," ");b=new RegExp("<kml xmlns=");k=k.replace(b,"<kml xmlns:goog=");var c=[];var m=(new DOMParser()).parseFromString(k,"text/xml");m.setProperty("SelectionLanguage","XPath");m.setProperty("SelectionNamespaces","xmlns:goog='http://earth.google.com/kml/2.2' xmlns:atom='http://www.w3.org/2005/Atom'");var f=m.selectNodes("//Placemark");for(var d=0;d<f.length;d++){var a;var h;var l;for(var p=0;p<f[d].childNodes.length;p++){try{if(f[d].childNodes[p].nodeName=="name"){a=Sarissa.getText(f[d].childNodes[p])||""}if(f[d].childNodes[p].nodeName=="description"){h=Sarissa.getText(f[d].childNodes[p])||""}if(f[d].childNodes[p].nodeName=="Point"){var o=Utilities.parseKMLCoords(f[d].childNodes[p].childNodes);l=new KMLGeometry("Point",o[0])}if(f[d].childNodes[p].nodeName=="Polygon"){var n=Utilities.parseKMLCoords(f[d].childNodes[p].childNodes);l=new KMLGeometry("Polygon",n)}if(f[d].childNodes[p].nodeName=="LineString"){var q=Utilities.parseKMLCoords(f[d].childNodes[p].childNodes);l=new KMLGeometry("LineString",q)}if(f[d].childNodes[p].nodeName=="MultiGeometry"){var g=Utilities.parseKMLMultiGeometry(f[d].childNodes[p].childNodes);l=new KMLGeometry("MultiGeometry",g)}}catch(j){continue}}if(l){c.push(new KML(l,a,h));l=undefined;a="";h=""}else{}}return c};Utilities.parseKMLMultiGeometry= function(f){var a=[];for(var b=0;b<f.length;b++){var c=f[b].nodeName;var d=Utilities.parseKMLCoords(f[b].childNodes);a.push(new KMLGeometry(c,d))}return a};Utilities.parseKMLCoords= function(d){var b=[];var a;c(d);function c(m){for(var h=0;h<m.length;h++){if(m[h].nodeName=="coordinates"){var g=Sarissa.getText(m[h]);var g=g.replace(Utilities.regx2,",");var j=g.split(",");var f=0;var k,l;for(var h=0;h<j.length;h++){if(f==0){l=j[h];f++;continue}else{if(f==1){k=j[h];b.push(new Position(k,l));f++;continue}else{if(f==2){f=0;continue}}}}a=b;break}else{if(m[h].childNodes.length){c(m[h].childNodes)}}}}return a};Utilities.getElementByTagName= function(j,h,a){var c=h+":"+a;var g;if(navigator.userAgent.toLowerCase().indexOf("safari")>-1){g=j.getElementsByTagNameNS("*",a)[0];if(!g){var b=j.getElementsByTagName("*");var f=b.length;for(var d=0;d<f;d++){if(b[d].nodeName==c){g=b[d];break}}}}else{g=j.getElementsByTagName(c)[0]}return g};Utilities.px="px";Utilities.LL2VR7= function(b){var g=b[0];var h=10000000;var a=(b.length)+","+(b[0].lat*h)+","+(b[0].lon*h);for(var f=1;f<b.length;f++){var d=Math.round((b[f].lat-g.lat)*h);var c=Math.round((b[f].lon-g.lon)*h);g=b[f];a+=","+d+","+c}return a};Utilities.timer= function(){this.green=null;this.red=null;this.start= function(){this.green=new Date().getTime()};this.stop= function(){this.red=new Date().getTime();return this.red-this.green}};Utilities.ie6=(document.all&&!window.opera&&(typeof document.documentElement.style.maxHeight=="undefined"))?true:false;Utilities.ie7=(document.all&&!window.opera&&(typeof document.documentElement.style.maxHeight!="undefined"))?true:false;Utilities.fixPng= function(a){var b=a.src;a.src=Credentials.transparentGIF;if(a.style.height&&a.style.width){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"',sizingMethod='scale')"}else{a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"')"}};Utilities.getScrollTop= function(){var a=0;if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){a=document.body.scrollTop}}return parseInt(a)};Utilities.getScrollLeft= function(){var a=0;if(document.documentElement&&document.documentElement.scrollLeft){a=document.documentElement.scrollLeft}else{if(document.body&&document.body.scrollLeft){a=document.body.scrollLeft}}return parseInt(a)};Utilities.podParse= function(b){var f=parseInt(b.substring(b.indexOf("P")+1,b.indexOf("D")));var a=parseInt(b.substring(b.indexOf("T")+1,b.indexOf("H")));var c=parseInt(b.substring(b.indexOf("H")+1,b.indexOf("M")));var d=parseInt(b.substring(b.indexOf("M")+1,b.indexOf("S")));if(f>0){return((f*24)+a)+" hours "+c+" minutes "}else{if(a>0){return a+" hours "+c+" minutes "}else{if(c>0){return c+" minutes "+d+" seconds "}else{return d+" seconds"}}}};Utilities.htmlizeXMLDom= function(c){var b=new RegExp("\\>","g");var a=new RegExp("\\<","g");var d=(Sarissa.serialize(c));d=d.replace(b,"&gt;");d=d.replace(a,"&lt;");return"<PRE>"+d+"</PRE>"};Utilities.p= function(a){deCarta.log.add(a)};Utilities.c= function(){deCarta.log.clear()};Utilities.generalize= function(l,r,j,q){j=Math.round(j/2);var c=r.getZoomLevel?r.getZoomLevel():r;var d=Utilities.radsPerPixelAtZoomLevel(q,c);var k=l.length;var b=[];var p,h,n,m,a,o,g;for(var f=0;f<k;f++){if(f==0||!p.contains(l[f])){h=Utilities.lat2pix(l[f].lat,d)+j;n=Utilities.lon2pix(l[f].lon,d)+j;m=Utilities.lat2pix(l[f].lat,d)-j;a=Utilities.lon2pix(l[f].lon,d)-j;o=Utilities.pix2lat(h,d)+" "+Utilities.pix2lon(n,d);g=Utilities.pix2lat(m,d)+" "+Utilities.pix2lon(a,d);p=new BoundingBox(new Position(g),new Position(o));b.push(l[f]);continue}}return b};Utilities.grouper= function(v,b,h,k){if(!v||!b||h<=0){throw new Exception("Utilities.grouper: Invalid input posArray: "+v+" zoom: "+b+" radius: "+h)}var l=b.getGXConvertedZoomLevel();var t=Utilities.radsPerPixelAtZoom(k,l);var m=v.length;var c,w,o,a,r,s,u;var n=[];var f=[];var d=0;var q,p;var g=[];for(q=0;q<m;q++){for(p=0;p<d;p++){if(n[p].contains(v[q])){g[p].push(v[q]);break}}if(p!=d){continue}else{w=Utilities.lat2pix(v[q].lat,t)+h;o=Utilities.lon2pix(v[q].lon,t)+h;a=Utilities.lat2pix(v[q].lat,t)-h;r=Utilities.lon2pix(v[q].lon,t)-h;s=Utilities.pix2lat(w,t)+" "+Utilities.pix2lon(o,t);u=Utilities.pix2lat(a,t)+" "+Utilities.pix2lon(r,t);c=new BoundingBox(new Position(u),new Position(s));n[d]=c;f[d]=v[q];g[d]=[];d++;continue}}for(q=0;q<d;q++){g[q].push(f[q])}return g};Utilities.getRequestId= function(){return Math.floor(Math.random()*10000000)};Utilities.getAbsoluteLeft= function(c){var b=c.offsetLeft;var a=c.offsetParent;while(a!=null){b+=a.offsetLeft;a=a.offsetParent}return b};Utilities.getAbsoluteTop= function(c){var b=c.offsetTop;var a=c.offsetParent;while(a!=null){b+=a.offsetTop;a=a.offsetParent}return b};Utilities.unloadMap= function(a){a.removeAllPins();Utilities.purge(a.mapDiv)};Utilities.purge= function(g){var c=g.attributes,f,b,h;if(c){b=c.length;for(f=0;f<b;f+=1){h=c[f].name;if(typeof g[h]==="function"){g[h]=null}}}c=g.childNodes;if(c){b=c.length;for(f=0;f<b;f+=1){Utilities.purge(g.childNodes[f])}}};Utilities.what= function(c){var b="";for(var a in c){b+="  "+a}alert(b)};Utilities.normalizePrefixes= function(j){var f=new RegExp("ns1:","g");var i=j.replace(f,"xls:");var d=new RegExp("ns\\d+:","g");var h=i.replace(d,"gml:");var b=new RegExp('\\sxmlns:ns\\d+="http://www.opengis.net/gml"',"g");var g=h.replace(b,"");var a=new RegExp('xmlns:ns1="http://www.opengis.net/xls"',"g");var c=g.replace(a,'xmlns:xls="http://www.opengis.net/xls" xmlns:gml="http://www.opengis.net/gml"');return c};Utilities.centerContextToBoundingBox= function(i,b){var h=b/111.111;var a=(i.lon-parseFloat(h));var g=(i.lon+parseFloat(h));var f=h*Math.cos(((i.lat*Math.PI)/180));var d=(i.lat-parseFloat(f));var c=(i.lat+parseFloat(f));return new BoundingBox(new Position(d,a),new Position(c,g))};Utilities.centerContextToBoundingBoxViewable= function(i,b,a){var d=b/111.111;var c=a/111.111;var j=(i.lon-parseFloat(d));var k=(i.lon+parseFloat(d));var h=c*Math.cos(((i.lat*Math.PI)/180));var f=(i.lat-parseFloat(h));var g=(i.lat+parseFloat(h));return new BoundingBox(new Position(f,j),new Position(g,k))};Utilities.latLonToPixels= function(c,f,d){var b=d*((f.lon-c.minPosition.lon)/(c.maxPosition.lon-c.minPosition.lon));var a=d*((c.maxPosition.lat-f.lat)/(c.maxPosition.lat-c.minPosition.lat));return new PixelPoint(Math.round(b),Math.round(a))};Utilities.formatRadiusToString= function(a){if(typeof a=="number"||typeof a!="string"){a=a.toString()}return a.replace(new RegExp(","),".")};Utilities.pixelsToLatLon= function(m,l,i,f,a,b,o,j){try{m=i-m;l=f-l;var n=o.getLat();var h=o.getLon();var g=(j*2)/111.111;var c=g/(a*b);var d=(g/Math.cos(((n*Math.PI)/180)))/(a*b);if(l!=0){n=""+(parseFloat(n)+parseFloat(l*c))}if(m!=0){h=""+(parseFloat(h)-parseFloat(m*d))}return new Position(n,h)}catch(k){throw new Exception(k.message)}};Utilities.positionsToBoundingBox= function(a){if(!a||a.length<2){throw new Exception("Utilities.positionsToBoundingBox requires at least two positions")}var b;for(var c=0;c<a.length;c++){if(c==0){b=new BoundingBox(new Position(a[c].toString()),new Position(a[c].toString()))}else{if(a[c].lat>b.getMaxPosition().lat){b.getMaxPosition().lat=a[c].lat}if(a[c].lon>b.getMaxPosition().lon){b.getMaxPosition().lon=a[c].lon}if(a[c].lat<b.getMinPosition().lat){b.getMinPosition().lat=a[c].lat}if(a[c].lon<b.getMinPosition().lon){b.getMinPosition().lon=a[c].lon}}}b.heightInDegrees=b.maxPosition.lat-b.minPosition.lat;b.widthInDegrees=b.maxPosition.lon-b.minPosition.lon;return b};Utilities.pinsToBoundingBox= function(d,h){if(!h){throw new Exception("Utilities.pinsToBoundingBox requires a scale argument")}if(!d||d.length<2){throw new Exception("Utilities.pinsToBoundingBox requires at least two pins")}var c=new Position(0,0);var b=new Position(0,0);for(var a=0;a<d.length;a++){var g=d[a].getViewableBoundingBox(h);if(a!=0){if(g.maxPosition.lat>c.lat){c.lat=g.maxPosition.lat}if(g.maxPosition.lon>c.lon){c.lon=g.maxPosition.lon}if(g.minPosition.lat<b.lat){b.lat=g.minPosition.lat}if(g.minPosition.lon<b.lon){b.lon=g.minPosition.lon}continue}else{c.lat=g.maxPosition.lat;c.lon=g.maxPosition.lon;b.lat=g.minPosition.lat;b.lon=g.minPosition.lon}}var f=new BoundingBox(b,c);return f};Utilities.pixYDist= function(i,g,c,d){if(!d){d=GLOBALS.DEFAULT_MAP_TILE_SIZE}var b=c.getGXConvertedZoomLevel();var a=Utilities.radsPerPixelAtZoom(d,b);var h=Math.round(Utilities.lat2pix(i,a));var f=Math.round(Utilities.lat2pix(g,a));return Math.abs(h-f)};Utilities.pixXDist= function(g,d,c,f){if(!f){f=GLOBALS.DEFAULT_MAP_TILE_SIZE}var b=c.getGXConvertedZoomLevel();var a=Utilities.radsPerPixelAtZoom(f,b);var i=Math.round(Utilities.lon2pix(g,a));var h=Math.round(Utilities.lon2pix(d,a));return Math.abs(i-h)};Utilities.lat2pix= function(d,g){var f=(parseFloat(d)*(2*Math.PI))/360;var b=0.08181919084262157;var a=Math.sin(f);var h=b*a;var c=Math.log(((1+a)/(1-a))*Math.pow((1-h)/(1+h),b))/2;return(c/g)};Utilities.lon2pix= function(b,a){return((b/180)*Math.PI)/a};Utilities.radsPerPixelAtZoom= function(b,a){return 2*Math.PI/(b<<a)};Utilities.radsPerPixelAtZoomLevel= function(b,c){var a=Math.abs(21-c);return 2*Math.PI/(b<<a)};Utilities.pix2lon= function(a,b){return(a*b)*180/Math.PI};Utilities.pix2lat= function(i,g){var h=1e-7;var f=12;var b=Math.pow(Math.E,-i*g);var d=Utilities.mercatorUnproject(b);var a=Utilities.findRadPhi(d,b);var c=0;while(c<f&&Math.abs(d-a)>h){d=a;a=Utilities.findRadPhi(d,b);c++}return a*180/Math.PI};Utilities.mercatorUnproject= function(a){return(Math.PI/2)-2*Math.atan(a)};Utilities.findRadPhi= function(c,b){var a=0.08181919084262157;var d=a*Math.sin(c);return(Math.PI/2)-(2*Math.atan(b*Math.pow((1-d)/(1+d),a/2)))};Utilities.generalizationFactor= function(f,d){if(!f||!d||!f.minPosition){throw new Exception("Utilities.generalizationFactor: bad input.bbox: "+f+"zoomLevel: "+d)}var c=[0.14916746,0.298780196,0.597003797,1.19445287,2.388571783,4.777143566,9.554287132,19.10857426,38.21725985,76.43440838,152.8688168,305.7376335,611.475267,1222.950534,2445.901068,4891.802136,9783.604272,19567.20854,39134.41709,78268.83418,156537.6684,313075.3367];var b=f.minPosition.lat*Math.PI/180;var a=c[d-1];return(a*Math.cos(b))};Utilities.parseRoute= function(o,t){var z=new Route();var n="";try{n=o.selectSingleNode("//xls:"+t+"xls:RouteHandle/@routeID").value}catch(y){}z.routeID=n||"";var a=Utilities.podParse(Sarissa.getText(o.selectSingleNode("//xls:TotalTime")));z.TotalTime=a;var l=o.selectSingleNode("//xls:TotalDistance/@value").value;z.TotalDistance=l;var h=o.selectSingleNode("//xls:TotalDistance/@uom").value;z.uom=new UOM(h);var g=(o.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[0].data;var u=(o.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[1].data;var b=new BoundingBox(new Position(g),new Position(u));z.boundingBox=b;z.centerPosition=b.getCenterPosition();var p=null;try{p=o.selectSingleNode("//xls:"+t+"/@viaPointSequence").value}catch(y){}z.viaPointSequence=p;var c=o.selectNodes("//xls:"+t+"/xls:RouteInstructionsList/xls:RouteInstruction/xls:Instruction");var w=o.selectNodes("//xls:"+t+"/xls:RouteInstructionsList/xls:RouteInstruction/xls:Point");var r=o.selectNodes("//xls:"+t+"/xls:RouteInstructionsList/xls:RouteInstruction/xls:distance/@value");var k=o.selectNodes("//xls:"+t+"/xls:RouteInstructionsList/xls:RouteInstruction/@duration");var d=null;try{d=o.selectNodes("//xls:RouteInstruction/@tour")}catch(y){}var m=new RegExp("'","g");for(var v=0;v<c.length;v++){var j=(Sarissa.getText((c[v]))).replace(m,"");var f=Sarissa.getText((w[v]));var q=new RouteInstruction();q.Instruction=j;q.distance=r[v].value;q.duration=Utilities.podParse(k[v].value);q.position=f;if(d&&d.length>0){q.tour=d[v].value}z.RouteInstructions.push(q)}o.setProperty("SelectionLanguage","XPath");o.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var A=o.selectSingleNode("//gml:LineString");if(A){var s=A.childNodes;for(var v=0;v<s.length;v++){z.RouteGeometry.push(new Position(Sarissa.getText(s[v])))}}return z};Utilities.parseRoutes= function(g){var c=new RegExp(' xmlns:gml="http://www.opengis.net/gml"',"g");var b=new RegExp(' xmlns:xls="http://www.opengis.net/xls"',"g");var a=' xmlns:xls="http://www.opengis.net/xls" xmlns:gml="http://www.opengis.net/gml"';var h;if(document.all){g.setProperty("SelectionLanguage","XPath");g.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var l=g.selectSingleNode("//xls:DetermineRouteResponse");var f=Sarissa.serialize((l));f=f.replace(c,"");f=f.replace(b,a);var k=(new DOMParser()).parseFromString((f),"text/xml");if(document.all){k.setProperty("SelectionLanguage","XPath");k.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}h=(Utilities.parseRoute(k,"DetermineRouteResponse"));var j=g.selectNodes("//xls:AlternateRoute");for(var d=0;d<j.length;d++){var f=Sarissa.serialize(j[d]);f=f.replace(c,"");f=f.replace(b,a);var k=(new DOMParser()).parseFromString((f),"text/xml");if(document.all){k.setProperty("SelectionLanguage","XPath");k.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}h.alternates.push(Utilities.parseRoute(k,"AlternateRoute"))}return h};Utilities.setUnselectable= function(a){if(a){if(typeof a.onselectstart!="undefined"){a.onselectstart= function(){return false}}else{if(typeof a.style.MozUserSelect!="undefined"){a.style.MozUserSelect="none"}else{}}}};Utilities.vrToPositions= function(d){if(!d){throw new Exception("vrToPositions: illegal argument: "+d)}var h=d.replace(/%[Vv][Rr]=/,"").split(",");var k=h[0]-1;var a=g(h[1]);var f=g(h[2]);var b=h.slice(3);var l=[];l.push(new Position(a,f));var c;for(c=0;c<k;c++){a+=g(b[0]);f+=g(b[1]);b=b.slice(2);var j=new Position(a,f);l.push(j)}return l;function g(r){var o;var m="";if(r.toString().charAt(0)=="-"){m="-";r=r.slice(1)}r=r.toString();var q=r.length;var p;if(q<=5&&q>0){p=["0","0","0","0","0"];var n=5;for(o=1;o<=q;o++){p[n-o]=r.charAt(q-o)}return(parseFloat(parseFloat(m+"0."+p.join("")).toFixed(5)))}else{if(q>5){p=[];for(o=0;o<q;o++){p.push(r.charAt(o));if(q-o-1==5){p.push(".")}}return(parseFloat(parseFloat(m+p.join("")).toFixed(5)))}else{throw new Exception("vrToPositions failed in vrOffsetToFloat with "+r)}}}};Utilities.vr7ToPositions= function(d){if(!d){throw new Exception("vr7ToPositions: illegal argument: "+d)}var g=d.replace(/%[Vv][Rr]7=/,"").split(",");var k=g[0]-1;var a=h(g[1]);var f=h(g[2]);var b=g.slice(3);var l=[];l.push(new Position(a,f));var c;for(c=0;c<k;c++){a+=h(b[0]);f+=h(b[1]);b=b.slice(2);var j=new Position(a,f);l.push(j)}return l;function h(r){var o;var m="";if(r.toString().charAt(0)=="-"){m="-";r=r.slice(1)}r=r.toString();var q=r.length;var p;if(q<=7&&q>0){p=["0","0","0","0","0","0","0"];var n=7;for(o=1;o<=q;o++){p[n-o]=r.charAt(q-o)}return parseFloat(parseFloat(m+"0."+p.join("")).toFixed(7))}else{if(q>7){p=[];for(o=0;o<q;o++){p.push(r.charAt(o));if(q-o-1==7){p.push(".")}}return parseFloat(parseFloat(m+p.join("")).toFixed(7))}else{throw new Exception("vrToPositions failed in vrOffsetToFloat with "+r)}}}};Utilities.positionsToVr= function(f){if(!f&&!f.length){throw new Exception("positionsToVr: cannot create empty VR string.")}var d;var c=f.length;var g=[];g.push("%VR="+c);g.push(k(f[0].lat));g.push(k(f[0].lon));var j=f[0].lat;var a=f[0].lon;for(d=1;d<c;d++){var b=f[d].lat-j;g.push(k(b));j+=b;var h=f[d].lon-a;g.push(k(h));a+=h}return g.join(",");function k(l){var i=parseFloat(parseFloat(l).toFixed(5).toString().replace(/\./,""));return i}};Utilities.positionsToVr7= function(g){if(!g&&!g.length){throw new Exception("positionsToVr7: cannot create empty VR string.")}var f;var d=g.length;var h=[];h.push("%VR7="+d);h.push(b(g[0].lat));h.push(b(g[0].lon));var k=g[0].lat;var a=g[0].lon;for(f=1;f<d;f++){var c=g[f].lat-k;h.push(b(c));k+=c;var j=g[f].lon-a;h.push(b(j));a+=j}return h.join(",");function b(l){var i=parseFloat(parseFloat(l).toFixed(7).toString().replace(/\./,""));return i}};function WSXMLTunnel(){var a=[];this.send= function(d,h){var f=Sarissa.getDomDocument();f=(new DOMParser()).parseFromString(Sarissa.serialize(d),"text/xml");f.setProperty("SelectionLanguage","XPath");f.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var g=(f.selectSingleNode("//xls:Request/@requestID").value);if(typeof h=="function"){a[g]=h}else{throw new Exception("WSXMLTunnel.send: callBack must be a function, arg was: "+h)}JSRequest.send(f,this._callBack)};this._callBack= function(f){var g=Sarissa.getDomDocument();g=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(f),"text/xml");g.setProperty("SelectionLanguage","XPath");g.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var d=(g.selectSingleNode("//xls:Response/@requestID").value);a[d](g)}}function XMLRequestFactory(){this.overlays=[];this.rendering="server";this.routeID=null;this.clientName=Credentials.clientName;this.clientPassword=Credentials.clientPassword;this.configuration=Credentials.configuration;this.transparentConfiguration=Credentials.transparentConfiguration;this.mapType=GLOBALS.STREET;this.streetImgFormat="GIF";this.hybridImgFormat="PNG"}XMLRequestFactory.prototype.getHeader= function(i,c,b,h){b=b||"10";h=h||Utilities.getRequestId();c=c||Utilities.getRequestId();try{var g=Sarissa.getDomDocument();var d=g.createElement("xls:XLS");d.setAttribute("xls:lang","en");d.setAttribute("version","1");if(Credentials.rel&&Credentials.rel!=null){d.setAttribute("rel",Credentials.rel)}d.setAttribute("xmlns:xls","http://www.opengis.net/xls");d.setAttribute("xmlns:gml","http://www.opengis.net/gml");g.appendChild(d);var j=g.createElement("xls:RequestHeader");j.setAttribute("clientName",this.clientName);j.setAttribute("clientPassword",this.clientPassword);if(this.mapType=="STREET"){j.setAttribute("configuration",this.configuration)}else{j.setAttribute("configuration",this.transparentConfiguration)}j.setAttribute("sessionID",h);d.appendChild(j);var a=g.createElement("xls:Request");a.setAttribute("maximumResponses",b);a.setAttribute("version","1.0");a.setAttribute("requestID",c);a.setAttribute("methodName",i);d.appendChild(a);return g}catch(f){throw new Exception("XMLRequestFactory.this.getHeader: "+f.message)}};XMLRequestFactory.prototype.createMapAddressRequestDOM= function(l,k,q,o,s){try{var d=this.getHeader("PortrayMapRequest",q);var w=d.createElement("xls:PortrayMapRequest");Utilities.getElementByTagName(d,"xls","Request").appendChild(w);var i=d.createElement("xls:Output");i.setAttribute("width",k);i.setAttribute("height",k);i.setAttribute("fixedgrid","true");i.setAttribute("useCache","true");if(this.mapType=="STREET"){i.setAttribute("format",this.streetImgFormat)}else{i.setAttribute("format",this.hybridImgFormat)}i.setAttribute("content","URL");w.appendChild(i);var f=d.createElement("xls:CenterAddress");var u=d.createElement("xls:TileGrid");u.setAttribute("rows","1");u.setAttribute("columns","1");var m=d.createElement("xls:GridLayer");m.setAttribute("name","globexplorer");m.setAttribute("meta-inf","zoom="+o);var y=d.createElement("xls:GridLayer");y.setAttribute("name","deCarta");y.setAttribute("returnMaxImageHostAliases","true");u.appendChild(y);u.appendChild(m);var b=d.createElement("xls:Pan");b.setAttribute("direction","N");b.setAttribute("numTiles","0");var a=d.createElement("xls:Pan");a.setAttribute("direction","S");a.setAttribute("numTiles","0");var g=d.createElement("xls:Pan");g.setAttribute("direction","E");g.setAttribute("numTiles","0");var v=d.createElement("xls:Pan");v.setAttribute("direction","W");v.setAttribute("numTiles","0");u.appendChild(b);u.appendChild(a);u.appendChild(g);u.appendChild(v);i.appendChild(f);i.appendChild(u);var r=d.createElement("xls:Address");r.setAttribute("countryCode",l.getLocale().getCountry());r.setAttribute("language",l.getLocale().getLanguage());f.appendChild(r);var c=d.createElement("xls:freeFormAddress");var j=d.createTextNode(l.toString());c.appendChild(j);r.appendChild(c);if(Credentials.trafficEnabled){var p=d.createElement("xls:Overlay");var n=d.createElement("xls:Traffic");var h=d.createElement("xls:FlowReporting");if(s){h.setAttribute("time",s)}n.appendChild(h);p.appendChild(n);w.appendChild(p)}if(document.all){d.setProperty("SelectionLanguage","XPath");d.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}return d}catch(t){throw new Exception("XMLRequestFactory.prototype.createMapAddressRequestDOM: "+t.message)}};XMLRequestFactory.prototype.createMapRequestDOM= function(i,m,s,q,u){try{var f=this.getHeader("PortrayMapRequest",s);f=(new DOMParser()).parseFromString(Sarissa.serialize(f),"text/xml");f.setProperty("SelectionLanguage","XPath");f.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var z=f.createElement("xls:PortrayMapRequest");Utilities.getElementByTagName(f,"xls","Request").appendChild(z);var l=f.createElement("xls:Output");l.setAttribute("width",m);l.setAttribute("height",m);l.setAttribute("fixedgrid","true");l.setAttribute("useCache","true");if(this.mapType=="STREET"){l.setAttribute("format",this.streetImgFormat)}else{l.setAttribute("format",this.hybridImgFormat)}l.setAttribute("content","URL");z.appendChild(l);this.addOverlaysToXML(z,f);var g=f.createElement("xls:CenterContext");g.setAttribute("SRS","WGS-84");var w=f.createElement("xls:TileGrid");w.setAttribute("rows","1");w.setAttribute("columns","1");var o=f.createElement("xls:GridLayer");o.setAttribute("name","globexplorer");o.setAttribute("meta-inf","zoom="+q);var A=f.createElement("xls:GridLayer");A.setAttribute("name","deCarta");A.setAttribute("returnMaxImageHostAliases","true");w.appendChild(A);w.appendChild(o);var b=f.createElement("xls:Pan");b.setAttribute("direction","N");b.setAttribute("numTiles","0");var a=f.createElement("xls:Pan");a.setAttribute("direction","S");a.setAttribute("numTiles","0");var j=f.createElement("xls:Pan");j.setAttribute("direction","E");j.setAttribute("numTiles","0");var y=f.createElement("xls:Pan");y.setAttribute("direction","W");y.setAttribute("numTiles","0");w.appendChild(b);w.appendChild(a);w.appendChild(j);w.appendChild(y);l.appendChild(g);l.appendChild(w);var d=f.createElement("xls:Radius");d.setAttribute("unit","KM");var n=f.createTextNode("0");n=f.createTextNode("200");d.appendChild(n);var t=f.createElement("xls:CenterPoint");var h=f.createElement("gml:pos");var c;if(i&&i.getLatLon){c=f.createTextNode(i.getLatLon())}else{c=f.createTextNode("0 0")}h.appendChild(c);t.appendChild(h);g.appendChild(t);g.appendChild(d);if(Credentials.trafficEnabled){var r=f.createElement("xls:Overlay");var p=f.createElement("xls:Traffic");var k=f.createElement("xls:FlowReporting");if(u){k.setAttribute("time",u)}p.appendChild(k);r.appendChild(p);z.appendChild(r)}if(document.all){f.setProperty("SelectionLanguage","XPath");f.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}return f}catch(v){throw new Exception("XMLRequestFactory.prototype.createBasicMapRequestDOM: "+v.message)}};XMLRequestFactory.prototype.zoomMapRequestDOM= function(c,u,r,A,o,g,m,b,l){var y;try{var q=(new DOMParser()).parseFromString(Sarissa.serialize(c),"text/xml");q.setProperty("SelectionLanguage","XPath");q.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(b){var h=q.selectSingleNode("//gml:pos");for(y=0;y<h.childNodes.length;y++){h.removeChild(h.childNodes[y])}var k=q.createTextNode(b.toString());h.appendChild(k)}if(l){var f=q.selectSingleNode("//xls:Radius");for(y=0;y<f.childNodes.length;y++){f.removeChild(f.childNodes[y])}f.setAttribute("unit","M");var j=q.createTextNode(l.toString());f.appendChild(j)}var a=q.selectSingleNode("//xls:Pan[@direction='N']");a.setAttribute("numTiles",u);var B=q.selectSingleNode("//xls:Pan[@direction='S']");B.setAttribute("numTiles",r);var d=q.selectSingleNode("//xls:Pan[@direction='E']");d.setAttribute("numTiles",A);var z=q.selectSingleNode("//xls:Pan[@direction='W']");z.setAttribute("numTiles",o);var t=(q.selectSingleNode("//xls:RequestHeader"));if(this.mapType=="STREET"){t.setAttribute("configuration",this.configuration)}else{t.setAttribute("configuration",this.transparentConfiguration)}var v=(q.selectSingleNode("//xls:Output"));if(this.mapType=="STREET"){v.setAttribute("format",this.streetImgFormat)}else{v.setAttribute("format",this.hybridImgFormat)}var p=q.selectSingleNode("//xls:GridLayer[@name='globexplorer']");p.setAttribute("meta-inf","zoom="+g+":"+m);return q}catch(A){throw new Exception("XMLRequestFactory.prototype.zoomMapRequestDOM: "+A.message)}};XMLRequestFactory.prototype.createGeocodeRequestDOM= function(i,t,d){try{var j=this.getHeader("GeocodeRequest",t);var o=j.createElement("xls:GeocodeRequest");if(d){o.setAttribute("returnFreeForm","true")}else{o.setAttribute("returnFreeForm","false")}Utilities.getElementByTagName(j,"xls","Request").appendChild(o);var v=j.createElement("xls:Address");v.setAttribute("countryCode",i.getLocale().getCountry());v.setAttribute("language",i.getLocale().getLanguage());o.appendChild(v);if(i.type=="FreeForm"){var h=j.createElement("xls:freeFormAddress");var q=j.createTextNode(i.toString());h.appendChild(q);v.appendChild(h)}else{var u=j.createElement("xls:StreetAddress");var n=false;if(i.buildingNumber||i.buildingNumber==0){var g=j.createElement("xls:Building");g.setAttribute("number",i.buildingNumber);u.appendChild(g);n=true}if(i.street){var z=j.createTextNode(i.street);var m=j.createElement("xls:Street");m.appendChild(z);u.appendChild(m);n=true}if(!n){u=null}else{v.appendChild(u)}if(i.countrySubdivision){var f=j.createTextNode(i.countrySubdivision);var c=j.createElement("xls:Place");c.setAttribute("type","CountrySubdivision");c.appendChild(f);v.appendChild(c)}if(i.countrySecondarySubdivision){var b=j.createTextNode(i.countrySecondarySubdivision);var a=j.createElement("xls:Place");a.setAttribute("type","CountrySecondarySubdivision");a.appendChild(b);v.appendChild(a)}if(i.municipality){var s=j.createTextNode(i.municipality);var y=j.createElement("xls:Place");y.setAttribute("type","Municipality");y.appendChild(s);v.appendChild(y)}if(i.municipalitySubdivision){var k=j.createTextNode(i.municipalitySubdivision);var p=j.createElement("xls:Place");p.setAttribute("type","MunicipalitySubdivision");p.appendChild(k);v.appendChild(p)}if(i.postalCode){var r=j.createTextNode(i.postalCode);var l=j.createElement("xls:PostalCode");l.appendChild(r);v.appendChild(l)}}return j}catch(w){throw new Exception("XMLRequestFactory.prototype.getGeocodeRequestDOM: "+w.message)}};XMLRequestFactory.prototype.createReverseGeocodeRequestDOM= function(g,a){try{var f=this.getHeader("ReverseGeocodeRequest",a);var l=f.createElement("xls:ReverseGeocodeRequest");l.setAttribute("returnFreeForm","true");Utilities.getElementByTagName(f,"xls","Request").appendChild(l);var d=f.createElement("xls:Position");var j=f.createElement("gml:Point");var i=f.createElement("gml:pos");var b=f.createTextNode(g.getLatLon());i.appendChild(b);j.appendChild(i);d.appendChild(j);l.appendChild(d);var k=f.createElement("xls:ReverseGeocodePreference");var c=f.createTextNode("StreetAddress");k.appendChild(c);l.appendChild(k);return f}catch(h){throw new Exception("XMLRequestFactory.prototype.createReverseGeocodeRequestDOM: "+h.message)}};XMLRequestFactory.prototype.createCenterContext= function(b,k){try{var d=Sarissa.getDomDocument();var a=d.createElement("xls:CenterContext");a.setAttribute("SRS","WGS-84");var f=d.createElement("xls:Radius");f.setAttribute("unit","KM");var j=d.createTextNode(Utilities.formatRadiusToString(k));f.appendChild(j);var h=d.createElement("xls:CenterPoint");var i=d.createElement("gml:pos");var c=d.createTextNode(b);i.appendChild(c);h.appendChild(i);a.appendChild(h);a.appendChild(f);return a}catch(g){throw new Exception("XMLRequestFactory.prototype.createCenterContext: "+g.message)}};XMLRequestFactory.prototype.createRouteGeometryRequestDOM= function(g,n,K,I){try{var S=this.getHeader("DetermineRouteRequest",n);var r=S.createElement("xls:DetermineRouteRequest");r.setAttribute("distanceUnit",K.uom);r.setAttribute("routeQueryType",K.routeQueryType);r.setAttribute("provideRouteHandle","true");if(K.alternateRoutes){r.setAttribute("numAltRoutes",K.alternateRoutes)}Utilities.getElementByTagName(S,"xls","Request").appendChild(r);var j=S.createElement("xls:RoutePlan");if(Credentials.trafficEnabled){j.setAttribute("useRealTimeTraffic","true")}if(K.optimized){j.setAttribute("optimize","true")}if(Credentials.trafficEnabled&&K.expectedStartTime){j.setAttribute("expectedStartTime",K.expectedStartTime)}r.appendChild(j);var l=S.createElement("xls:RoutePreference");var A=S.createTextNode(K.routePreference);l.appendChild(A);j.appendChild(l);var N=S.createElement("xls:WayPointList");for(var H=0;H<g.length;H++){var C;var y;var v;var h;if(H==0){var p=S.createElement("xls:StartPoint");C=S.createElement("xls:Position");y=S.createElement("gml:Point");v=S.createElement("gml:pos");h=S.createTextNode(g[H]);v.appendChild(h);y.appendChild(v);C.appendChild(y);p.appendChild(C);N.appendChild(p)}else{if(H>0&&H<(g.length-1)){var m=S.createElement("xls:ViaPoint");C=S.createElement("xls:Position");y=S.createElement("gml:Point");v=S.createElement("gml:pos");h=S.createTextNode(g[H]);v.appendChild(h);y.appendChild(v);C.appendChild(y);m.appendChild(C);N.appendChild(m)}else{if(H==(g.length-1)){var b=S.createElement("xls:EndPoint");C=S.createElement("xls:Position");y=S.createElement("gml:Point");v=S.createElement("gml:pos");h=S.createTextNode(g[H]);v.appendChild(h);y.appendChild(v);C.appendChild(y);b.appendChild(C);N.appendChild(b)}}}}j.appendChild(N);if(K.avoidList.length>0){var O=S.createElement("xls:AvoidList");for(H=0;H<K.avoidList.length;H++){var o=S.createTextNode(K.avoidList[H]);var Q=S.createElement("xls:AvoidFeature");Q.appendChild(o);O.appendChild(Q)}j.appendChild(O)}if(K.logisticsPreference){var u=K.logisticsPreference;var q=false;var G=S.createElement("xls:Logistics");if(u.preferredRoute){q=true;var F=S.createTextNode(u.preferredRoute);var R=S.createElement("xls:PreferredRoute");R.appendChild(F);G.appendChild(R)}if(u.hazmat){q=true;var E=S.createTextNode(u.hazmat);var z=S.createElement("xls:Hazmat");z.appendChild(E);G.appendChild(z)}if(u.vehicleParameters){q=true;var a=S.createTextNode(u.vehicleParameters);var w=S.createElement("xls:VehicleParameters");w.appendChild(a);G.appendChild(w)}if(u.vehicleTypes){q=true;var s=S.createTextNode(u.vehicleTypes);var d=S.createElement("xls:VehicleTypes");d.appendChild(s);G.appendChild(d)}if(u.preferredTurn){q=true;var c=S.createTextNode(u.preferredTurn);var f=S.createElement("xls:PreferredTurn");f.appendChild(c);G.appendChild(f)}if(q==true){j.appendChild(G)}else{G=null}}var B=S.createElement("xls:RouteInstructionsRequest");B.setAttribute("providePoint","true");if(K.rules!=null){B.setAttribute("rules",K.rules)}r.appendChild(B);var P=S.createElement("xls:RouteGeometryRequest");if(!I){P.setAttribute("returnRouteIDOnly","true")}if(K.generalizationFactor&&K.generalizationFactor!==0&&K.generalizationBBox){P.setAttribute("resolution",K.generalizationFactor);var k=S.createElement("xls:BoundingBox");var M=S.createElement("gml:pos");var D=S.createTextNode(K.generalizationBBox.minPosition);var J=S.createElement("gml:pos");var t=S.createTextNode(K.generalizationBBox.maxPosition);M.appendChild(D);k.appendChild(M);J.appendChild(t);k.appendChild(J);P.appendChild(k)}r.appendChild(P);return S}catch(L){throw new Exception("XMLRequestFactory.prototype.createRouteGeometryRequestDOM: "+L.message)}};XMLRequestFactory.prototype.createRouteGeometryByIdRequestDOM= function(a,d,i,b){try{var f=this.getHeader("DetermineRouteRequest",d,null,i);var j=f.createElement("xls:DetermineRouteRequest");Utilities.getElementByTagName(f,"xls","Request").appendChild(j);var c=f.createElement("xls:RouteInstructionsRequest");c.setAttribute("providePoint","true");var h=f.createElement("xls:RouteGeometryRequest");var k=f.createElement("xls:RouteHandle");k.setAttribute("serviceID","DetermineRouteService");k.setAttribute("routeID",a);if(!b){h.setAttribute("returnRouteIDOnly","true")}j.appendChild(k);j.appendChild(c);j.appendChild(h);return f}catch(g){throw new Exception("XMLRequestFactory.prototype.createRouteGeometryByIdRequestDOM: "+g.message)}};XMLRequestFactory.prototype.createRouteMapDOM= function(g,l,q,k,o,b){try{var f=this.getHeader("PortrayMapRequest",q);var u=f.createElement("xls:PortrayMapRequest");u.setAttribute("fitOverlays","false");Utilities.getElementByTagName(f,"xls","Request").appendChild(u);var j=f.createElement("xls:Output");j.setAttribute("width",k);j.setAttribute("height",k);j.setAttribute("fixedgrid","true");j.setAttribute("useCache","true");if(this.mapType=="STREET"){j.setAttribute("format",this.streetImgFormat)}else{j.setAttribute("format",this.hybridImgFormat)}j.setAttribute("content","URL");j.appendChild(g);var c=f.createElement("xls:Overlay");l.setAttribute("preference",b.routePreference);this.routeID=l;c.appendChild(l.cloneNode(true));u.appendChild(j);u.appendChild(c);var s=f.createElement("xls:TileGrid");s.setAttribute("rows","1");s.setAttribute("columns","1");var m=f.createElement("xls:GridLayer");m.setAttribute("name","globexplorer");m.setAttribute("meta-inf","zoom="+o);var v=f.createElement("xls:GridLayer");v.setAttribute("name","deCarta");v.setAttribute("returnMaxImageHostAliases","true");s.appendChild(v);s.appendChild(m);var d=f.createElement("xls:Pan");d.setAttribute("direction","N");d.setAttribute("numTiles","0");var a=f.createElement("xls:Pan");a.setAttribute("direction","S");a.setAttribute("numTiles","0");var h=f.createElement("xls:Pan");h.setAttribute("direction","E");h.setAttribute("numTiles","0");var t=f.createElement("xls:Pan");t.setAttribute("direction","W");t.setAttribute("numTiles","0");s.appendChild(d);s.appendChild(a);s.appendChild(h);s.appendChild(t);j.appendChild(s);if(Credentials.trafficEnabled){var p=f.createElement("xls:Overlay");var n=f.createElement("xls:Traffic");var i=f.createElement("xls:FlowReporting");if(b.expectedStartTime){i.setAttribute("time",b.expectedStartTime)}n.appendChild(i);p.appendChild(n);u.appendChild(p)}return f}catch(r){throw new Exception("XMLRequestFactory.prototype.createRouteMapDOM: "+r.message)}};XMLRequestFactory.prototype.createPOIRequestDOM= function(q,h){try{var f=this.getHeader("DirectoryRequest",h,q.maximumResponses);var a=f.createElement("xls:DirectoryRequest");if(q.database!=null){a.setAttribute("database",q.database)}Utilities.getElementByTagName(f,"xls","Request").appendChild(a);a.setAttribute("sortDirection",q.sortDirection);a.setAttribute("sortCriteria",q.sortCriteria);if(q.allowAggregates){a.setAttribute("allowAggregates","true")}var c=f.createElement("xls:POILocation");a.appendChild(c);var j=f.createElement("xls:WithinDistance");c.appendChild(j);var g=f.createElement("xls:MaximumDistance");g.setAttribute("value",q.radius.distance);g.setAttribute("uom",q.radius.uom.value);var p=f.createElement("xls:MinimumDistance");p.setAttribute("unit",q.radius.uom.value);p.setAttribute("value","0");var l=f.createElement("xls:POI");l.setAttribute("ID","1");var o=f.createElement("gml:Point");var k=f.createElement("gml:pos");var b=f.createTextNode(q.position.toString());k.appendChild(b);o.appendChild(k);l.appendChild(o);j.appendChild(l);j.appendChild(p);j.appendChild(g);var r=f.createElement("xls:POIProperties");var d=f.createElement("xls:POIProperty");r.appendChild(d);a.appendChild(r);d.setAttribute("name","Keyword");d.setAttribute("value",q.queryString);for(var n in q.properties){var m=f.createElement("xls:POIProperty");m.setAttribute("name",n);m.setAttribute("value",q.properties[n]);r.appendChild(m)}return f}catch(i){throw new Exception("XMLRequestFactory.prototype.createPOIRequestDOM: "+i.message)}};XMLRequestFactory.prototype.createRUOKRequestDOM= function(c){try{var b=this.getHeader("RuokRequest",c);var a=b.createElement("xls:RUOKRequest");Utilities.getElementByTagName(b,"xls","Request").appendChild(a);return b}catch(d){throw new Exception("XMLRequestFactory.prototype.createRUOKRequestDOM: "+d.message)}};XMLRequestFactory.prototype.addOverlaysToXML= function(l,g){try{if(this.rendering!="server"){return}if(this.routeID!=null){var d=g.createElement("xls:Overlay");d.appendChild(this.routeID);l.appendChild(d)}for(var f=0;f<this.overlays.length;f++){if(!this.overlays[f]||(this.overlays[f]&&!this.overlays[f].isVisible)){continue}var a=this.overlays[f];var c=g.createElement("xls:Overlay");var k=g.createElement("xls:Shape");c.appendChild(k);k.setAttribute("type",a.type);k.setAttribute("color",a.fillColor+"_"+a.borderColor);k.setAttribute("style",a.borderStyle);if(a.type=="line"){k.setAttribute("width",a.width+"_"+a.borderWidth);if(a.strokeOpacity){k.setAttribute("opacity",a.strokeOpacity)}else{k.setAttribute("opacity",a.opacity)}}else{k.setAttribute("width",a.borderWidth);if(a.strokeOpacity||a.fillOpacity){var h=a.strokeOpacity||a.opacity;var m=a.fillOpacity||a.opacity;k.setAttribute("opacity",m+"_"+h)}else{k.setAttribute("opacity",a.opacity)}}var b;if(a.type=="circle"){k.setAttribute("pointspec","LL");k.setAttribute("radius",a.radius.uomdds+a.radius.distance);b=g.createTextNode(a.position.lat+","+a.position.lon)}else{try{var n=Utilities.LL2VR7(a.positions);a.VR7=n}catch(j){continue}if(a.type=="line"){k.setAttribute("pointspec","VR7")}else{k.setAttribute("pointspec","VR7PG")}b=g.createTextNode(n)}k.appendChild(b);l.appendChild(c)}}catch(j){throw new Exception("XMLRequestFactory.prototype.addOverlaysToXML: "+j.message)}};XMLRequestFactory.prototype.createTrafficIncidentRequestDOM= function(l,f){try{var d=this.getHeader("TrafficRequest",f,l.maxiumResponses);var c=d.createElement("xls:TrafficRequest");Utilities.getElementByTagName(d,"xls","Request").appendChild(c);var m=d.createElement("xls:IncidentReporting");m.setAttribute("minimumSeverity",l.minimumSeverity);c.appendChild(m);var a=d.createElement("xls:CenterContext");a.setAttribute("SRS","WGS-84");var g=d.createElement("xls:Radius");g.setAttribute("unit",l.radius.uom.value);var k=d.createTextNode(l.radius.distance);g.appendChild(k);var i=d.createElement("xls:CenterPoint");var j=d.createElement("gml:pos");var b=d.createTextNode(l.position);j.appendChild(b);i.appendChild(j);a.appendChild(i);a.appendChild(g);c.appendChild(a);return d}catch(h){throw new Exception("XMLRequestFactory.prototype.createTrafficIncidentRequestDOM: "+h.message)}};function ZoomController(s,r,E,J,u,h){this.selected=s||5;if(isNaN(parseInt(this.selected))||this.selected<0||this.selected>17){throw new Exception("Error instantiating ZoomController, invalid initial value "+s+".  The value must be between 1 and 17");return false}this.zoomLevels=17;this.lowerBound=1;this.upperBound=17;this.color=r||"";this.uncheckedSrc=J||Credentials.imgPath+"zoom.png";this.checkedSrc=E||Credentials.imgPath+"zoomChecked.png";this.bottomCapSrc=h||Credentials.imgPath+"zoomBottom.png";this.topCapSrc=u||Credentials.imgPath+"zoomTop.png";this.zoomer=null;this.map=null;this.type="ZoomController";this.frame=null;var i=this;var F=new Array();var p=null;var q=null;var l;var m;this.initialize= function(){var Q;var M="decarta-zoomButton";for(Q=i.lowerBound;Q<=i.upperBound;Q++){var P=document.createElement("img");deCarta.IdManager.setTag(P,"ingoreForMapEvents");P.id="decarta-z"+Q;P.className=M;P.src=i.uncheckedSrc;P.onclick= function(){i.map.zoomMap(this.id.substring(9))};if(Utilities.ie6){Utilities.fixPng(P)}F.push(P)}p=document.createElement("IMG");p.id="decarta-ztop";p.src=this.topCapSrc;p.className=M;if(Utilities.ie6){Utilities.fixPng(p)}p.onclick= function(R){R=R||event;R.stoppropagation?R.stoppropagation():R.cancelBubble=true;i.zoomInOneLevel()};deCarta.IdManager.setTag(p,"ingoreForMapEvents");q=document.createElement("IMG");q.src=this.bottomCapSrc;q.className=M;if(Utilities.ie6){Utilities.fixPng(q)}q.id="decarta-zbottom";q.onclick= function(R){R=R||event;R.stoppropagation?R.stoppropagation():R.cancelBubble=true;i.zoomOutOneLevel()};deCarta.IdManager.setTag(q,"ingoreForMapEvents");var O="decarta-zoom";var N=O;i.frame=document.createElement("DIV");i.frame.id=O;i.frame.className=N;i.frame.innerHTML="";if(i.color){i.frame.style.backgroundColor=i.color}deCarta.IdManager.setTag(i.frame,"ingoreForMapEvents");i.frame.appendChild(p);for(Q=0;Q<F.length;Q++){i.frame.appendChild(F[Q])}i.frame.appendChild(q);this.zoomer=this.frame;this.setZoomLevel(i.selected)};this.setZoomRange= function(M,N){if(M<1||N>21||M>N){throw new Exception("illegal values setZoomRange: "+M+", "+N)}if(i.selected>N){i.selected=N}if(i.selected<M){i.selected=M}i.zoomLevels=N;i.lowerBound=M;i.upperBound=N};this.setZoomButtonImages= function(P,O,M,Q){if(P){this.checkedSrc=P}if(O){this.uncheckedSrc=O}if(P||O){for(var N=0;N<F.length;N++){F[N].src=this.uncheckedSrc}if(i.selected){F[i.selected-1].src=this.checkedSrc}}if(M){this.topCapSrc=M;p.src=M}if(Q){this.bottomCapSrc=Q;q.src=Q}};this.setColor= function(M){this.frame.style.backgroundColor=M};this.show= function(){this.frame.style.display="block"};this.hide= function(){this.frame.style.display="none"};this.getRadius= function(){return l};this.setRadius= function(O){m=O;var N=i.map.getGridSize().split(" ");var P=N[0];var M=N[1];if(P==M){l=O}else{l=(m/M)*P}};this.getRadiusX= function(){return m};this.setRadiusX= function(M){m=M};this.getZoomLevel= function(){return i.selected};this.setZoomValue= function(M){this.setZoomLevel(M)};this.setZoomLevel= function(N){if(N&&N<i.lowerBound||N>i.upperBound){throw new Exception("Error calling setZoomLevel, out of range");return false}i.selected=N;B();for(var M=0;M<F.length;M++){if(F[M].id=="decarta-z"+N){F[M].src=i.checkedSrc}if(Utilities.ie6){Utilities.fixPng(F[M])}}};this.getGXConvertedZoomLevel= function(){return Math.abs(21-i.selected)};this.zoomToNewLevel= function(N){if(N&&N<i.lowerBound||N>i.upperBound){throw new Exception("Error calling zoomToNewLevel, out of range");return false}B();for(var M=0;M<F.length;M++){if(F[M].id=="decarta-z"+N){F[M].src=i.checkedSrc}if(Utilities.ie6){Utilities.fixPng(F[M])}}i.map.zoomMap(N)};this.zoomInOneLevel= function(){if(i.selected<=i.lowerBound){return false}B();for(var M=0;M<F.length;M++){if(F[M].id=="decarta-z"+i.selected){F[M].src=i.checkedSrc}}i.map.zoomMap(parseInt(i.selected)-1)};this.zoomOutOneLevel= function(){if(i.selected==i.zoomLevels){return false}B();for(var M=0;M<F.length;M++){if(F[M].id=="decarta-z"+i.selected){F[M].src=i.checkedSrc}}i.map.zoomMap(parseInt(i.selected)+1)};this.getZoomLevelToFitBoundingBox= function(P){var S=parseInt(i.map.mapDiv.style.height)/2;var T=parseInt(i.map.mapDiv.style.width)/2;for(var R=20;R>0;--R){var O=Utilities.radsPerPixelAtZoom(this.map.getTileSize(),R);var V=Utilities.lat2pix(P.getCenterPosition().getLat(),O);var X=Utilities.lon2pix(P.getCenterPosition().getLon(),O);var Q=Utilities.pix2lat(V+S,O);var W=Utilities.pix2lon(X+T,O);var N=Utilities.pix2lat(V-S,O);var U=Utilities.pix2lon(X-T,O);var M=new BoundingBox(new Position(N,U),new Position(Q,W));if(M.contains(P.minPosition)&&M.contains(P.maxPosition)){return Math.abs(21-R);break}}};this.getZoomLevelToFitPositions= function(M){var N=Utilities.positionsToBoundingBox(M);return i.getZoomLevelToFitBoundingBox(N)};this.getZoomLevelToFitPins= function(P){var N=[];for(var O=0;O<P.length;O++){N[O]=P[O].position.clone()}var Q=Utilities.positionsToBoundingBox(N);var R=i.getZoomLevelToFitBoundingBox(Q);var M=Utilities.radsPerPixelAtZoom(i.map.getTileSize(),Math.abs(21-R));Q=Utilities.pinsToBoundingBox(P,M);return i.getZoomLevelToFitBoundingBox(Q)};this.appendThis= function(){if(!this.frame){this.initialize()}return this.frame};this.removeThis= function(){this.map=null;return this.frame};this.position= function(M){if(!this.map){return}this.frame.style.top="1px";this.frame.style.left="1px"};function B(){for(var M=0;M<F.length;M++){F[M].src=i.uncheckedSrc}}};