/* Copyright 2010, Avenza Systems Inc. */
"use strict";var AVENZA=(function(){var j="attributes";var q="feature";var d="LOCAL_SANDBOX";var p="NETWORK_SANDBOX";var h="AUTO_SANDBOX";function i(){return(/^file\:/).test(location.href)}function n(s){if(null===s.viewer&&swfobject){s.viewer=swfobject.getObjectById(s.id)}return(null!==s.viewer)}function o(s,t){if(typeof(s.viewer[t])!="undefined"){return true}if(i()){alert("The AVENZA API is not enabled for untrusted local files.  To use the API, first add this address to the list of trusted sites in your Flash Player security panel.")}return false}function a(s){this.id=s;this.viewer=null}a.prototype.panRight=function(){if(n(this)&&o(this,"panRight")){this.viewer.panRight()}};a.prototype.panLeft=function(){if(n(this)&&o(this,"panLeft")){this.viewer.panLeft()}};a.prototype.panUp=function(){if(n(this)&&o(this,"panUp")){this.viewer.panUp()}};a.prototype.panDown=function(){if(n(this)&&o(this,"panDown")){this.viewer.panDown()}};a.prototype.panHome=function(){if(n(this)&&o(this,"panHome")){this.viewer.panHome()}};a.prototype.zoomIn=function(){if(n(this)&&o(this,"zoomIn")){this.viewer.zoomIn()}};a.prototype.zoomOut=function(){if(n(this)&&o(this,"zoomOut")){this.viewer.zoomOut()}};a.prototype.panToPointAndZoom=function(u,t,s){if(n(this)&&o(this,"panToPointAndZoom")){this.viewer.panToPointAndZoom(u,t,s)}};a.prototype.search=function(u,t){if(n(this)&&o(this,"search")){this.viewer.search(u,t)}};a.prototype.setVisible=function(s,t){if(n(this)&&o(this,"swfLayerToggle")){this.viewer.swfLayerToggle(s,t)}};a.prototype.setAlpha=function(s,t){if(n(this)&&o(this,"setAlpha")){this.viewer.setAlpha(s,t)}};a.prototype.subscribe=function(s,t){if(n(this)){if(j==s){if(o(this,"addAttributeObserver")){this.viewer.addAttributeObserver(t)}}else{if(q==s){if(o(this,"addFeatureObserver")){this.viewer.addFeatureObserver(t)}}}}};a.prototype.unsubscribe=function(s,t){if(n(this)){if(j==s){if(o(this,"removeAttributeObserver")){this.viewer.removeAttributeObserver(t)}}else{if(q==s){if(o(this,"removeFeatureObserver")){this.viewer.removeFeatureObserver(t)}}}}};a.prototype.retrieve=function(s){if(n(this)){if(j==s){if(o(this,"getCurrentAttributes")){return this.viewer.getCurrentAttributes()}}else{if(q==s){if(o(this,"getCurrentFeature")){return this.viewer.getCurrentFeature()}}}}else{return null}};a.prototype.element=function(){if(n(this)){return this.viewer}else{return null}};a.prototype.tween=function(v,t,s,u){if(n(this)&&o(this,"tween")){this.viewer.tween(v,t,s,u)}};a.prototype.features=function(t,s){var u=this;return{forEach:function(v){if(n(u)&&o(u,"forEachFeature")){r=v;var w=u.viewer.forEachFeature(t,"AVENZA.private_visitor",s);if(w){throw w}}},highlight:function(w,v){if(n(u)&&o(u,"highlight")){var x=u.viewer.highlight(t,w,v,s);if(x){throw x}}},reveal:function(v,w){if(n(u)&&o(u,"reveal")){var x=u.viewer.reveal(t,v,w,s);if(x){throw x}}},showCallout:function(){if(n(u)&&o(u,"showCallout")){var v=u.viewer.showCallout(t,s);if(v){throw v}}}}};a.prototype.currentFeature=function(){return this.features("current")};var r;function b(s){if(r){return r(s)}}var m;function k(){if(m){m()}}function e(s){if(window&&window.getComputedStyle){return window.getComputedStyle(s,null)}else{if(s.currentStyle){return s.currentStyle}}return null}function g(t,u){if(i()&&(p!=u)){return false}var v=t.parentNode;var s=e(v).position.toLowerCase();if(s&&(s!="static")){s=e(t).position.toLowerCase();if(!s||(s=="static")){return true}}return false}function f(s){if(s.length>0&&"/"!=s.substring(s.length-1)){s+="/"}return s}function l(s,v,E,w){if(!s){return null}v=v||"100%";E=E||"100%";w=w||{};var C=document.getElementById(s);if(C){var D=w.flashSecuritySandbox||p;if(!w.disableBackgroundImageElement&&g(C,D)&&!(v.substr(-1)=="%"||E.substr(-1)=="%")){var u=C.parentNode;var y=w.imageBaseURL||w.baseURL||"";y=f(y);y+="map.png";var B=document.createElement("img");B.src=y;B.style.height=E;B.style.width=v;B.style.position="absolute";B.style.top=0;B.style.left=0;var x=document.createElement("div");x.style.position="relative";x.style.top=0;x.style.left=0;u.insertBefore(B,C);u.insertBefore(x,C);x.appendChild(C)}var t=w.loadedCB||null;var z=w.viewerBaseURL||w.baseURL||"";z=f(z);var A=z;if(w.viewerFileName){A+=w.viewerFileName}else{if(D==h){A+=i()?"MAPublisherViewer-local.swf":"MAPublisherViewer.swf"}else{if(D==d){A+="MAPublisherViewer-local.swf"}else{A+="MAPublisherViewer.swf"}}}m=function(){if(u){setTimeout("AVENZA.private_cb()",1000);AVENZA.private_cb=function(){u.removeChild(B)}}if(t){t()}};w.loadedCB="AVENZA.private_cb";swfobject.embedSWF(A,s,v,E,"9.0.115",z+"expressInstall.swf",w,{wmode:"transparent",AllowScriptAccess:"always"})}}function c(v,t,s,u){swfobject.addDomLoadEvent(function(){l(v,t,s,u)});return new a(v)}return{ATTRIBUTES:j,FEATURE:q,LOCAL_SANDBOX:d,NETWORK_SANDBOX:p,AUTO_SANDBOX:h,Viewer:a,embedViewer:c,private_cb:k,private_visitor:b}}());