// Copyright (C) 2003-2008 AvantLogic Corporation: http://www.mapsalive.com

function maGetQueryStringArg(arg)
{
	var q = document.location.search.toLowerCase();
	if (q && q.length > 1)
	{
		var i = q.indexOf(arg.toLowerCase() + "=");
		if (i > -1)
		{
			var j = (q.indexOf("&", i) > -1) ? q.indexOf("&", i) : q.length;
			return q.substring(q.indexOf("=", i) + 1, j);
		}
	}
	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("6.") != -1);maClient.macintosh = maUaIs("macintosh");maClient.macFirefox = maClient.macintosh && maUaIs('firefox');maClient.safariLt3 = maUaIs("safari") && !maUaIs("safari/5");maClient.markerId = 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.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('bgcolor', '');this.addParam('quality', 'high');this.addParam("swliveconnect", "true");this.addParam("wmode", "transparent");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.usesDynamicPopup) 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 = "<b>This page needs Flash 7 or higher</b><hr/>" + "Click the button below to install the latest version of Flash Player.<br/>" + "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.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 += '<param name="' + key + '" value="' + this.params[key] + '" />';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 += '<embed type="application/x-shockwave-flash" src="' + movie + '"';html += ' width="'+ maTour.stageW + '" height="' + maTour.stageH + '"';html += ' id="' + fsid + '" name="' + fsid + '"';for (var key in this.params) html += ' '+ key + '="' + this.params[key] + '"';html += ' flashvars="'+ this.getFlashVars() +'"';html += '></embed>';}  else  { html += '<script type="text/vbscript" language="VBScript">';html += 'Sub ' + fsid + '_FSCommand(ByVal command, ByVal args)';html += 'call ' + this.id + '.fs(command, args)';html += 'end sub';html += '</script>';html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';  html += ' width="' + maTour.stageW + '" height="' + maTour.stageH +'"';html += ' id="' + fsid +'">';html += '<param name="movie" value="' + movie + '" />';html += this.getParamTags();html += '<param name="flashvars" value="'+ this.getFlashVars() +'" />';html += '</object>';} } else { var url = maTour.editMode ? "ImageRenderer.ashx?type=map" : this.getAttribute('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(id) { maEditMarker(id);};maClient.Flash.prototype.editSlide = function(id) { maEditSlide(id);};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();};maClient.goToPage = function(url, markerId, 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 = typeof markerId == 'undefined' ? "" : "&marker=" + markerId;var find = "";var cs = "";if (maTour.hasDirectory) { if (typeof dirCollapseState == 'undefined') { maClient.levelState = maClient.dirMode.toString();maClient.dirSaveCollapseState(maClient.dirBodyLevels);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, markerId, 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 <script> tag is required to define maClient.hostPageUrl. The URL must contain a '#' as a placeholder for the page number. Contact support@mapsalive.com if you need assistance.");} else { url = maClient.hostPageUrl.replace(/#/, pn);window.location = maClient.constructGoToPageUrl(url, markerId, dirCollapseState);} } } };maClient.constructGoToPageUrl = function(url, markerId, dirCollapseState) { var mid = "";var cs = "";var find = "";var prefix = "";if (typeof markerId != 'undefined') { prefix = url.indexOf("?") == -1 ? "?" : "&";mid = prefix + "marker=" + markerId;} if (maTour.hasDirectory) { if (typeof dirCollapseState == 'undefined') { maClient.levelState = maClient.dirMode.toString();maClient.dirSaveCollapseState(maClient.dirBodyLevels);dirCollapseState = maClient.levelState;} if (dirCollapseState.length > 0) { prefix = prefix.length === 0 && url.indexOf("?") == -1 ? "?" : "&";cs = prefix + "cs=" + dirCollapseState;} find = maClient.dirSearchText();if (find.length > 0) { prefix = prefix.length === 0 && url.indexOf("?") == -1 ? "?" : "&";find = prefix + "find=" + find;} } return url + mid + cs + find;};maClient.Flash.prototype.goToPage = function(url) { if (url === null) return;var pathname = window.location.pathname;var pathsegs = pathname.split('/');var pathend = pathsegs[pathsegs.length- 1];if (pathend == url) return;maClient.goToPage(url);};maClient.Flash.prototype.hideMarkers = function(idList) { var id = idList.split(",");for (var i = 0; i < id.length; i++) maShowMarkerThumbAsHidden(id[i]);};maClient.Flash.prototype.linkToUrl = function(url) { if (url === null) return;try { var popup = url.substring(0,1) == "1";url = url.substring(1);if (popup) { var wnd = window.open(url, "_blank");if (wnd === null) { if (confirm("A popup blocker prevented the following page from being opened in a new window:\n\n" + url + "\n\nPress OK to open the page in the current window.")) window.location = url;} } else window.location = url;} catch (error) { alert('MapsAlive detected an error while trying to link to this URL:\n\n' + url + '\n\n' + error.message + '\n\nPlease report this problem to the author\n' + 'of this tour so that they can correct it.');} };maClient.Flash.prototype.markerCoordsChanged = function(coords) { maGetElementByPageId("MarkerCoords").value = coords;maChangeDetected();};maClient.Flash.prototype.zoomStateChanged = function(state) { maGetElementByPageId("ZoomState").value = state;maChangeDetected();};maClient.Flash.prototype.markerSelected = function(id) { maShowSelectedMarkerThumb(id);maShowMarkerInSlideList(id);};maClient.Flash.prototype.execJavascript = function(script) { try { maClient.hideTooltip();eval(script);} catch (error) { alert('MapsAlive detected an error in the following\n' + 'JavaScript that was provided for this marker:\n\n' + script + '\n\n' + error.message + '\n\nPlease report this problem to the author\n' + 'of this tour so that they can correct it.');} };maClient.Flash.prototype.markerDeselected = function(id) { maDeselectSelectedMarkerThumb();};maClient.Flash.prototype.viewChanged = function(id, x, y, w, h, mouseX, mouseY, isDirEntry) { var dirEntryClicked = isDirEntry == "1";if (maTour.hasDirectory && maClient.dirShowing) { if (maClient.dirMouseIsOver && !dirEntryClicked) { return;} else { maClient.dirShow(false);} } if (maTour.usesPopup) { if (typeof maClient.popupDelayAfterIntervalId != "undefined") clearInterval(maClient.popupDelayAfterIntervalId);maClient.popupPersisted = false;if (maClient.showingPopup && id == maTour.marker.id) return;if (maClient.pinNextPopup && maClient.markerOnQueryString.length !== 0) { if (id != maClient.markerOnQueryString) maClient.pinNextPopup = false;}		 }	 maTour.marker.id = parseInt(id,10);maTour.marker.x = x;maTour.marker.y = y;maTour.marker.w = w;maTour.marker.h = h;if (!dirEntryClicked && !maClient.markersAreDisabled && (maTour.usesPopup && maTour.popup.delayType == 1 && maTour.popup.delay !== 0)) { maClient.popupDelayBeforeIntervalId = setTimeout("maClient.slideChanged(true);", maTour.popup.delay);} else { if (dirEntryClicked || (maClient.markersAreDisabled && maTour.popup.pinOnClick)) { maClient.pinNextPopup = true;} else { if (maClient.popupPinned) { maClient.popupSetControlPanelState(false, false, false);} } maClient.slideChanged(!dirEntryClicked);} };maClient.slideChanged = function(positionPopupAtMouse) { maClient.slide = maClient.getSlide(maTour.marker.id);maClient.changeSlide(positionPopupAtMouse && !maClient.pinNextPopup);if (maTour.usesPopup) { if (maClient.pinNextPopup) maClient.persistPopup(true);maClient.showPopup(true);} };maClient.Flash.prototype.showTooltip = function(text,x,y) { maClient.showTooltip('mapViewer', parseInt(x,10), parseInt(y,10), text);};maClient.Flash.prototype.hideTooltip = function() { maClient.hideTooltip();};maClient.Flash.prototype.markerMouseOut = function() { maClient.hideTooltip();if (typeof maClient.popupDelayBeforeIntervalId != "undefined") clearInterval(maClient.popupDelayBeforeIntervalId);var hidablePopup = maTour.usesDynamicPopup || (maTour.usesFixedPopup && !maTour.popup.persist);if (!hidablePopup) return;if (maTour.popup.persist && maClient.popupPersisted) return;if (maTour.popup.pinOnClick && maClient.popupPinned) return;maClient.hidePopup(maClient.popupAfterDelay());};maClient.Flash.prototype.fs = function(command, argstring) { var args = argstring.split('\2');switch(command) { case "editMarker": this.editMarker(args[0]);break;case "editSlide": this.editSlide(args[0]);break;case "execJavascript": this.execJavascript(args[0]);break;case "goToPage": this.goToPage(args[0]);break;case "hideMarkers": this.hideMarkers(args[0]);break;case "hidePopup": this.hidePopup();break;case "hideTooltip": this.hideTooltip();break;case "linkToUrl": this.linkToUrl(args[0]);break;case "markerCoordsChanged": this.markerCoordsChanged(args[0]);break;case "markerDeselected": this.markerDeselected(args[0]);break;case "markerMouseOut": this.markerMouseOut();break;case "markerSelected": this.markerSelected(args[0]);break;case "pinnableMarkerClicked": this.pinnableMarkerClicked();break;case "showTooltip": this.showTooltip(args[0],args[1],args[2]);break;case "zoomStateChanged": this.zoomStateChanged(args[0]);break;case "viewChanged": this.viewChanged(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);break;default: break;} };maClient.Flash.prototype.invokeGateway = function(method,args,position) { var gatewayTagId = this.id + "Gateway";var newGatewayTag = document.createElement("div");newGatewayTag.innerHTML = "<embed " +  "id='" + gatewayTagId + "' " + "style='position:absolute' " + "src='" + maClient.swfPath() + "0002_" + maTour.version + ".swf' " + "FlashVars='" + "movie=" + this.id + maClient.guid + "&method=" + method + "&args=" + args.join(',') + "' " + "width='1' height='1' wmode='transparent' type='application/x-shockwave-flash'>" + "</embed>";var parentTagId = this.id == "mapViewer" ? "maLayout" : "Gateway" + position;var previousGatewayTag = document.getElementById(gatewayTagId);var parent = document.getElementById(parentTagId);if (previousGatewayTag) previousGatewayTag.parentNode.removeChild(previousGatewayTag);parent.insertBefore(newGatewayTag.firstChild, parent.firstChild);};maClient.getPlayerVersion = function() { var playerVersion = new maClient.PlayerVersion([0,0,0]);if (navigator.plugins && navigator.mimeTypes.length) { var plugin = navigator.plugins["Shockwave Flash"];if (plugin && plugin.description) { playerVersion = new maClient.PlayerVersion(plugin.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));} } else { var axo;try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");} catch(e) { try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");playerVersion = new maClient.PlayerVersion([6,0,21]);axo.AllowScriptAccess = "always";  } catch(e) { if (playerVersion.major == 6) { return playerVersion;} } try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");} catch(e) {} } if (axo !== null) { playerVersion = new maClient.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));} } return playerVersion;};maClient.PlayerVersion = function(arrVersion) { this.major = arrVersion[0] !== null ? parseInt(arrVersion[0],10) : 0;this.minor = arrVersion[1] !== null ? parseInt(arrVersion[1],10) : 0;this.rev = arrVersion[2] !== null ? parseInt(arrVersion[2],10) : 0;};maClient.getSlide = function(id) { return maClient.slides[id];};maClient.lookupString = function(index) { return maTour.stringTable[index];};maClient.showSlide = function(id, isDirEntry) { if (id == -1) return;if (typeof mapViewer == "undefined") { maTour.marker.id = parseInt(id,10);maTour.marker.x = 0;maTour.marker.y = 0;maTour.marker.w = 0;maTour.marker.h = 0;maClient.changeSlide(false);} else { if (maTour.usesDynamicPopup) { if (maClient.markerId == id && maClient.popupPanel.style.visibility == "visible") { maClosePopup();return;} maClient.pinNextPopup = maTour.popup.pinOnClick || maTour.popup.persist;}	 maClient.hidePopup(0);mapViewer.selectMarkerAndShowView(id, typeof isDirEntry == 'undefined' ? 0 : isDirEntry);} };maClient.showMarker = function(id, show) { if (typeof mapViewer == "undefined") return;mapViewer.showMarkerSelected(id, show);};maClient.setText = function(e, index) { if (!e) return;var text;if (index == 1) text = maClient.getSlide(maClient.markerId).title;else text = maClient.getSlide(maClient.markerId).htmlText;try { if (index == 1 && text.substring(0,1) == '_') { text = text.substring(1);} if (index == 2 && text.length === 0) { e.style.display = 'none';}	 else { e.style.display = 'block';e.innerHTML = text;} } catch(error) { e.innerHTML='The browser reported an error: ' + error.message;} };maClient.setSlideSelector = function() { var dropdownList = document.getElementById('maSlideDropdown');if (dropdownList) { for (var option = 0; option < dropdownList.options.length; option++) { if (dropdownList.options[option].value == maClient.markerId) { dropdownList.options[option].selected = true;dropdownList.selectedIndex = dropdownList[option].index;break;} } } };maClient.setLeftMenuItem = function() { var slideNamesInMenu = document.getElementById('maSlideNamesInMenu');if (slideNamesInMenu) { var newSelectedViewId = document.getElementById("ma" + maClient.markerId);if (newSelectedViewId) { var oldSelectedViewId = document.getElementById("ma" + maTour.selectedViewId);if (oldSelectedViewId)  oldSelectedViewId.className = '';newSelectedViewId.className = "currentSlide";maTour.selectedViewId = maClient.markerId;} } };maClient.getTextHeight = function(textWidth) { maClient.textArea.style.width = textWidth + "px";maClient.textArea.style.height = "auto";return maClient.textArea.offsetHeight;};maClient.setActualPopupWidth = function(w) { maTour.popup.actualW = Math.max(w, maTour.popup.minW);maClient.popupPanel.style.width = maTour.popup.actualW + "px";};maClient.adjustTextAreaSize = function() { switch (maTour.layout) { case "HMMTI": case "HTIMM": case "HITMM": case "HMMIT": case "VIITT": case "VTTII": var extraTextW = 0;if (maClient.textArea.style.position == "absolute") { if (maTour.layout == "HMMIT" || maTour.layout == "HITMM") { var noLeftImage = maTour.image.deltaW == maTour.imageAreaW;if (noLeftImage) extraTextW = maTour.layoutSpacingV;	 } maClient.textArea.style.width = maTour.textAreaW + maTour.image.deltaW + extraTextW + "px";maClient.textArea.style.left = maClient.textAreaLeft - maTour.image.deltaW - extraTextW + "px";} if (maTour.layout == "HMMTI" || maTour.layout == "HTIMM" || maTour.layout == "VTTII") { var pb = document.getElementById("maAbsBlock");pb.style.width = maTour.image.width + "px";pb.style.left = maTour.layoutMarginLeft + maTour.textAreaW + maTour.image.deltaW + maTour.layoutSpacingV + "px";} maClient.textArea.style.height = maTour.textAreaH + "px";break;case "VMMTI": case "VTIMM": case "HTTII": maClient.textArea.style.width = maTour.textAreaW + "px";maClient.textArea.style.height = "auto";if (maClient.textArea.offsetHeight >= maTour.textAreaH + maTour.image.deltaH) { maClient.textArea.style.height = maTour.textAreaH + maTour.image.deltaH + "px";} break;case "VMMIT": case "VITMM": case "HIITT": var noTopImage = maTour.image.deltaH == maTour.imageAreaH;var displayMode = noTopImage ? 'none' : 'block';maClient.slideImg.style.display = displayMode;  var maSlideImageArea = document.getElementById("maSlideImageArea");if (maSlideImageArea) maSlideImageArea.style.display = displayMode;maClient.textArea.style.marginTop = (noTopImage ? 0 : maTour.layoutSpacingH) + "px";var extraTextH = noTopImage ? maTour.layoutSpacingH : 0;maClient.textArea.style.height = maTour.textAreaH + maTour.image.deltaH + extraTextH + "px";maClient.textArea.style.width = maTour.textAreaW + "px";break;default: maClient.textArea.style.width = maTour.textAreaW + "px";maClient.textArea.style.height = maTour.textAreaH + "px";break;} maClient.textArea.style.overflow = "auto";};maClient.slideImageSrc = function(slide) { if (slide.imageLoaded) { return slide.image.src;} else { return slide.imageSrc;} };maClient.setSlideImage = function() { maClient.slideImg.style.width = maClient.slide.imageW + "px";maClient.slideImg.style.height = maClient.slide.imageH + "px";maClient.slideImg.src = maClient.slideImageSrc(maClient.slide);};maClient.setSlideText = function() { if (maTour.showSlideTitle) maClient.setText(maClient.slideTitle, 1);maClient.setText(maClient.slideText, 2);};maClient.getSlideImageData = function() { var id = maClient.markerId;maTour.image.width = maClient.slide.imageW;maTour.image.height =maClient.slide.imageH;maTour.image.deltaW = maTour.imageAreaW - maTour.image.width;maTour.image.deltaH = maTour.imageAreaH - maTour.image.height;};maClient.changeSlide = function(positionPopupAtMouse) { var markerChanged = maTour.marker.id != maClient.markerId;  var changeImage = maClient.slideImg !== null && !maTour.infoPage;if (markerChanged) { maClient.markerId = maTour.marker.id;maClient.setSlideText();if (changeImage) maClient.getSlideImageData();} if (maTour.usesPopup) { maClient.setPopupSize();maClient.setPopupLocation(positionPopupAtMouse);} else if (maClient.textArea) { maClient.adjustTextAreaSize();} maClient.setSlideSelector();maClient.setLeftMenuItem();if (changeImage) maClient.setSlideImage();};maClient.getScrollingPosition = function() { var position = [0, 0];if (typeof window.pageYOffset != 'undefined') { position = [window.pageXOffset,	window.pageYOffset];} else if (typeof document.documentElement.scrollTop != 'undefined' && (document.documentElement.scrollTop > 0 || document.documentElement.scrollLeft > 0)) { position = [document.documentElement.scrollLeft, document.documentElement.scrollTop];} else if (typeof document.body.scrollTop != 'undefined') { position = [document.body.scrollLeft, document.body.scrollTop];} return position;};maClient.getViewportSize = function() { var size = [0, 0];if (typeof window.innerWidth != 'undefined') { size = [window.innerWidth,	window.innerHeight];} else if (typeof document.documentElement != 'undefined'	&& typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth !== 0) { size = [document.documentElement.clientWidth, document.documentElement.clientHeight];} else { size = [document.getElementsByTagName('body')[0].clientWidth, document.getElementsByTagName('body')[0].clientHeight];} return size;};maClient.getRect = function(side, size, scroll) { var rect = new Object;var absX = parseInt(maTour.marker.absX,10);var absY = parseInt(maTour.marker.absY,10);var scrollW = scroll[0];var scrollH = scroll[1];var w = size[0];var h = size[1];switch (side) { case "top": rect.x = scrollW;rect.y = scrollH;rect.w = w;rect.h = absY - scrollH;break;case "bottom": rect.x = scrollW;rect.y = scrollH + absY;rect.w = w;rect.h = h - (absY - scrollH);break;case "right": rect.x = scrollW + absX;rect.y = scrollH;rect.w = w - (absX - scrollW);rect.h = h;break;case "left": rect.x = scrollW;rect.y = scrollH;rect.w = absX - scrollW;rect.h = h;break;default: break;} var e = document.getElementById("maSlideDropdown");if (e) { var ddH = 24;var ddW = e.offsetWidth;var ddPt = maClient.tagLocation(null, "maSlideDropdown");var ddBottom = ddPt.y + ddH;var ddLeft = ddPt.x + scrollW;var ddRight = ddLeft + ddW;var ddLeftInRect = ddLeft >= rect.x && ddLeft <= rect.x + rect.w;var ddRightInRect = ddRight >= rect.x && ddRight <= rect.x + rect.w;var ddBottomInRect = ddBottom >= rect.y;if (ddBottomInRect && (ddLeftInRect || ddRightInRect)) { rect.h = absY - ddBottom;rect.y = ddBottom;} } return rect;};maClient.clippedArea = function(popupW, popupH, areaW, areaH) { var deltaW = Math.max(popupW - areaW, 0);var deltaH =  Math.max(popupH - areaH, 0);var clippedV = 0;var clippedH = 0;if (deltaW > 0) clippedV = deltaW * popupH;if (deltaH > 0) clippedH = deltaH * (popupW - deltaW);return clippedV + clippedH;};maClient.tagLocation = function(outerTagId, innerTagId) { var e = document.getElementById(innerTagId);var left = 0;var top = 0;while (e && (outerTagId === null || e.id != outerTagId)) { left += e.offsetLeft;top += e.offsetTop;e = e.offsetParent;} var pt = new Object();pt.x = left;pt.y = top;return pt;};maAttachEventListener(window, "load", maEndLoad);maAttachEventListener(window, "resize", maResizeEvent);maAttachEventListener(document, "mousemove", maCaptureMousePosition);function maResizeEvent() { if (!maClient.ie6) maClosePopup();} function maEndLoad() { if (document.getElementById('maMap') && !maClient.flashPresent()) maClient.showFlashMsg();if (maTour.editMode) return;maClient.showingTooltip = false;maClient.showingPopup = false;maClient.markersAreDisabled = false;maClient.popupPinned = false;maClient.loadGraphics();maClient.loadSlideTable();if (maClient.slidesImageList.length > 0) { maClient.okayToPreload = true;maClient.preloadIntervalId = setInterval(maClient.loadNextSlideImage, 10);} maClient.maTour = document.getElementById('maTour');maTour.mapLocationRelative = maClient.tagLocation("maTour", "maMap");if (maTour.usesPopup) { maClient.createPopupPanel();} else { maClient.slideImg = document.getElementById("maSlideImage");maClient.slideTitle = document.getElementById("maSlideTitle");maClient.slideText = document.getElementById("maSlideText");maClient.textArea = document.getElementById("maTextArea");if (maClient.textArea && maClient.textArea.style.position == "absolute") { var leftPx = maClient.textArea.style.left;maClient.textAreaLeft = parseInt(leftPx.substr(0, leftPx.length - 2),10);} if (maTour.infoPage && maClient.textArea) { maClient.textArea.style.width = maTour.textAreaW + "px";maClient.textArea.style.height = maTour.textAreaH + "px";maClient.textArea.style.overflow = "auto";maClient.showSlide(maTour.selectedViewId, false);} else if (maTour.layout == "HIITT" || maTour.layout == "HTTII" || maTour.layout == "VIITT" || maTour.layout == "VTTII" || maTour.layout == "HTT") { maClient.showSlide(maTour.selectedViewId, false);} } if (maClient.slideImg) { var hidden = maTour.usesDynamicPopup || (maTour.usesFixedPopup && !maTour.popup.persist);if (hidden) { maClient.slideImg.src = maClient.graphics["blank"].src;} else { maClient.slideImg.src = maClient.path + maTour.firstImageSrc;maClient.slideImg.style.visibility = "visible";} } if (maTour.hasDirectory) maClient.dirInit();} maClient.loadGif = function(id, name) { maClient.loadImg(id, name, "gif");};maClient.loadImg = function(id, name, ext) { var image = new Image();image.src = maClient.path + "00" + id + "_" + maTour.version + "." + ext;maClient.graphics[name] = image;};maClient.loadGraphics = function() { maClient.graphics = new Object();maClient.loadGif(27, "blank");if (maTour.usesDynamicPopup) { maClient.loadGif(24, "closeX");maClient.loadGif(25, "pinUp");maClient.loadGif(26, "pinDown");if (maTour.popup.arrowType !== 0) { maClient.loadGif(30, "left1");maClient.loadGif(31, "left2");maClient.loadGif(32, "right1");maClient.loadGif(33, "right2");maClient.loadGif(34, "up1");maClient.loadGif(35, "up2");maClient.loadGif(36, "down1");maClient.loadGif(37, "down2");} } if (maTour.hasDirectory) { maClient.loadImg(50, "sortAlpha", "png");maClient.loadImg(51, "sortGroup", "png");} };maClient.loadSlideTable = function() { for (var stringIndex = 0; stringIndex < maTour.stringTable.length; stringIndex++) { var text = unescape(maTour.stringTable[stringIndex]);text = text.replace(/src=":/g, 'src="' + maClient.path);maTour.stringTable[stringIndex] = text;} var div = document.createElement("div");maClient.slidesImageList = new Array();maClient.slideListIndex = 0;var slides = new Object();for (var slideIndex = 0; slideIndex < maTour.slideTable.length; slideIndex++) { var data = maTour.slideTable[slideIndex].split(',');var slideId = data[0];var htmlText = maClient.lookupString(data[2]);var plainText = "";var imageW = parseInt(data[4], 10);var imageH = parseInt(data[5], 10);var pageNumber = parseInt(data[6], 10);if (maTour.hasDirectory) { div.innerHTML = htmlText;plainText = maClient.getInnerText(div);} var slide = new maSlide( slideId, maClient.lookupString(data[1]), htmlText, plainText, maClient.lookupString(data[3]), imageW, imageH, pageNumber, maClient.lookupString(data[7]));slides[slideId] = slide;if (imageW > 0) maClient.slidesImageList.push(slide);} maClient.slides = slides;};maClient.getInnerText = function(e) { var plainText = e.innerText;if (typeof plainText == 'undefined') plainText = e.textContent;if (typeof plainText == 'undefined' || (plainText.length === 0 && maClient.safariLt3)) { plainText = e.innerHTML.replace(/<[^>]*>/g,'');} return plainText;};maClient.deriveAltColor = function(hexColor) { var hex = '0123456789abcdefe';var c = hexColor.substr(6,1);var i = hex.indexOf(c.toLowerCase());return hexColor.substr(0,6) + hex.substr(i + 1,1);};maClient.MapViewer = function(swf, id, mfn, pid, popups) { this.init(swf, id, mfn, pid, popups);this.addFlashVar("fv_mapPath", maClient.path);maClient.markerOnQueryString = maGetQueryStringArg("marker");if (maClient.markerOnQueryString.length !== 0) { this.addFlashVar("fv_markerId", maClient.markerOnQueryString);if (maTour.usesDynamicPopup) maClient.pinNextPopup = true;} };maClient.MapEditor = function(swf, id) { this.init(swf, id, "", 0, false);this.addFlashVar("fv_mapPath", maTour.tourFolderUrl + maTour.tourId + "_/");};maClient.MapViewer.prototype = maClient.Flash.prototype;maClient.MapViewer.prototype.selectMarkerAndShowView = function(markerid, isDirEntry) { this.invokeGateway("selectMarkerAndShowView",[markerid, isDirEntry ? 1 : 0]);};maClient.MapViewer.prototype.showMarkerSelected = function(markerid, show) { this.invokeGateway("showMarkerSelected",[markerid, show ? 1 : 0]);};maClient.MapViewer.prototype.disableMarkers = function(disable) { this.invokeGateway("disableMarkers",[disable]);};maClient.MapViewer.prototype.saveState = function(save) { this.invokeGateway("saveState",[save],1);};maClient.MapEditor.prototype = maClient.Flash.prototype;maClient.MapEditor.prototype.selectMarker = function(markerid,gateway) { this.invokeGateway("selectMarker",[markerid],gateway);};maClient.showTooltip = function(tag, x, y, text) { if (text.length === 0) return;if (!maClient.tooltip) { maClient.tooltip = document.createElement("div");maClient.tooltip.setAttribute("id", "maTooltip");document.body.appendChild(maClient.tooltip);} maClient.tooltip.innerHTML = text;maClient.tooltip.style.visibility = "visible";maClient.showingTooltip = true;maClient.moveTooltip();};maClient.disableMarkers = function(disable) { if (disable == maClient.markersAreDisabled) return;maClient.markersAreDisabled = disable;mapViewer.disableMarkers(disable ? 1 : 0);};maClient.hideTooltip = function() { if (maClient.showingTooltip) { maClient.tooltip.style.visibility= "hidden";maClient.showingTooltip = false;} };maClient.moveTooltip = function() { var s = maClient.tooltip.style;s.left = (parseInt(maClient.mouseX, 10) + 8) + 'px';s.top = (parseInt(maClient.mouseY, 10) - 12) + 'px';};function maOnImageError() { maClient.okayToPreload = true;} function maOnImageLoad() { this.slide.imageLoaded = true;maClient.okayToPreload = true;} maClient.loadNextSlideImage = function() { if (maClient.okayToPreload) { maClient.okayToPreload = false;var slide = maClient.slidesImageList[maClient.slideListIndex];maClient.slideListIndex++;if (maClient.slideListIndex >= maClient.slidesImageList.length) clearInterval(maClient.preloadIntervalId);slide.image.src = slide.imageSrc;} };function maSlide(id, title, htmlText, plainText, imageSrc, imageW, imageH, pageNumber, pageName) { this.id = id;this.title = title;this.htmlText = htmlText;this.plainText = plainText;this.imageSrc = maClient.path + imageSrc;this.imageW = imageW;this.imageH = imageH;this.imageLoaded = false;if (imageW > 0) { this.image = new Image();this.image.slide = this;this.image.onload = maOnImageLoad;this.image.onerror = maOnImageError;} this.pageNumber = pageNumber;this.pageName = pageName;this.inSearchResults = true;this.searchStart = -1;this.searchLength = 0;} maClient.runtimeImage = function(id, ext) { return maClient.path + "00" + id + "_" + maTour.version + "." + ext;};function maClosePopup() { if (maClient.popupPanel) maClient.hidePopup(0);} maClient.createPopupPanel = function() { if (maTour.usesFixedPopup) { maTour.popup.arrowType = 0;} if (maTour.popup.arrowType !== 0) { e = document.createElement("img");e.setAttribute("id", "maArrow");e.style.visibility = "hidden";e.style.zIndex = 3001;e.style.position = "absolute";e.style.top = "0px";e.style.left = "0px";document.body.appendChild(e);maClient.arrowPanel = e;if (maTour.usesDynamicPopup && maTour.popup.persist) { maAttachEventListener(e, "mouseover", maPopupMouseOver);maAttachEventListener(e, "mouseout", maPopupMouseOut);} } maTour.popup.backgroundColorAlt = maClient.deriveAltColor(maTour.popup.backgroundColor);e = document.createElement("div");e.setAttribute("id", "maPopup");e.style.textAlign = "left";e.style.visibility = "hidden";e.style.zIndex = 3000;e.style.position = "absolute";e.style.backgroundColor = maTour.popup.backgroundColor;e.style.borderTop = maTour.popup.borderTop;e.style.borderRight = maTour.popup.borderRight;e.style.borderBottom = maTour.popup.borderBottom;e.style.borderLeft = maTour.popup.borderLeft;if (maTour.usesDynamicPopup && maTour.popup.persist) { maAttachEventListener(e, "mouseover", maPopupMouseOver);maAttachEventListener(e, "mouseout", maPopupMouseOut);} maClient.popupPanelWidth = maTour.popup.maxW;if (maTour.usesFixedPopup) { e.style.top = maTour.popup.top + "px";e.style.left = maTour.popup.left + "px";maClient.maTour.appendChild(e);} else { e.style.width = maTour.popup.minW + "px";e.style.height = maTour.popup.minH + "px";e.style.top = "0px";e.style.left = "0px";document.body.appendChild(e);} maClient.popupPanel = e;maClient.popupControlPanelH = 0;if (maTour.usesDynamicPopup) { maClient.popupControlPanelH = 15;e = document.createElement("div");e.id = "maPopupControlPanel";e.style.height = maClient.popupControlPanelH + "px";e.style.zIndex = 3000;maClient.popupControlPanel = e;maClient.popupPanel.appendChild(maClient.popupControlPanel);e = document.createElement("img");e.onclick = maClosePopup;e.src = maClient.graphics["closeX"].src;e.style.display = "none";e.style.width = "12px";e.style.height = "12px";e.style.zIndex = 3002;e.style.position = "absolute";e.style.cursor = "pointer";document.body.appendChild(e);maClient.popupControlPanelCloseX = e;e = document.createElement("img");e.id = "maPopupPin";e.onclick = maPopupClickPin;e.style.display = "none";e.style.width = "14px";e.style.height = "14px";e.style.zIndex = 3002;e.style.position = "absolute";e.style.cursor = "pointer";document.body.appendChild(e);maClient.popupControlPanelPin = e;e = document.createElement("div");e.id = "maPopupPinMsg";e.style.display = "none";e.innerHTML = maTour.popup.pinMsg;e.style.fontFamily = "arial,helvetica,sans-serif";e.style.fontSize = "9px";e.style.overflow = "hidden";e.style.height = "14px";e.style.zIndex = 3001;e.style.position = "absolute";e.style.cursor = "pointer";document.body.appendChild(e);maClient.popupControlPanelPinMsg = e;} var mT = maTour.layoutMarginTop + "px ";var mR = maTour.layoutMarginRight + "px ";var mB = maTour.layoutMarginBottom + "px ";var mL = maTour.layoutMarginLeft + "px ";var mH = maTour.layoutSpacingH + "px ";var mV = maTour.layoutSpacingV + "px ";var mNone = "0px ";if (maTour.layout != "HTT" && maTour.layout != "HMM") { maClient.slideImg = document.createElement("img");maClient.slideImg.setAttribute("id", "maSlideImage");maClient.slideImg.style.margin = mT + mR + mNone + mL;} else { maClient.slideImg = null;} if (maTour.layout != "HII" && maTour.layout != "HMM") { maClient.textArea = document.createElement("div");if (maTour.showSlideTitle) { maClient.slideTitle = document.createElement("div");maClient.slideTitle.setAttribute("id", "maSlideTitle");maClient.textArea.appendChild(maClient.slideTitle);} maClient.slideText = document.createElement("div");maClient.slideText.setAttribute("id", "maSlideText");maClient.slideText.style.marginTop = (maTour.showSlideTitle ? 4 : 0) + "px";maClient.textArea.appendChild(maClient.slideText);} switch (maTour.layout) { case "HIITT": maClient.slideImg.style.margin =  mT + mR + mH + mL;maClient.textArea.style.margin = "0px " + mR + mB + mL;maClient.popupPanel.appendChild(maClient.slideImg);maClient.popupPanel.appendChild(maClient.textArea);maClient.popupPanel.style.width = maClient.popupPanelWidth + "px";break;case "HTTII": maClient.slideImg.style.margin = mH + mR + mB + mL;maClient.textArea.style.margin = mT + mR + "0px " + mL;maClient.popupPanel.appendChild(maClient.textArea);maClient.popupPanel.appendChild(maClient.slideImg);maClient.popupPanel.style.width = maClient.popupPanelWidth + "px";break;case "VIITT": case "VTTII": var table = document.createElement("table");var tbody = document.createElement("tbody");table.setAttribute("cellPadding", "0");table.setAttribute("cellSpacing", "0");var row = document.createElement("tr");var cell1 = document.createElement("td");var cell2 = document.createElement("td");cell1.style.verticalAlign = "top";cell2.style.verticalAlign = "top";row.appendChild(cell1);row.appendChild(cell2);tbody.appendChild(row);table.appendChild(tbody);maClient.popupPanel.appendChild(table);if (maTour.layout == "VIITT") { maClient.textArea.style.margin = mT + mR + mB + mNone;cell2.style.textAlign = "left";maClient.slideImg.style.margin = mT + mV + mB + mL;cell1.appendChild(maClient.slideImg);cell2.appendChild(maClient.textArea);} else { maClient.textArea.style.margin = mT + mNone + mB + mL;cell1.style.textAlign = "left";maClient.slideImg.style.margin = mT + mR + mB + mV;cell1.appendChild(maClient.textArea);cell2.appendChild(maClient.slideImg);} break;case "HII": maClient.slideImg.style.margin = mT + mR + mB + mL;maClient.popupPanel.appendChild(maClient.slideImg);break;case "HTT": maClient.textArea.style.margin = mT + mR + mB + mL;maClient.popupPanel.appendChild(maClient.textArea);maClient.popupPanel.style.width = maClient.popupPanelWidth + "px";break;default: break;} };maClient.Flash.prototype.hidePopup = function() { maClient.hidePopup(0);};maClient.hidePopup = function(delay) { if (typeof maClient.popupDelayAfterIntervalId != "undefined") clearInterval(maClient.popupDelayAfterIntervalId);if (maTour.usesFixedPopup && maTour.popup.persist) return;if (delay > 0) maClient.popupDelayAfterIntervalId = setTimeout("maClient.showPopup(false);", delay);else maClient.showPopup(false);};maClient.Flash.prototype.pinnableMarkerClicked = function() { maClient.persistPopup(true);};maClient.persistPopup = function(pin) { if (!maClient.showingPopup && !maClient.pinNextPopup) { return;} maClient.popupSetControlPanelState(true, true, pin);maClient.popupPersisted = true;};maClient.popupLocation = function(positionPopupAtMouse) { if (!maTour.popup.positionAtMouse) positionPopupAtMouse = false;var hasMarker = parseInt(maTour.marker.x,10) > 0 && parseInt(maTour.marker.y,10) > 0;var markerX = 64;var markerY = 64;if (hasMarker && !positionPopupAtMouse) { markerX = parseInt(maTour.marker.x, 10);markerY = parseInt(maTour.marker.y, 10);} var arrowSize = 0;if (hasMarker) { if (maTour.popup.arrowType === 0) arrowSize = positionPopupAtMouse ? -1 : 4;else if (maTour.popup.arrowType == 1) arrowSize = 18;else if (maTour.popup.arrowType == 2) arrowSize = 36;}  var arrowOffset = arrowSize > 0 ? arrowSize - maTour.popup.borderWidth + 1 : -4;if (maTour.popup.persist && !positionPopupAtMouse) arrowOffset -= 8;var popupOffsetX = arrowOffset;var popupOffsetY = arrowOffset;if (!positionPopupAtMouse) { popupOffsetX += maTour.marker.w / 2;popupOffsetY += maTour.marker.h / 2;} var pt = maClient.tagLocation(null, "maMap");maTour.marker.absX = positionPopupAtMouse ? maClient.mouseX : Number(pt.x) + Number(markerX);maTour.marker.absY = positionPopupAtMouse ? maClient.mouseY - 4 : Number(pt.y) + Number(markerY);var size = maClient.getViewportSize();var scroll = maClient.getScrollingPosition();maTour.marker.rectTop = maClient.getRect("top", size, scroll);maTour.marker.rectBottom = maClient.getRect("bottom", size, scroll);maTour.marker.rectRight = maClient.getRect("right", size, scroll);maTour.marker.rectLeft = maClient.getRect("left", size, scroll);var borders = maTour.popup.borderWidth * 2;var popupW = maTour.popup.actualW + borders;var popupH = maTour.popup.actualH + borders;var clippedArea = new Object();var bestSide;clippedArea.right = maClient.clippedArea(popupW, popupH, (maTour.marker.rectRight.w - popupOffsetX), maTour.marker.rectRight.h);clippedArea.least = clippedArea.right;bestSide = "right";if (clippedArea.least > 0) { clippedArea.bottom = maClient.clippedArea(popupW, popupH, maTour.marker.rectBottom.w, (maTour.marker.rectBottom.h - popupOffsetY));if (clippedArea.bottom < clippedArea.least) { clippedArea.least = clippedArea.bottom;bestSide = "bottom";} } if (clippedArea.least > 0) { clippedArea.left = maClient.clippedArea(popupW, popupH, (maTour.marker.rectLeft.w - popupOffsetX), maTour.marker.rectLeft.h);if (clippedArea.left < clippedArea.least) { clippedArea.least = clippedArea.left;bestSide = "left";} } if (clippedArea.least > 0) { clippedArea.top = maClient.clippedArea(popupW, popupH, maTour.marker.rectTop.w, (maTour.marker.rectTop.h - popupOffsetY));if (clippedArea.top < clippedArea.least) { if (clippedArea.top === 0 || !document.getElementById("maSlideDropdown")) { clippedArea.least = clippedArea.top;bestSide = "top";} } } switch (bestSide) { case "left" : case "right" : pt = maClient.positionPopupLeftOrRight(bestSide, popupOffsetX, arrowSize, scroll);break;case "top" : case "bottom" : pt = maClient.positionPopupUpOrDown(bestSide, popupOffsetY, arrowSize, scroll);break;default: break;} return pt;};function maPopupMouseOut(event) { if (maClient.popupPinned) return;var related = typeof event.relatedTarget != 'undefined' ? event.relatedTarget : event.toElement;var elementHasNoId = maClient.elementHasNoId(related);while (related && maClient.elementHasNoId(related)) { related = related.parentNode;elementHasNoId = maClient.elementHasNoId(related);} if (!related || elementHasNoId || !maClient.stringStartsWith(related.id, "maArrow,maSlideTitle,maSlideImage,maSlideText,maPopup,maPopupControlPanel,maPopupPin,maPopupPinMsg")) { maClient.hidePopup(maClient.popupAfterDelay());} } maClient.popupAfterDelay = function() { var delay = 0;if (maTour.popup.delayType == 2 && maTour.popup.delay !== 0) { delay = maTour.popup.delay;} return delay;};function maPopupMouseOver(event) { if (typeof maClient.popupDelayAfterIntervalId != "undefined") clearInterval(maClient.popupDelayAfterIntervalId);if (maClient.popupPinned) return;maClient.persistPopup(false);} function maPopupClickPin(event) { if (maClient.popupPinned) return;maClient.persistPopup(true);} maClient.stringStartsWith = function(s, list) { var item = list.split(",");for (var i = 0; i < item.length; i++) { if (s.indexOf(item[i]) === 0) return true;} return false;};maClient.positionPopupLeftOrRight = function(side, popupOffsetX, arrowSize, scroll) { var arrow = side == "right" ? "left" : "right";var arrow1 = arrow + "1";var arrow2 = arrow + "2";var arrowType = arrow1;            var border = parseInt(maTour.popup.borderWidth,10);var middle = Math.floor(maTour.popup.actualH / 2);var arrowOffset = middle + border;var borderTweak = border > 0 ? 1 : 0;var topH = side == "right" ? maTour.marker.rectRight.h : maTour.marker.rectLeft.h;if (arrowSize === 0) { arrowOffset = 0;} else if (middle < arrowSize) { arrowOffset = border - borderTweak;}  else if (arrowOffset > maTour.marker.rectTop.h || maTour.popup.actualH > topH) { arrowOffset -= arrowOffset - topH + 1;if (arrowOffset < border - 1) arrowOffset = border - (border > 0 ? 1 : 0);if (arrowOffset > maTour.popup.actualH - arrowSize) arrowOffset = maTour.popup.actualH - arrowSize;} else if (arrowOffset > maTour.marker.rectBottom.h) { arrowType = arrow2;          arrowOffset += arrowOffset - maTour.marker.rectBottom.h + 1;if (arrowOffset > maTour.popup.actualH) arrowOffset = maTour.popup.actualH + border + (border > 0 ? 1 : 0);} var popupX;var popupY;var arrowX;var arrowY;popupY = maTour.marker.absY - arrowOffset;if (side == "right") { popupX = maTour.marker.absX + popupOffsetX;arrowX = popupX - arrowSize + border;if (popupY < maTour.marker.rectRight.y) popupY = maTour.marker.rectRight.y;} else { popupX = maTour.marker.absX - (maTour.popup.actualW + (border * 2) + popupOffsetX);arrowX = popupX + maTour.popup.actualW + border;if (popupY < maTour.marker.rectLeft.y) popupY = maTour.marker.rectLeft.y;} arrowY = maTour.marker.absY - (arrowType == arrow1 ? 0 : arrowSize);maClient.setArrowPanel(maClient.arrowPanel, arrowType, arrowSize, arrowX, arrowY);var pt = new Object;pt.x = popupX;pt.y = popupY;return pt;};maClient.positionPopupUpOrDown = function(side, popupOffsetY, arrowSize, scroll) { var arrow = side == "bottom" ? "up" : "down";var arrow1 = arrow + "1";var arrow2 = arrow + "2";var arrowType = arrow1;            var border = parseInt(maTour.popup.borderWidth,10);var middle = Math.floor(maTour.popup.actualW / 2);var arrowOffset = middle + border;var borderTweak = border > 0 ? 1 : 0;if (middle < arrowSize) { arrowOffset = border - borderTweak;} else if (arrowOffset > maTour.marker.rectLeft.w || maTour.popup.actualW > maTour.marker.rectBottom.w) { arrowOffset -= arrowOffset - maTour.marker.rectLeft.w + 1;if (arrowOffset < border - 1) arrowOffset = border - borderTweak;} else if (arrowOffset > maTour.marker.rectRight.w) { arrowType = arrow2;          arrowOffset += arrowOffset - maTour.marker.rectRight.w + 1;if (arrowOffset > maTour.popup.actualW) arrowOffset = maTour.popup.actualW + border + borderTweak;} var popupX;var popupY;var arrowX;var arrowY;if (side == "bottom") { popupY = maTour.marker.absY + popupOffsetY;arrowY = popupY - arrowSize + border;} else { popupY = maTour.marker.absY - (maTour.popup.actualH + (border * 2) + popupOffsetY);arrowY = popupY + maTour.popup.actualH + border;} popupX = maTour.marker.absX - arrowOffset;arrowX = maTour.marker.absX - (arrowType == arrow1 ? 0 : arrowSize);maClient.setArrowPanel(maClient.arrowPanel, arrowType, arrowSize, arrowX, arrowY);var pt = new Object;pt.x = popupX;pt.y = popupY;return pt;};maClient.setActualPopupHeight = function(h) { maTour.popup.actualH = Math.max(h, maTour.popup.minH);maClient.popupPanel.style.height = maTour.popup.actualH + "px";};maClient.setArrowPanel = function(panel, type, size, x, y) { if (maTour.popup.arrowType === 0) return;panel.style.width = size + "px";panel.style.height = size + "px";panel.src = maClient.graphics[type].src;var s = panel.style;s.left = x + 'px';s.top = y + 'px';s.display = "block";};maClient.popupSetControlPanelState = function(show, persist, pin) {	 var pinnable = pin || maClient.pinNextPopup || maTour.popup.pinOnClick;maClient.popupPinned = show && pin;maClient.disableMarkers(persist || maClient.popupPinned);maClient.pinNextPopup = false;var showAndPinnable = show && pinnable;maClient.popupControlPanel.style.width = maClient.popupPanel.style.width;maClient.popupControlPanel.style.display = showAndPinnable ? "block" : "none";maClient.popupControlPanelPin.style.display = showAndPinnable ? "block" : "none";if (showAndPinnable) { maClient.popupControlPanelPin.src = maClient.graphics[pin ? "pinDown" : "pinUp"].src;maClient.popupPanel.style.height = maTour.popup.actualH + maClient.popupControlPanelH + "px";} maClient.popupControlPanelPinMsg.style.display = show && pinnable && !pin ? "block" : "none";maClient.popupControlPanelCloseX.style.display = show && pinnable && pin ? "block" : "none";};maClient.setPopupLocation = function(positionPopupAtMouse) { if (maTour.usesFixedPopup) return;var l = maClient.popupLocation(positionPopupAtMouse);var s = maClient.popupPanel.style;s.left = l.x + 'px';s.top = l.y + 'px';if (maTour.usesDynamicPopup) { s = maClient.popupControlPanelCloseX.style;s.top = (l.y + maTour.popup.borderWidth + 1) + 'px';s.left = (l.x + maTour.popup.actualW - 14 + (maTour.popup.borderWidth)) + 'px';s = maClient.popupControlPanelPin.style;s.top = (l.y + maTour.popup.borderWidth) + 'px';s.left = (l.x+ maTour.popup.borderWidth) + 'px';s = maClient.popupControlPanelPinMsg.style;s.top = (l.y + maTour.popup.borderWidth) + 'px';s.left = (l.x+ maTour.popup.borderWidth + 16) + 'px';} };maClient.setPopupSize = function() { var marginsV = parseInt(maTour.layoutMarginLeft,10) + parseInt(maTour.layoutMarginRight,10);var marginsH = parseInt(maTour.layoutMarginTop,10) + parseInt(maTour.layoutMarginBottom,10);var contentHeight;var popupWidth;var textAreaHeight;var textHeight;var textWidth;switch (maTour.layout) { case "HII": maClient.setActualPopupWidth(parseInt(maTour.image.width,10) + marginsV);maClient.setActualPopupHeight(parseInt(maTour.image.height,10) + marginsH);return;case "HTT": case "HIITT": case "HTTII": var nonTextHeight;var isHTT = maTour.layout == "HTT";popupWidth = isHTT ? maTour.popup.maxW : parseInt(maTour.image.width,10) + marginsV;maClient.setActualPopupWidth(popupWidth);textWidth = maTour.popup.actualW - marginsV;textHeight = maClient.getTextHeight(textWidth);nonTextHeight = isHTT ? 0 : parseInt(maTour.image.height,10) + parseInt(maTour.layoutSpacingH,10);contentHeight =	nonTextHeight + textHeight + marginsH;textAreaHeight = Math.max(0, maTour.popup.maxH - (nonTextHeight + marginsH));break;case "VIITT": case "VTTII": popupWidth = maTour.popup.maxW - maTour.image.deltaW;maClient.setActualPopupWidth(popupWidth);textWidth = maTour.popup.actualW - maTour.image.width - parseInt(maTour.layoutSpacingV,10) - marginsV;textHeight = maClient.getTextHeight(textWidth);contentHeight = Math.max(maTour.image.height, textHeight) + marginsH;textAreaHeight = maTour.textAreaH;break;default: break;} var extraHeight = maTour.popup.maxH - contentHeight;if (extraHeight >= 0) { maClient.setActualPopupHeight(maTour.popup.maxH - extraHeight);maClient.textArea.style.height = textHeight + "px";maClient.textArea.style.overflow = "hidden";} else { maClient.setActualPopupHeight(maTour.popup.maxH);maClient.textArea.style.height = textAreaHeight + "px";maClient.textArea.style.overflow = maTour.popup.persist || maTour.popup.pinOnClick ? "auto" : "hidden";} if (maClient.popupControlPanelPinMsg) { maClient.popupControlPanelPinMsg.style.width = (maTour.popup.actualW - 32) + "px";} };maClient.showPopup = function(show) { if (show == maClient.showingPopup) return;if (show) { if (maClient.popupPanel.style.visibility == "visible") return;maClient.popupStartRefresh();} else { maClient.popupStopRefresh();var dropdownList = document.getElementById('maSlideDropdown');if (dropdownList) dropdownList.selectedIndex = 0;var slideNamesInMenu = document.getElementById('maSlideNamesInMenu');if (slideNamesInMenu) { var oldSelectedViewId = document.getElementById("ma" + maTour.selectedViewId);if (oldSelectedViewId)  oldSelectedViewId.className = '';maTour.selectedViewId = '';			 } maClient.popupPersisted = false;} var visibility = show ? "visible" : "hidden";maClient.popupPanel.style.visibility = visibility;if (maTour.popup.arrowType !== 0) maClient.arrowPanel.style.visibility = visibility;if (maClient.slideImg) { maClient.slideImg.style.visibility = visibility;if (!show) { maClient.slideImg.src = maClient.graphics["blank"].src;} } if (maTour.usesDynamicPopup) { var pin = maClient.pinNextPopup || maClient.popupPinned;maClient.popupSetControlPanelState(show, false, pin);} maClient.showingPopup = show;		 };maClient.popupStartRefresh = function() { maClient.refreshCycle = maClient.macintosh ? 60 : 5;maClient.popupStopRefresh();maClient.refreshIntervalId = setInterval(maClient.popupRefresh, maClient.macintosh ? 50 : 200);};maClient.popupStopRefresh = function() { if (typeof maClient.refreshIntervalId != "undefined") clearInterval(maClient.refreshIntervalId);};maClient.popupRefresh = function() { maClient.refreshCycle--;maClient.popupPanel.style.backgroundColor = maClient.refreshCycle % 2 === 0 ? maTour.popup.backgroundColor : maTour.popup.backgroundColorAlt;if (maClient.macintosh && maTour.popup.arrowType !== 0) maClient.arrowPanel.style.color = maClient.refreshCycle % 2 === 0 ? maTour.popup.backgroundColor : maTour.popup.backgroundColorAlt;maClient.setSlideText();if (maClient.refreshCycle === 0) { maClient.popupStopRefresh();if (maClient.macintosh) maClient.refreshIntervalId = setInterval(maClient.popupRefresh, 500);} };