// Copyright (C) 2003-2008 AvantLogic Corporation: http://www.mapsalive.com
function maGetQueryStringArg(arg) {
var pairs = document.location.search.substring(1).split("&");
for (i = 0; i < pairs.length; i++)
{
var pair = pairs[i];
var eq = pair.indexOf('=');
if (pair.substring(0, eq).toLowerCase() == arg.toLowerCase())
return pair.substring(eq + 1);
}
return "";
}
if (!window.console || !console.firebug) { var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};} function maUaIs(ua) { return navigator.userAgent.toLowerCase().indexOf(ua) != -1;} var maClient = new Object();maClient.ie = ((navigator.appVersion.indexOf("MSIE") != -1) && (navigator.userAgent.search(/Opera/) == -1)) ? 1 : 0;maClient.ie6 = maClient.ie && (navigator.appVersion.indexOf("IE 6.") != -1);maClient.macintosh = maUaIs("macintosh");maClient.firefox = maUaIs("firefox");maClient.macFirefox = maClient.macintosh && maClient.firefox;maClient.safariLt3 = maUaIs("safari") && !maUaIs("safari/5");maClient.viewId = 0;maClient.tid = 1;maClient.guid = (new Date()).getTime()+""+Math.floor((Math.random()*8999)+1000);maClient.path = "";maClient.preview = false;maClient.page = false;maClient.unbranded = false;maClient.pinNextPopup = false;maClient.dirPreviewSlide = null;maClient.liveDataErrorSettings = null;maClient.popupOffset = 0;maClient.swfPath = function() { return maTour.editMode ? maTour.appRuntimeUrl : maClient.path;};function maAttachEventListener(target, eventType, functionRef) { if (typeof target.addEventListener != "undefined") target.addEventListener(eventType, functionRef, false);else target.attachEvent("on" + eventType, functionRef);return true; } maClient.elementHasNoId = function(e) { return e && (typeof e.id == 'undefined' || e.id.length === 0);};maClient.Flash = function() { };maClient.Flash.prototype.init = function(swf, id, mfn, pid, popups) { this.id = id;this.params = new Object();this.addParam('mapFileName', mfn);this.addParam('bgcolor', '');this.addParam('quality', 'high');this.addParam("swliveconnect", "true");this.addParam("wmode", "transparent");this.addParam('AllowScriptAccess', 'always');this.flashVars = new Object();this.addFlashVar("fv_blink", maClient.macFirefox && popups ? 0 : 1);this.addFlashVar("fv_clipId", id);this.addFlashVar("fv_guid", maClient.guid);this.addFlashVar("fv_ie", maClient.ie);this.addFlashVar("fv_pageId", pid);this.addFlashVar("fv_swf", maClient.path + swf); this.addFlashVar("fv_themeId", maClient.tid);this.addFlashVar("fv_popup", maTour.usesDynamicPopup || (maTour.usesFixedPopup && !maTour.popup.persist) ? 1 : 0);this.addFlashVar("fv_stageW", maTour.stageW);this.addFlashVar("fv_stageH", maTour.stageH);if (maTour.usesPopup) this.addFlashVar("fv_pinnable", maTour.popup.pinOnClick ? 1 : 0);};maClient.Flash.prototype.addParam = function(name, value) { this.params[name] = value;};maClient.Flash.prototype.addFlashVar = function(name, value) { this.flashVars[name] = value;};maClient.flashPresent = function() { return maClient.getPlayerVersion().major >= 7;};maClient.showFlashMsg = function() { var e = document.createElement("div");e.innerHTML = "This page needs Flash 7 or higher
" + "Click the button below to install
the latest version of Flash Player.
" + "After installation, close the Adobe
window and refresh this page.";var s = e.style;s.position = "absolute";s.zIndex = 1000;s.left = "30px";s.top = "30px";s.backgroundColor = "#f3f3f3";s.border = "1px solid #777777";s.color = "#000055";s.fontSize = "11px";s.fontFamily = "arial,helvetica,sans-serif";s.padding = "8px";s.textAlign = "center";s.width = "230px";var map = document.getElementById('maMap');if (!map) return;map.appendChild(e);var d = document.createElement("div");d.style.padding = "12px 0px 4px 0px";d.style.textAlign = "center";e.appendChild(d);var a = document.createElement("a");a.href = "http://macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";a.target = "_blank";d.appendChild(a);var i = document.createElement("img");i.src = maTour.editMode ? "../Runtime/get_flash_player.gif" : maClient.path + "0020_" + maTour.version + ".gif";i.style.border = 0;a.appendChild(i);};maClient.Flash.prototype.getParamTags = function() { var paramTags = "";for (var key in this.params) paramTags += '';return paramTags;};maClient.Flash.prototype.getFlashVars = function() { var pair = new Array();for (var key in this.flashVars) pair.push(key + "=" + this.flashVars[key]);return pair.join("&");};maClient.Flash.prototype.getHTML = function() { var fsid = 'fs' + this.id;var movidId = this.id == "mapViewer" ? "0001_" : "0000_";var movie = maClient.swfPath() + movidId + maTour.version + ".swf";var html = "";if (maClient.flashPresent()) { if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { html += '';} else { html += '';html += '';} } else { var url = maTour.editMode ? "ImageRenderer.ashx?type=map" : this.params["mapFileName"];var s = document.getElementById('maMap').style;s.backgroundImage = "url(" + url + ")";s.backgroundRepeat = "no-repeat";s.width = maTour.stageW + "px";s.height = maTour.stageH + "px";} return html;};maClient.Flash.prototype.write = function(elementId) { if (elementId) document.getElementById(elementId).innerHTML = this.getHTML();else document.write(this.getHTML());};maClient.Flash.prototype.editMarker = function(viewId) { maEditMarker(viewId);};maClient.Flash.prototype.editSlide = function(viewId) { maEditSlide(viewId);};function maCaptureMousePosition(event) { maClient.captureMousePosition(event);} maClient.captureMousePosition = function(event) { if (typeof event == "undefined") event = window.event;var scrollingPosition = maClient.getScrollingPosition();if (typeof event.pageX != "undefined" && typeof event.x != "undefined") { maClient.mouseX = event.pageX;maClient.mouseY = event.pageY;} else { maClient.mouseX = event.clientX + scrollingPosition[0];maClient.mouseY = event.clientY + scrollingPosition[1];} if (maClient.showingPreview) maClient.dirMovePreviewPanel();if (maClient.showingTooltip) maClient.moveTooltip();var movePopupWithMouse = maClient.showingPopup && maTour.usesDynamicPopup && maTour.popup.positionAtMouse && !maTour.popup.persist && !maClient.popupPinned;if (movePopupWithMouse) maClient.setPopupLocation(true);};maClient.showPage = function(pageId, slideId) { var page = maClient.getPageByPageId(pageId);if (page) { var url = "page" + page.pageNumber + ".htm";var slide = maClient.getSlideBySlideId(slideId);var viewId = slide ? slide.viewId : null;if (page.pageNumber != maTour.pageNumber) maClient.updateLevelState();maClient.goToPage(url, viewId, maClient.levelState);return true;} else { return false;} };maClient.goToPage = function(url, viewId, dirCollapseState) { var pn = url.substr(4, url.indexOf('.') - 4);if (maClient.preview) { var aid = maGetQueryStringArg("aid");var e = document.getElementById('TasksPanel');var sa = e && e.style.display == 'block';e = document.getElementById('SnippetsPanel');var ss = e && e.style.display == 'block';var tourId = maGetQueryStringArg("tourId");var accountId = maGetQueryStringArg("accountId");var tid = tourId.length > 0 ? "&tourId=" + tourId + "&accountId=" + accountId : "";var mid = viewId === null ? "" : "&marker=" + viewId;var find = "";var cs = "";if (maTour.hasDirectory) { if (dirCollapseState === null) { maClient.updateLevelState();dirCollapseState = maClient.levelState;} cs = "&cs=" + dirCollapseState;find = maClient.dirSearchText();if (find.length > 0) find = "&find=" + find;} window.location = 'TourPreview.aspx?aid=' + aid + '&pn=' + pn + '&sa=' + (sa ? '1' : '0') + '&ss=' + (ss ? '1' : '0') + tid + mid + cs + find;} else { if (maClient.page) { if (maClient.unbranded) url = url.substring(0, url.length - 4) + '_.htm';window.location = maClient.constructGoToPageUrl(url, viewId, dirCollapseState);} else { if (typeof maClient.hostPageUrl == 'undefined' || maClient.hostPageUrl.indexOf("#") == -1) { alert("This embedded MapsAlive tour has not been configured properly to allow page changes. A