diff --git a/js/imageMapster.js b/js/imageMapster.js index f3c27da..04e5738 100644 --- a/js/imageMapster.js +++ b/js/imageMapster.js @@ -1,13 +1,8 @@ -/* ImageMapster - Version: 1.2.10 (2/25/2013) - -Copyright 2011-2012 James Treworgy - -http://www.outsharked.com/imagemapster -https://github.com/jamietre/ImageMapster - -A jQuery plugin to enhance image maps. - +/*! +* imagemapster - v1.8.0 - 2024-05-01 +* https://jamietre.github.io/ImageMapster +* Copyright (c) 2011 - 2024 James Treworgy +* License: MIT */ -(function(e){e(function(){function i(){}function s(t){var n=new i;return n.then=function(e){var n;try{return e&&(n=e(t)),c(n===r?t:n)}catch(i){return o(i)}},e(n)}function o(t){var n=new i;return n.then=function(e,n){var i;try{return n?(i=n(t),c(i===r?t:i)):o(t)}catch(s){return o(s)}},e(n)}function u(e){return l(e,function(e){return o(e)})}function a(){function p(e,t,n){return l(e,t,n)}function d(e){h(s(e))}function v(e){h(o(e))}function m(e){c(e)}var t,n,u,f,l,c,h;return u=[],f=[],l=function(t,n,r){var i=a();return u.push(function(e){e.then(t,n).then(i.resolve,i.reject,i.progress)}),r&&f.push(r),i.promise},c=function(e){var t,n=0;while(t=f[n++])t(e)},h=function(e){var t,n=0;l=e.then,h=c=function(){throw new Error("already completed")},f=r;while(t=u[n++])t(e);u=[]},t={},n=new i,n.then=t.then=p,t.promise=e(n),t.resolver=e({resolve:t.resolve=d,reject:t.reject=v,progress:t.progress=m}),t}function f(e){return e&&typeof e.then=="function"}function l(e,t,n,r){var i=c(e);return i.then(t,n,r)}function c(e){var t,n;return e instanceof i?t=e:(n=a(),f(e)?(e.then(n.resolve,n.reject,n.progress),t=n.promise):(n.resolve(e),t=n.promise)),t}function h(e,t,n,r,i){return E(2,arguments),l(e,function(e){function m(e){c(e)}function g(e){h(e)}function y(e){p(e)}function b(){c=h=p=S}var s,o,u,f,c,h,p,d,v;d=e.length>>>0,s=Math.max(0,Math.min(t,d)),o=[],f=a(),u=l(f,n,r,i);if(!s)f.resolve(o);else{c=function(e){o.push(e),--s||(b(),f.resolve(o))},h=function(e){b(),f.reject(e)},p=f.progress;for(v=0;v>>0,n=new Array(r);for(i=0;i2&&s.push(r),t.apply(e,s)}function w(e,t,n){var r=arguments.length>2;return l(e,function(e){return r&&(e=n),t.resolve(e),e},function(e){return t.reject(e),o(e)},t.progress)}function E(e,t){var n,r=t.length;while(r>e){n=t[--r];if(n!=null&&typeof n!="function")throw new Error("callback is not a function")}}function S(){}var e,t,n,r;return l.defer=a,l.reject=u,l.isPromise=f,l.all=p,l.some=h,l.any=v,l.map=m,l.reduce=y,l.chain=w,e=Object.freeze||function(e){return e},i.prototype=e({always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(r,e)}}),n=[].slice,t=[].reduce||function(e){var t,n,r,i,s;s=0,t=Object(this),i=t.length>>>0,n=arguments;if(n.length<=1)for(;;){if(s in t){r=t[s++];break}if(++s>=i)throw new TypeError}else r=n[1];for(;s=0){var i=t[e];$.isPlainObject(i)?r[e]=$.extend(r[e]||{},i):i&&i.constructor===Array?r[e]=i.slice(0):typeof i!="undefined"&&(r[e]=t[e])}})}),r},isElement:function(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"},indexOfProp:function(e,t,n){var r=e.constructor===Array?-1:null;return $.each(e,function(e,i){if(i&&(t?i[t]:i)===n)return r=e,!1}),r},boolOrDefault:function(e,t){return this.isBool(e)?e:t||!1},isBool:function(e){return typeof e=="boolean"},isUndef:function(e){return typeof e=="undefined"},ifFunction:function(e,t,n){$.isFunction(e)&&e.call(t,n)},size:function(e,t){var n=$.mapster.utils;return{width:t?e.width||e.naturalWidth:n.imgWidth(e,!0),height:t?e.height||e.naturalHeight:n.imgHeight(e,!0),complete:function(){return!!this.height&&!!this.width}}},setOpacity:function(e,t){$.mapster.hasCanvas()?e.style.opacity=t:$(e).each(function(e,n){typeof n.opacity!="undefined"?n.opacity=t:$(n).css("opacity",t)})},fader:function(){var e={},t=0,n=function(r,i,s,o){var u,a=o/15,f,l=$.mapster.utils;if(typeof r=="number"){f=e[r];if(!f)return}else u=l.indexOfProp(e,null,r),u&&delete e[u],e[++t]=f=r,r=t;s=s||1,i=i+s/a>s-.01?s:i+s/a,l.setOpacity(f,i),i=0)return t>=0?this.map_cache[t]:null},queueCommand:function(e,t,n,r){return e?!e.complete||e.currentAction?(e.commands.push({that:t,command:n,args:r}),!0):!1:!1},unload:function(){this.impl.unload(),this.utils=null,this.impl=null,$.fn.mapster=null,$.mapster=null,$("*").unbind()}};var m=$.mapster,u=m.utils,ap=Array.prototype;$.each(["width","height"],function(e,t){var n=t.substr(0,1).toUpperCase()+t.substr(1);u["img"+n]=function(e,r){return(r?$(e)[t]():0)||e[t]||e["natural"+n]||e["client"+n]||e["offset"+n]}}),m.Method=function(e,t,n,r){var i=this;i.name=r.name,i.output=e,i.input=e,i.first=r.first||!1,i.args=r.args?ap.slice.call(r.args,0):[],i.key=r.key,i.func_map=t,i.func_area=n,i.name=r.name,i.allowAsync=r.allowAsync||!1},m.Method.prototype={constructor:m.Method,go:function(){var e,t,n,r,i,s=this.input,o=[],u=this;r=s.length;for(e=0;e").appendTo("body");e.html('');var t=e[0].firstChild;t.style.behavior="url(#default#VML)";var n=t?typeof t.adj=="object":!0;return e.remove(),n}function namespaces(){return typeof document.namespaces=="object"?document.namespaces:null}function hasCanvas(){var e=namespaces();return e&&e.g_vml_?!1:$("")[0].getContext?!0:!1}function merge_areas(e,t){var n,r,i=e.options.areas;t&&$.each(t,function(t,s){if(!s||!s.key)return;r=u.indexOfProp(i,"key",s.key),r>=0?$.extend(i[r],s):i.push(s),n=e.getDataForKey(s.key),n&&$.extend(n.options,s)})}function merge_options(e,t){var n=u.updateProps({},t);delete n.areas,u.updateProps(e.options,n),merge_areas(e,t.areas),u.updateProps(e.area_options,e.options)}var me={},addMap=function(e){return m.map_cache.push(e)-1},removeMap=function(e){m.map_cache.splice(e.index,1);for(var t=m.map_cache.length-1;t>=this.index;t--)m.map_cache[t].index--};return me.get=function(e){var t=m.getMapData(this);if(!t||!t.complete)throw"Can't access data until binding complete.";return(new m.Method(this,function(){return this.getSelected()},function(){return this.isSelected()},{name:"get",args:arguments,key:e,first:!0,allowAsync:!0,defaultReturn:""})).go()},me.data=function(e){return(new m.Method(this,null,function(){return this},{name:"data",args:arguments,key:e})).go()},me.highlight=function(e){return(new m.Method(this,function(){if(e!==!1){var t=this.highlightId;return t>=0?this.data[t].key:null}this.ensureNoHighlight()},function(){this.highlight()},{name:"highlight",args:arguments,key:e,first:!0})).go()},me.keys=function(e,t){function i(e){var r,i=[];t?(r=e.areas(),$.each(r,function(e,t){i=i.concat(t.keys)})):i.push(e.key),$.each(i,function(e,t){$.inArray(t,n)<0&&n.push(t)})}var n=[],r=m.getMapData(this);if(!r||!r.complete)throw"Can't access data until binding complete.";return!r||!r.complete?"":(typeof e=="string"?t?i(r.getDataForKey(e)):n=[r.getKeysForGroup(e)]:(t=e,this.each(function(e,t){t.nodeName==="AREA"&&i(r.getDataForArea(t))})),n.join(","))},me.select=function(){me.set.call(this,!0)},me.deselect=function(){me.set.call(this,!1)},me.set=function(e,t,n){function f(t){if(t)switch(e){case!0:t.select(s);break;case!1:t.deselect(!0);break;default:t.toggle(s)}}function l(e){e&&$.inArray(e,a)<0&&(a.push(e),o+=(o===""?"":",")+e.key)}function c(t){$.each(a,function(e,t){f(t)}),e||t.removeSelectionFinish(),t.options.boundList&&m.setBoundListProperties(t.options,m.getBoundList(t.options,o),e)}var r,i,s=n,o,a;return this.filter("img,area").each(function(n,f){var h;i=m.getMapData(f),i!==r&&(r&&c(r),a=[],o=""),i&&(h="",f.nodeName.toUpperCase()==="IMG"?m.queueCommand(i,$(f),"set",[e,t,s])||(t instanceof Array?t.length&&(h=t.join(",")):h=t,h&&$.each(u.split(h),function(e,t){l(i.getDataForKey(t.toString())),r=i})):(s=t,m.queueCommand(i,$(f),"set",[e,s])||(l(i.getDataForArea(f)),r=i)))}),i&&c(i),this},me.unbind=function(e){return(new m.Method(this,function(){this.clearEvents(),this.clearMapData(e),removeMap(this)},null,{name:"unbind",args:arguments})).go()},me.rebind=function(e){return(new m.Method(this,function(){var t=this;t.complete=!1,t.configureOptions(e),t.bindImages().then(function(){t.buildDataset(!0),t.complete=!0})},null,{name:"rebind",args:arguments})).go()},me.get_options=function(e,t){var n=u.isBool(e)?e:t;return(new m.Method(this,function(){var e=$.extend({},this.options);return n&&(e.render_select=u.updateProps({},m.render_defaults,e,e.render_select),e.render_highlight=u.updateProps({},m.render_defaults,e,e.render_highlight)),e},function(){return n?this.effectiveOptions():this.options},{name:"get_options",args:arguments,first:!0,allowAsync:!0,key:e})).go()},me.set_options=function(e){return(new m.Method(this,function(){merge_options(this,e)},null,{name:"set_options",args:arguments})).go()},me.unload=function(){var e;for(e=m.map_cache.length-1;e>=0;e--)m.map_cache[e]&&me.unbind.call($(m.map_cache[e].image));me.graphics=null},me.snapshot=function(){return(new m.Method(this,function(){$.each(this.data,function(e,t){t.selected=!1}),this.base_canvas=this.graphics.createVisibleCanvas(this),$(this.image).before(this.base_canvas)},null,{name:"snapshot"})).go()},me.state=function(){var e,t=null;return $(this).each(function(n,r){if(r.nodeName==="IMG")return e=m.getMapData(r),e&&(t=e.state()),!1}),t},me.bind=function(e){return this.each(function(t,n){var r,i,s,o;r=$(n),o=m.getMapData(n);if(o){me.unbind.apply(r);if(!o.complete)return r.bind(),!0;o=null}s=this.getAttribute("usemap"),i=s&&$('map[name="'+s.substr(1)+'"]');if(!(r.is("img")&&s&&i.length>0))return!0;r.css("border",0),o||(o=new m.MapData(this,e),o.index=addMap(o),o.map=i,o.bindImages().then(function(){o.initialize()}))})},me.init=function(e){var t,n;m.hasCanvas=function(){return u.isBool(m.hasCanvas.value)||(m.hasCanvas.value=u.isBool(e)?e:hasCanvas()),m.hasCanvas.value},m.hasVml=function(){if(!u.isBool(m.hasVml.value)){var e=namespaces();e&&!e.v&&(e.add("v","urn:schemas-microsoft-com:vml"),t=document.createStyleSheet(),n=["shape","rect","oval","circ","fill","stroke","imagedata","group","textbox"],$.each(n,function(e,n){t.addRule("v\\:"+n,"behavior: url(#default#VML); antialias:true")})),m.hasVml.value=hasVml()}return m.hasVml.value},m.isTouch=!!document.documentElement.ontouchstart,$.extend(m.defaults,m.render_defaults,m.shared_defaults),$.extend(m.area_defaults,m.render_defaults,m.shared_defaults)},me.test=function(obj){return eval(obj)},me}(),$.mapster.impl.init()}(jQuery),function(e){function o(t,n,r){var i=t,s=i.map_data,o=r.isMask;e.each(n.areas(),function(e,t){r.isMask=o||t.nohref&&s.options.noHrefIsMask,i.addShape(t,r)}),r.isMask=o}function u(e){return Math.max(0,Math.min(parseInt(e,16),255))}function a(e,t){return"rgba("+u(e.substr(0,2))+","+u(e.substr(2,2))+","+u(e.substr(4,2))+","+t+")"}function f(){}var t,n=e.mapster,r=n.utils,i,s;n.Graphics=function(e){var t=this;t.active=!1,t.canvas=null,t.width=0,t.height=0,t.shapes=[],t.masks=[],t.map_data=e},t=n.Graphics.prototype={constructor:n.Graphics,begin:function(t,n){var r=e(t);this.elementName=n,this.canvas=t,this.width=r.width(),this.height=r.height(),this.shapes=[],this.masks=[],this.active=!0},addShape:function(e,t){var n=t.isMask?this.masks:this.shapes;n.push({mapArea:e,options:t})},createVisibleCanvas:function(t){return e(this.createCanvasFor(t)).addClass("mapster_el").css(n.canvas_style)[0]},addShapeGroup:function(t,i,s){var u=this,a,f,l,c=this.map_data,h=t.effectiveRenderOptions(i);s&&e.extend(h,s),i==="select"?(f="static_"+t.areaId.toString(),l=c.base_canvas):l=c.overlay_canvas,u.begin(l,f),h.includeKeys&&(a=r.split(h.includeKeys),e.each(a,function(e,t){var n=c.getDataForKey(t.toString());o(u,n,n.effectiveRenderOptions(i))})),o(u,t,h),u.render(),h.fade&&r.fader(n.hasCanvas()?l:e(l).find("._fill").not(".mapster_mask"),0,n.hasCanvas()?1:h.fillOpacity,h.fadeDuration)}},i={renderShape:function(e,t,n){var r,i=t.coords(null,n);switch(t.shape){case"rect":e.rect(i[0],i[1],i[2]-i[0],i[3]-i[1]);break;case"poly":e.moveTo(i[0],i[1]);for(r=2;r')[0]},clearHighlight:function(){var e=this.map_data.overlay_canvas;e.getContext("2d").clearRect(0,0,e.width,e.height)},refreshSelections:function(){var t,n=this.map_data;t=n.base_canvas,n.base_canvas=this.createVisibleCanvas(n),e(n.base_canvas).hide(),e(t).before(n.base_canvas),n.redrawSelections(),e(n.base_canvas).show(),e(t).remove()}},s={renderShape:function(t,n,r){var i=this,s,o,u,a,f,l,c,h=t.coords();f=i.elementName?'name="'+i.elementName+'" ':"",l=r?'class="'+r+'" ':"",a='',o=n.stroke?" strokeweight="+n.strokeWidth+' stroked="t" strokecolor="#'+n.strokeColor+'"':' stroked="f"',s=n.fill?' filled="t"':' filled="f"';switch(t.shape){case"rect":c="'+a+"";break;case"poly":c="'+a+"";break;case"circ":case"circle":c="'+a+""}return u=e(c),e(i.canvas).append(u),u},render:function(){var t,n=this;return e.each(this.shapes,function(e,t){n.renderShape(t.mapArea,t.options)}),this.masks.length&&e.each(this.masks,function(e,i){t=r.updateProps({},i.options,{fillOpacity:1,fillColor:i.options.fillColorMask}),n.renderShape(i.mapArea,t,"mapster_mask")}),this.active=!1,this.canvas},createCanvasFor:function(t){var n=t.scaleInfo.width,r=t.scaleInfo.height;return e('')[0]},clearHighlight:function(){e(this.map_data.overlay_canvas).children().remove()},removeSelections:function(t){t>=0?e(this.map_data.base_canvas).find('[name="static_'+t.toString()+'"]').remove():e(this.map_data.base_canvas).children().remove()}},e.each(["renderShape","addAltImage","render","createCanvasFor","clearHighlight","removeSelections","refreshSelections"],function(e,r){t[r]=function(e){return function(){return t[e]=(n.hasCanvas()?i[e]:s[e])||f,t[e].apply(this,arguments)}}(r)})}(jQuery),function(e){var t=e.mapster,n=t.utils,r=[];t.MapImages=function(e){this.owner=e,this.clear()},t.MapImages.prototype={constructor:t.MapImages,slice:function(){return r.slice.apply(this,arguments)},splice:function(){r.slice.apply(this.status,arguments);var e=r.slice.apply(this,arguments);return e},complete:function(){return e.inArray(!1,this.status)<0},_add:function(e){var t=r.push.call(this,e)-1;return this.status[t]=!1,t},indexOf:function(t){return e.inArray(t,this)},clear:function(){var t=this;t.ids&&t.ids.length>0&&e.each(t.ids,function(e,n){delete t[n]}),t.ids=[],t.length=0,t.status=[],t.splice(0)},add:function(t,n){var r,i,s=this;if(!t)return;if(typeof t=="string"){i=t,t=s[i];if(typeof t=="object")return s.indexOf(t);t=e("").addClass("mapster_el").hide(),r=s._add(t[0]),t.bind("load",function(e){s.imageLoaded.call(s,e)}).bind("error",function(e){s.imageLoadError.call(s,e)}),t.attr("src",i)}else r=s._add(e(t)[0]);if(n){if(this[n])throw n+" is already used or is not available as an altImage alias.";s.ids.push(n),s[n]=s[r]}return r},bind:function(e){var t=this,r,i=t.owner.options.configTimeout/200,s=function(){var e;e=t.length;while(e-->0)if(!t.isLoaded(e))break;t.complete()?t.resolve():i-->0?t.imgTimeout=window.setTimeout(function(){s.call(t,!0)},50):t.imageLoadError.call(t)};return r=t.deferred=n.defer(),s(),r},resolve:function(){var e=this,t=e.deferred;t&&(e.deferred=null,t.resolve())},imageLoaded:function(t){var n=this,r=n.indexOf(t.target);r>=0&&(n.status[r]=!0,e.inArray(!1,n.status)<0&&n.resolve())},imageLoadError:function(e){clearTimeout(this.imgTimeout),this.triesLeft=0;var t=e?"The image "+e.target.src+" failed to load.":"The images never seemed to finish loading. You may just need to increase the configTimeout if images could take a long time to load.";throw t},isLoaded:function(e){var t,r=this,i=r.status;return i[e]?!0:(t=r[e],typeof t.complete!="undefined"?i[e]=t.complete:i[e]=!!n.imgWidth(t),i[e])}}}(jQuery),function(e){function r(t){e.extend(t,{complete:!1,map:null,base_canvas:null,overlay_canvas:null,commands:[],data:[],mapAreas:[],_xref:{},highlightId:-1,currentAreaId:-1,_tooltip_events:[],scaleInfo:null,index:-1,activeAreaEvent:null})}function i(e){return[e,e.render_highlight,e.render_select]}function s(r){var s=r.options,o=r.images;t.hasCanvas()&&(e.each(s.altImages||{},function(e,t){o.add(t,e)}),e.each([s].concat(s.areas),function(t,n){e.each(i(n),function(e,t){t&&t.altImage&&(t.altImageId=o.add(t.altImage))})})),r.area_options=n.updateProps({},t.area_defaults,s)}function o(e,t,r,i){function s(t){e.currentAreaId!==t&&e.highlightId>=0&&i.resolve()}i=i||n.when.defer(),e.activeAreaEvent&&(window.clearTimeout(e.activeAreaEvent),e.activeAreaEvent=0);if(t<0)return;return r.owner.currentAction||t?e.activeAreaEvent=window.setTimeout(function(){return function(){o(e,0,r,i)}}(r),t||100):s(r.areaId),i}function u(e){t.hasCanvas()||this.blur(),e.preventDefault()}function a(t,n){var r=t.getAllDataForArea(this),i=r.length?r[0]:null;if(!i||i.isNotRendered()||i.owner.currentAction)return;if(t.currentAreaId===i.areaId)return;t.highlightId!==i.areaId&&(t.clearEffects(),i.highlight(),t.options.showToolTip&&e.each(r,function(e,t){t.effectiveOptions().toolTip&&t.showToolTip()})),t.currentAreaId=i.areaId,e.isFunction(t.options.onMouseover)&&t.options.onMouseover.call(this,{e:n,options:i.effectiveOptions(),key:i.key,selected:i.isSelected()})}function f(t,n){var r,i=t.getDataForArea(this),s=t.options;if(t.currentAreaId<0||!i)return;r=t.getDataForArea(n.relatedTarget);if(r===i)return;t.currentAreaId=-1,i.area=null,o(t,s.mouseoutDelay,i).then(t.clearEffects),e.isFunction(s.onMouseout)&&s.onMouseout.call(this,{e:n,options:s,key:i.key,selected:i.isSelected()})}function l(t){var n=t.options;t.ensureNoHighlight(),n.toolTipClose&&e.inArray("area-mouseout",n.toolTipClose)>=0&&t.activeToolTip&&t.clearToolTip()}function c(r,i){function v(u){var p,g;l=u.isSelectable()&&(u.isDeselectable()||!u.isSelected()),l?f=!u.isSelected():f=u.isSelected(),a=t.getBoundList(d,u.key);if(e.isFunction(d.onClick)){c=d.onClick.call(h,{e:i,listTarget:a,key:u.key,selected:f});if(n.isBool(c)){if(!c)return!1;g=e(u.area).attr("href");if(g!=="#")return window.location.href=g,!1}}l&&(s=u.toggle()),d.boundList&&d.boundList.length>0&&t.setBoundListProperties(d,a,u.isSelected()),p=u.effectiveOptions(),p.includeKeys&&(o=n.split(p.includeKeys),e.each(o,function(e,t){var n=r.getDataForKey(t.toString());n.options.isMask||v(n)}))}var s,o,a,f,l,c,h=this,p=r.getDataForArea(this),d=r.options;u.call(this,i);if(d.clickNavigate&&p.href){window.location.href=p.href;return}p&&!p.owner.currentAction&&(d=r.options,v(p))}var t=e.mapster,n=t.utils;t.MapData=function(e,n){var i=this;i.image=e,i.images=new t.MapImages(i),i.graphics=new t.Graphics(i),i.imgCssText=e.style.cssText||null,r(i),i.configureOptions(n),i.mouseover=function(e){a.call(this,i,e)},i.mouseout=function(e){f.call(this,i,e)},i.click=function(e){c.call(this,i,e)},i.clearEffects=function(e){l.call(this,i,e)}},t.MapData.prototype={constructor:t.MapData,configureOptions:function(e){this.options=n.updateProps({},t.defaults,e)},bindImages:function(){var e=this,t=e.images;return t.length>2?t.splice(2):t.length===0&&(t.add(e.image),t.add(e.image.src)),s(e),e.images.bind()},isActive:function(){return!this.complete||this.currentAction},state:function(){return{complete:this.complete,resizing:this.currentAction==="resizing",zoomed:this.zoomed,zoomedArea:this.zoomedArea,scaleInfo:this.scaleInfo}},wrapId:function(){return"mapster_wrap_"+this.index},_idFromKey:function(e){return typeof e=="string"&&this._xref.hasOwnProperty(e)?this._xref[e]:-1},getSelected:function(){var t="";return e.each(this.data,function(e,n){n.isSelected()&&(t+=(t?",":"")+this.key)}),t},getAllDataForArea:function(t,r){var i,s,o,u=this,a=e(t).filter("area").attr(u.options.mapKey);if(a){o=[],a=n.split(a);for(i=0;i<(r||a.length);i++)s=u.data[u._idFromKey(a[i])],s.area=t.length?t[0]:t,o.push(s)}return o},getDataForArea:function(e){var t=this.getAllDataForArea(e,1);return t?t[0]||null:null},getDataForKey:function(e){return this.data[this._idFromKey(e)]},getKeysForGroup:function(e){var t=this.getDataForKey(e);return t?t.isPrimary?t.key:this.getPrimaryKeysForMapAreas(t.areas()).join(","):""},getPrimaryKeysForMapAreas:function(t){var n=[];return e.each(t,function(t,r){e.inArray(r.keys[0],n)<0&&n.push(r.keys[0])}),n},getData:function(e){return typeof e=="string"?this.getDataForKey(e):e&&e.mapster||n.isElement(e)?this.getDataForArea(e):null},ensureNoHighlight:function(){var e;this.highlightId>=0&&(this.graphics.clearHighlight(),e=this.data[this.highlightId],e.changeState("highlight",!1),this.setHighlightId(-1))},setHighlightId:function(e){this.highlightId=e},clearSelections:function(){e.each(this.data,function(e,t){t.selected&&t.deselect(!0)}),this.removeSelectionFinish()},setAreaOptions:function(e){var t,r,i;e=e||[];for(t=e.length-1;t>=0;t--)r=e[t],r&&(i=this.getDataForKey(r.key),i&&(n.updateProps(i.options,r),n.isBool(r.selected)&&(i.selected=r.selected)))},drawSelections:function(e){var t,r=n.asArray(e);for(t=r.length-1;t>=0;t--)this.data[r[t]].drawSelection()},redrawSelections:function(){e.each(this.data,function(e,t){t.isSelectedOrStatic()&&t.drawSelection()})},initialize:function(){var r,i,s,o,u,a,f,l,c,h,p,d,v=this,g=v.options;if(v.complete)return;c=e(v.image),u=c.parent().attr("id"),u&&u.length>=12&&u.substring(0,12)==="mapster_wrap"?(o=c.parent(),o.attr("id",v.wrapId())):(o=e('
'),g.wrapClass&&(g.wrapClass===!0?o.addClass(c[0].className):o.addClass(g.wrapClass))),v.wrapper=o,v.scaleInfo=d=n.scaleMap(v.images[0],v.images[1],g.scaleMap),v.base_canvas=i=v.graphics.createVisibleCanvas(v),v.overlay_canvas=s=v.graphics.createVisibleCanvas(v),r=e(v.images[1]).addClass("mapster_el "+v.images[0].className).attr({id:null,usemap:null}),l=n.size(v.images[0]),l.complete&&r.css({width:l.width,height:l.height}),v.buildDataset(),a={display:"block",position:"relative",padding:0,width:d.width,height:d.height},g.wrapCss&&e.extend(a,g.wrapCss),c.parent()[0]!==v.wrapper[0]&&c.before(v.wrapper),o.css(a),e(v.images.slice(2)).hide();for(f=1;ft?-1:1}:h=function(e,t){return e===t?0:e=0;s--)c=h[s],b.mapValue&&(d=u.attr(b.mapValue)),w?(o=E(y.data.length,d),v=y.data[o],v.key=c=o.toString()):(o=y._xref[c],o>=0?(v=y.data[o],d&&!y.data[o].value&&(v.value=d)):(o=E(c,d),v=y.data[o],v.isPrimary=s===0)),l.areaDataXref.push(o),v.areasXref.push(p);g=u.attr("href"),g&&g!=="#"&&!v.href&&(v.href=g),l.nohref||(u.bind("click.mapster",y.click),t.isTouch||u.bind("mouseover.mapster",y.mouseover).bind("mouseout.mapster",y.mouseout).bind("mousedown.mapster",y.mousedown)),u.data("mapster",p+1)}y.setAreaOptions(b.areas),y.redrawSelections()},processCommandQueue:function(){var e,n=this;while(!n.currentAction&&n.commands.length)e=n.commands[0],n.commands.splice(0,1),t.impl[e.command].apply(e.that,e.args)},clearEvents:function(){e(this.map).find("area").unbind(".mapster"),e(this.images).unbind(".mapster")},_clearCanvases:function(t){t||e(this.base_canvas).remove(),e(this.overlay_canvas).remove()},clearMapData:function(t){var r=this;this._clearCanvases(t),e.each(this.data,function(e,t){t.reset()}),this.data=null,t||(this.image.style.cssText=this.imgCssText,e(this.wrapper).before(this.image).remove()),r.images.clear(),this.image=null,n.ifFunction(this.clearTooltip,this)},removeSelectionFinish:function(){var e=this.graphics;e.refreshSelections(),e.clearHighlight()}}}(jQuery),function(e){function r(t){var n=this,r=n.owner;r.options.singleSelect&&r.clearSelections(),n.isSelected()||(t&&(n.optsCache=e.extend(n.effectiveRenderOptions("select"),t,{altImageId:r.images.add(t.altImage)})),n.drawSelection(),n.selected=!0,n.changeState("select",!0)),r.options.singleSelect&&r.graphics.refreshSelections()}function i(e){var t=this;t.selected=!1,t.changeState("select",!1),t.optsCache=null,t.owner.graphics.removeSelections(t.areaId),e||t.owner.removeSelectionFinish()}function s(e){var t=this;return t.isSelected()?t.deselect():t.select(e),t.isSelected()}var t=e.mapster,n=t.utils;t.AreaData=function(t,n,r){e.extend(this,{owner:t,key:n||"",isPrimary:!0,areaId:-1,href:"",value:r||"",options:{},selected:null,areasXref:[],area:null,optsCache:null})},t.AreaData.prototype={constuctor:t.AreaData,select:r,deselect:i,toggle:s,areas:function(){var e,t=[];for(e=0;e=0;E-=2)y=O[E],b=O[E+1],yh&&(h=y,m=b),bp&&(p=b,d=y);return s&&o&&(f=!1,e.each([[v-s,c-o],[d,c-o],[l-s,g-o],[l-s,m],[h,g-o],[h,m],[v-s,p],[d,p]],function(e,t){if(!f&&t[0]>T&&t[1]>N)return w=t,f=!0,!1}),f||(w=[h,p])),w}}(jQuery),function(e){var t=e.mapster,n=t.utils,r=t.MapArea.prototype;t.utils.getScaleInfo=function(e,t){var n;return t?(n=e.width/t.width||e.height/t.height,n>.98&&n<1.02&&(n=1)):(n=1,t=e),{scale:n!==1,scalePct:n,realWidth:t.width,realHeight:t.height,width:e.width,height:e.height,ratio:e.width/e.height}},t.utils.scaleMap=function(e,t,r){var i=n.size(e),s=n.size(t,!0);if(!s.complete())throw"Another script, such as an extension, appears to be interfering with image loading. Please let us know about this.";return i.complete()||(i=s),this.getScaleInfo(i,r?s:null)},t.MapData.prototype.resize=function(r,i,s,o){function v(n,r,i){t.hasCanvas()?(n.width=r,n.height=i):(e(n).width(r),e(n).height(i))}function g(){d.currentAction="",e.isFunction(o)&&o(),d.processCommandQueue()}function y(){v(d.overlay_canvas,r,i);if(h>=0){var e=d.data[h];e.tempOptions={fade:!1},d.getDataForKey(e.key).highlight(),e.tempOptions=null}v(d.base_canvas,r,i),d.redrawSelections(),g()}function b(){e(d.image).css(l),d.scaleInfo=n.getScaleInfo({width:r,height:i},{width:d.scaleInfo.realWidth,height:d.scaleInfo.realHeight}),e.each(d.data,function(t,n){e.each(n.areas(),function(e,t){t.resize()})})}var a,f,l,c,h,p,d=this;o=o||s;if(d.scaleInfo.width===r&&d.scaleInfo.height===i)return;h=d.highlightId,r||(p=i/d.scaleInfo.realHeight,r=Math.round(d.scaleInfo.realWidth*p)),i||(p=r/d.scaleInfo.realWidth,i=Math.round(d.scaleInfo.realHeight*p)),l={width:String(r)+"px",height:String(i)+"px"},t.hasCanvas()||e(d.base_canvas).children().remove(),c=e(d.wrapper).find(".mapster_el").add(d.wrapper),s?(f=[],d.currentAction="resizing",c.each(function(t,r){a=n.defer(),f.push(a),e(r).animate(l,{duration:s,complete:a.resolve,easing:"linear"})}),a=n.defer(),f.push(a),n.when.all(f).then(y),b(),a.resolve()):(c.css(l),b(),y())},t.MapArea=n.subclass(t.MapArea,function(){this.base.init(),this.owner.scaleInfo.scale&&this.resize()}),r.coords=function(e,t){var n,r=[],i=e||this.owner.scaleInfo.scalePct,s=t||0;if(i===1&&t===0)return this.originalCoords;for(n=0;n0?n.fader(e[0],0,i,t.fadeDuration):n.setOpacity(e[0],i)}function s(t,n,r,i,s,o){var u=r+".mapster-tooltip";if(e.inArray(n,t)>=0)return i.unbind(u).bind(u,function(e){if(!s||s.call(this,e))i.unbind(".mapster-tooltip"),o&&o.call(this)}),{object:i,event:u}}function o(e,t,r,s,o){var u,a={};return o=o||{},t?(u=n.areaCorners(t,r,s,e.outerWidth(!0),e.outerHeight(!0)),a.left=u[0],a.top=u[1]):(a.left=o.left,a.top=o.top),a.left+=o.offsetx||0,a.top+=o.offsety||0,a.css=o.css,a.fadeDuration=o.fadeDuration,i(e,a),e}function u(e){return e?typeof e=="string"||e.jquery?e:e.content:null}var t=e.mapster,n=t.utils;e.extend(t.defaults,{toolTipContainer:'
',showToolTip:!1,toolTipFade:!0,toolTipClose:["area-mouseout","image-mouseout"],onShowToolTip:null,onHideToolTip:null}),e.extend(t.area_defaults,{toolTip:null,toolTipClose:null}),t.MapData.prototype.clearToolTip=function(){this.activeToolTip&&(this.activeToolTip.stop().remove(),this.activeToolTip=null,this.activeToolTipID=null,n.ifFunction(this.options.onHideToolTip,this))},t.AreaData.prototype.showToolTip=function(t,i){var u,a,f,l,c,h={},p=this,d=p.owner,v=p.effectiveOptions();i=i?e.extend({},i):{},t=t||v.toolTip,a=i.closeEvents||v.toolTipClose||d.options.toolTipClose||"tooltip-click",c=typeof i.template!="undefined"?i.template:d.options.toolTipContainer,i.closeEvents=typeof a=="string"?a=n.split(a):a,i.fadeDuration=i.fadeDuration||(d.options.toolTipFade?d.options.fadeDuration||v.fadeDuration:0),f=p.area?p.area:e.map(p.areas(),function(e){return e.area});if(d.activeToolTipID===p.areaId)return;return d.clearToolTip(),d.activeToolTip=u=r(t,c,i.css),d.activeToolTipID=p.areaId,l=function(){d.clearToolTip()},s(a,"area-click","click",e(d.map),null,l),s(a,"tooltip-click","click",u,null,l),s(a,"image-mouseout","mouseout",e(d.image),function(e){return e.relatedTarget&&e.relatedTarget.nodeName!=="AREA"&&e.relatedTarget!==p.area},l),o(u,f,d.image,i.container,c,i),n.ifFunction(d.options.onShowToolTip,p.area,{toolTip:u,options:h,areaOptions:v,key:p.key,selected:p.isSelected()}),u},t.impl.tooltip=function(n,i){return(new t.Method(this,function(){var a,f,l=this;if(!n)l.clearToolTip();else{f=e(n);if(l.activeToolTipID===f[0])return;l.clearToolTip(),l.activeToolTip=a=r(u(i),i.template||l.options.toolTipContainer,i.css),l.activeToolTipID=f[0],s(["tooltip-click"],"tooltip-click","click",a,null,function(){l.clearToolTip()}),l.activeToolTip=a=o(a,f,l.image,i.container,i)}},function(){e.isPlainObject(n)&&!i&&(i=n),this.showToolTip(u(i),i)},{name:"tooltip",args:arguments,key:n})).go()}}(jQuery); +!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),i(t),t}:i(jQuery)}(function(jQuery){!function(e){"use strict";if(e.event&&e.event.special){var a,t=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return t=!0}});window.addEventListener("testPassive.mapster",function(){},i),window.removeEventListener("testPassive.mapster",function(){},i)}catch(e){}t&&(a=function(e,t,i){if(!e.includes("mapster")||!e.includes("noPreventDefault"))return!1;this.addEventListener(t,i,{passive:!0})},e.event.special.touchstart={setup:function(e,t,i){return a.call(this,t,"touchstart",i)}},e.event.special.touchend={setup:function(e,t,i){return a.call(this,t,"touchend",i)}})}}(jQuery),!function(c){"use strict";c.fn.addBack=c.fn.addBack||c.fn.andSelf,c.fn.extend({actual:function(e,t){var i,a,n,o,s,r;if(this[e])return i=c.extend({absolute:!1,clone:!1,includeMargin:!1,display:"block"},t),a=this.eq(0),t=!0===i.clone?(r=function(){a=a.clone().attr("style","position: absolute !important; top: -1000 !important; ").appendTo("body")},function(){a.remove()}):(n=[],o="",r=function(){s=a.parents().addBack().filter(":hidden"),o+="visibility: hidden !important; display: "+i.display+" !important; ",!0===i.absolute&&(o+="position: absolute !important; "),s.each(function(){var e=c(this),t=e.attr("style");n.push(t),e.attr("style",t?t+";"+o:o)})},function(){s.each(function(e){var t=c(this),e=n[e];void 0===e?t.removeAttr("style"):t.attr("style",e)})}),r(),r=/(outer)/.test(e)?a[e](i.includeMargin):a[e](),t(),r;throw'$.actual => The jQuery method "'+e+'" you called does not exist'}})}(jQuery),!function($){"use strict";var mapster_version="1.8.0",m=($.fn.mapster=function(e){var t=$.mapster.impl;return $.mapster.utils.isFunction(t[e])?t[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void $.error("Method "+e+" does not exist on jQuery.mapster"):t.bind.apply(this,arguments)},$.mapster={version:mapster_version,render_defaults:{isSelectable:!0,isDeselectable:!0,fade:!1,fadeDuration:150,fill:!0,fillColor:"000000",fillColorMask:"FFFFFF",fillOpacity:.7,highlight:!0,stroke:!1,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,includeKeys:"",altImage:null,altImageId:null,altImages:{},altImageOpacity:null},defaults:{clickNavigate:!1,navigateMode:"location",wrapClass:null,wrapCss:null,onGetList:null,sortList:!1,mapKey:"",mapValue:"",singleSelect:!1,listKey:"value",listSelectedAttribute:"selected",listSelectedClass:null,onClick:null,onMouseover:null,onMouseout:null,mouseoutDelay:0,onStateChange:null,boundList:null,onConfigured:null,configTimeout:3e4,noHrefIsMask:!0,scaleMap:!0,enableAutoResizeSupport:!1,autoResize:!1,autoResizeDelay:0,autoResizeDuration:0,onAutoResize:null,areas:[]},shared_defaults:{render_highlight:{fade:!0},render_select:{fade:!1},staticState:null,selected:null},area_defaults:{includeKeys:"",isMask:!1},canvas_style:{position:"absolute",left:0,top:0,padding:0,border:0},hasCanvas:null,map_cache:[],hooks:{},addHook:function(e,t){this.hooks[e]=(this.hooks[e]||[]).push(t)},callHooks:function(e,i){$.each(this.hooks[e]||[],function(e,t){t.apply(i)})},utils:{when:{all:function(e){return Promise.all(e)},defer:function(){return new function(){this.promise=new Promise(function(e,t){this.resolve=e,this.reject=t}.bind(this)),this.then=this.promise.then.bind(this.promise),this.catch=this.promise.catch.bind(this.promise)}}},defer:function(){return this.when.defer()},subclass:function(i,a){function e(){var e=this,t=Array.prototype.slice.call(arguments,0);e.base=i.prototype,e.base.init=function(){i.prototype.constructor.apply(e,t)},a.apply(e,t)}return(e.prototype=new i).constructor=e},asArray:function(e){return e.constructor===Array?e:this.split(e)},split:function(e,t){for(var i,a=e.split(","),n=0;n=e.index;t--)m.map_cache[t].index--};function hasVml(){var e=$("
").appendTo("body"),t=(e.html(''),e[0].firstChild),t=(t.style.behavior="url(#default#VML)",!t||"object"==typeof t.adj);return e.remove(),t}function namespaces(){return"object"==typeof document.namespaces?document.namespaces:null}function hasCanvas(){var e=namespaces();return!(e&&e.g_vml_||!$("")[0].getContext)}function merge_areas(i,e){var a,n=i.options.areas;e&&$.each(e,function(e,t){t&&t.key&&(0<=(a=u.indexOfProp(n,"key",t.key))?$.extend(n[a],t):n.push(t),a=i.getDataForKey(t.key))&&$.extend(a.options,t)})}function merge_options(e,t){var i=u.updateProps({},t);delete i.areas,u.updateProps(e.options,i),merge_areas(e,t.areas),u.updateProps(e.area_options,e.options)}return me.get=function(e){var t=m.getMapData(this);if(t&&t.complete)return new m.Method(this,function(){return this.getSelected()},function(){return this.isSelected()},{name:"get",args:arguments,key:e,first:!0,allowAsync:!0,defaultReturn:""}).go();throw"Can't access data until binding complete."},me.data=function(e){return new m.Method(this,null,function(){return this},{name:"data",args:arguments,key:e}).go()},me.highlight=function(t){return new m.Method(this,function(){var e;if(!1!==t)return 0<=(e=this.highlightId)?this.data[e].key:null;this.ensureNoHighlight()},function(){this.highlight()},{name:"highlight",args:arguments,key:t,first:!0}).go()},me.keys=function(e,a){var n=[],i=m.getMapData(this);if(i&&i.complete)return i&&i.complete?("string"==typeof e?a?o(i.getDataForKey(e)):n=[i.getKeysForGroup(e)]:(a=e,this.each(function(e,t){"AREA"===t.nodeName&&o(i.getDataForArea(t))})),n.join(",")):"";throw"Can't access data until binding complete.";function o(e){var t,i=[];a?(t=e.areas(),$.each(t,function(e,t){i=i.concat(t.keys)})):i.push(e.key),$.each(i,function(e,t){$.inArray(t,n)<0&&n.push(t)})}},me.select=function(){me.set.call(this,!0)},me.deselect=function(){me.set.call(this,!1)},me.set=function(a,n,e){var o,s,r,c,l=e;function h(e){e&&$.inArray(e,c)<0&&(c.push(e),r+=(""===r?"":",")+e.key)}function p(e){$.each(c,function(e,t){var i=t;if(i)switch(a){case!0:i.select(l);break;case!1:i.deselect(!0);break;default:i.toggle(l)}}),a||e.removeSelectionFinish()}return this.filter("img,area").each(function(e,t){var i;(s=m.getMapData(t))!==o&&(o&&p(o),c=[],r=""),s&&(i="","IMG"===t.nodeName.toUpperCase()?m.queueCommand(s,$(t),"set",[a,n,l])||(n instanceof Array?n.length&&(i=n.join(",")):i=n,i&&$.each(u.split(i),function(e,t){h(s.getDataForKey(t.toString())),o=s})):(l=n,m.queueCommand(s,$(t),"set",[a,l])||(h(s.getDataForArea(t)),o=s)))}),s&&p(s),this},me.unbind=function(e){return new m.Method(this,function(){this.clearEvents(),this.clearMapData(e),removeMap(this)},null,{name:"unbind",args:arguments}).go()},me.rebind=function(t){return new m.Method(this,function(){var e=this;e.complete=!1,e.configureOptions(t),e.bindImages().then(function(){e.buildDataset(!0),e.complete=!0,e.onConfigured()})},null,{name:"rebind",args:arguments}).go()},me.get_options=function(e,t){var i=u.isBool(e)?e:t;return new m.Method(this,function(){var e=$.extend({},this.options);return i&&(e.render_select=u.updateProps({},m.render_defaults,e,e.render_select),e.render_highlight=u.updateProps({},m.render_defaults,e,e.render_highlight)),e},function(){return i?this.effectiveOptions():this.options},{name:"get_options",args:arguments,first:!0,allowAsync:!0,key:e}).go()},me.set_options=function(e){return new m.Method(this,function(){merge_options(this,e)},null,{name:"set_options",args:arguments}).go()},me.unload=function(){for(var e=m.map_cache.length-1;0<=e;e--)m.map_cache[e]&&me.unbind.call($(m.map_cache[e].image));me.graphics=null},me.snapshot=function(){return new m.Method(this,function(){$.each(this.data,function(e,t){t.selected=!1}),this.base_canvas=this.graphics.createVisibleCanvas(this),$(this.image).before(this.base_canvas)},null,{name:"snapshot"}).go()},me.state=function(){var i,a=null;return $(this).each(function(e,t){if("IMG"===t.nodeName)return(i=m.getMapData(t))&&(a=i.state()),!1}),a},me.bind=function(o){return this.each(function(e,t){var i,a=$(t),n=m.getMapData(t);if(n){if(me.unbind.apply(a),!n.complete)return!0;n=null}if(i=(t=this.getAttribute("usemap"))&&$('map[name="'+t.substr(1)+'"]'),!(a.is("img")&&t&&0')[0]},clearHighlight:function(){var e=this.map_data.overlay_canvas;e.getContext("2d").clearRect(0,0,e.width,e.height)},refreshSelections:function(){var e=this.map_data,t=e.base_canvas;e.base_canvas=this.createVisibleCanvas(e),h(e.base_canvas).hide(),h(t).before(e.base_canvas),e.redrawSelections(),h(e.base_canvas).show(),h(t).remove()}},o={renderShape:function(e,t,i){var a,n=this,o=e.coords(),s=n.elementName?'name="'+n.elementName+'" ':"",r=i?'class="'+i+'" ':"",c='',l=t.stroke?" strokeweight="+t.strokeWidth+' stroked="t" strokecolor="#'+t.strokeColor+'"':' stroked="f"',u=t.fill?' filled="t"':' filled="f"';switch(e.shape){case"rect":case"rectangle":a="'+c+"";break;case"poly":case"polygon":a="'+c+"";break;case"circ":case"circle":a="'+c+""}return i=h(a),h(n.canvas).append(i),i},render:function(){var i,a=this;return h.each(this.shapes,function(e,t){a.renderShape(t.mapArea,t.options)}),this.masks.length&&h.each(this.masks,function(e,t){i=c.updateProps({},t.options,{fillOpacity:1,fillColor:t.options.fillColorMask}),a.renderShape(t.mapArea,i,"mapster_mask")}),this.active=!1,this.canvas},createCanvasFor:function(e){var t=e.scaleInfo.width,e=e.scaleInfo.height;return h('')[0]},clearHighlight:function(){h(this.map_data.overlay_canvas).children().remove()},removeSelections:function(e){(0<=e?h(this.map_data.base_canvas).find('[name="static_'+e.toString()+'"]'):h(this.map_data.base_canvas).children()).remove()}},h.each(["renderShape","addAltImage","render","createCanvasFor","clearHighlight","removeSelections","refreshSelections"],function(e,t){var i;a[t]=(i=t,function(){return a[i]=(r.hasCanvas()?n:o)[i]||s,a[i].apply(this,arguments)})})}(jQuery),!function(o){"use strict";var e=o.mapster,n=e.utils,t=[];e.MapImages=function(e){this.owner=e,this.clear()},e.MapImages.prototype={constructor:e.MapImages,slice:function(){return t.slice.apply(this,arguments)},splice:function(){return t.slice.apply(this.status,arguments),t.slice.apply(this,arguments)},complete:function(){return o.inArray(!1,this.status)<0},_add:function(e){e=t.push.call(this,e)-1;return this.status[e]=!1,e},indexOf:function(e){return n.indexOf(this,e)},clear:function(){var i=this;i.ids&&0").addClass("mapster_el").hide(),i=n._add(e[0]),e.on("load.mapster",function(e){n.imageLoaded.call(n,e)}).on("error.mapster",function(e){n.imageLoadError.call(n,e)}),e.attr("src",a)}else i=n._add(o(e)[0]);if(t){if(this[t])throw t+" is already used or is not available as an altImage alias.";n.ids.push(t),n[t]=n[i]}return i}},bind:function(){var t=this,i=t.owner.options.configTimeout/50,a=function(){for(var e=t.length;0
'),l.wrapClass&&(!0===l.wrapClass?i.addClass(s[0].className):i.addClass(l.wrapClass))),c.wrapper=i,c.scaleInfo=r=d.scaleMap(c.images[0],c.images[1],l.scaleMap),c.base_canvas=e=c.graphics.createVisibleCanvas(c),c.overlay_canvas=t=c.graphics.createVisibleCanvas(c),a=y(c.images[1]).addClass("mapster_el "+c.images[0].className).attr({id:null,usemap:null}),(o=d.size(c.images[0])).complete&&a.css({width:o.width,height:o.height}),c.buildDataset(),a=y.extend({display:"block",position:"relative",padding:0},!0===l.enableAutoResizeSupport?{}:{width:r.width,height:r.height}),l.wrapCss&&y.extend(a,l.wrapCss),s.parent()[0]!==c.wrapper[0]&&s.before(c.wrapper),i.css(a),y(c.images.slice(2)).hide(),n=1;nw&&t[1]>b)return v=t,!(s=!0)}),s||(v=[l,u])),v}}(jQuery),!function(d){"use strict";var f=d.mapster,m=f.utils,e=f.MapArea.prototype;f.utils.getScaleInfo=function(e,t){var i;return t?.98<(i=e.width/t.width||e.height/t.height)&&i<1.02&&(i=1):(i=1,t=e),{scale:1!==i,scalePct:i,realWidth:t.width,realHeight:t.height,width:e.width,height:e.height,ratio:e.width/e.height}},f.utils.scaleMap=function(e,t,i){e=m.size(e),t=m.size(t,!0);if(t.complete())return e.complete()||(e=t),this.getScaleInfo(e,i?t:null);throw"Another script, such as an extension, appears to be interfering with image loading. Please let us know about this."},f.MapData.prototype.resize=function(t,i,a,n){var o,s,r,c,e,l=this;function u(e,t,i){f.hasCanvas()?(e.width=t,e.height=i):(d(e).width(t),d(e).height(i))}function h(){var e;u(l.overlay_canvas,t,i),0<=c&&((e=l.data[c]).tempOptions={fade:!1},l.getDataForKey(e.key).highlight(),e.tempOptions=null),u(l.base_canvas,t,i),l.redrawSelections(),l.currentAction="",m.isFunction(n)&&n(),l.processCommandQueue()}function p(){d(l.image).css(r),l.scaleInfo=m.getScaleInfo({width:t,height:i},{width:l.scaleInfo.realWidth,height:l.scaleInfo.realHeight}),d.each(l.data,function(e,t){d.each(t.areas(),function(e,t){t.resize()})})}n=n||a,l.scaleInfo.width===t&&l.scaleInfo.height===i||(c=l.highlightId,t||(e=i/l.scaleInfo.realHeight,t=Math.round(l.scaleInfo.realWidth*e)),i||(e=t/l.scaleInfo.realWidth,i=Math.round(l.scaleInfo.realHeight*e)),r={width:String(t)+"px",height:String(i)+"px"},f.hasCanvas()||d(l.base_canvas).children().remove(),e=d(l.wrapper).find(".mapster_el"),!0!==l.options.enableAutoResizeSupport&&(e=e.add(l.wrapper)),a?(s=[],l.currentAction="resizing",e.filter(":visible").each(function(e,t){o=m.defer(),s.push(o),d(t).animate(r,{duration:a,complete:o.resolve,easing:"linear"})}),e.filter(":hidden").css(r),o=m.defer(),s.push(o),m.when.all(s).then(h),p(),o.resolve()):(e.css(r),p(),h()))},f.MapData.prototype.autoResize=function(e,t){this.resize(d(this.wrapper).width()||d(this.wrapper).actual("width"),null,e,t)},f.MapData.prototype.configureAutoResize=function(){var e=this,t=e.instanceEventNamespace();function i(){!0===e.options.autoResize&&e.autoResize(e.options.autoResizeDuration,e.options.onAutoResize)}d(e.image).on("load"+t,i),d(window).on("focus"+t,i),d(window).on("resize"+t,function(){e.autoResizeTimer&&clearTimeout(e.autoResizeTimer),e.autoResizeTimer=setTimeout(i,e.options.autoResizeDelay)}),d(window).on("readystatechange"+t,i),d(window.document).on("fullscreenchange"+t,i),i()},f.MapArea=m.subclass(f.MapArea,function(){this.base.init(),this.owner.scaleInfo.scale&&this.resize()}),e.coords=function(e,t){var i,a=[],n=e||this.owner.scaleInfo.scalePct,o=t||0;if(1===n&&0===t)return this.originalCoords;for(i=0;i
',showToolTip:!1,toolTip:null,toolTipFade:!0,toolTipClose:["area-mouseout","image-mouseout","generic-mouseout"],onShowToolTip:null,onHideToolTip:null}),c.extend(e.area_defaults,{toolTip:null,toolTipClose:null}),e.MapData.prototype.clearToolTip=function(){this.activeToolTip&&(this.activeToolTip.stop().remove(),this.activeToolTip=null,this.activeToolTipID=null,l.ifFunction(this.options.onHideToolTip,this))},e.AreaData.prototype.showToolTip=function(e,t){var i,a,n,o=this,s=o.owner,r=o.effectiveOptions();if(t=t?c.extend({},t):{},e=e||r.toolTip,i=t.closeEvents||r.toolTipClose||s.options.toolTipClose||"tooltip-click",n=void 0!==t.template?t.template:s.options.toolTipContainer,t.closeEvents="string"==typeof i?i=l.split(i):i,t.fadeDuration=t.fadeDuration||(s.options.toolTipFade?(l.isNumeric(r.fadeDuration)?r:s.options).fadeDuration:0),a=o.area||c.map(o.areas(),function(e){return e.area}),s.activeToolTipID!==o.areaId){s.clearToolTip();var e=l.isFunction(e)?e({key:this.key,target:a}):e;if(e)return s.activeToolTip=e=u(e,n,t.css),s.activeToolTipID=o.areaId,n=function(){s.clearToolTip()},h(i,"area-click","click",c(s.map),null,n),h(i,"tooltip-click","click",e,null,n),h(i,"image-mouseout","mouseout",c(s.image),function(e){return e.relatedTarget&&"AREA"!==e.relatedTarget.nodeName&&e.relatedTarget!==o.area},n),h(i,"image-click","click",c(s.image),null,n),p(e,a,s.image,t.container,t),l.ifFunction(s.options.onShowToolTip,o.area,{toolTip:e,options:{},areaOptions:r,key:o.key,selected:o.isSelected()}),e}},e.impl.tooltip=function(s,r){return new e.Method(this,function(){var e,t,i,a,n,o=this;s?(n=(e=c(s))&&0