From 05db123794aef6ffdb709d021d9171095dd7e920 Mon Sep 17 00:00:00 2001 From: techfg Date: Tue, 12 Mar 2024 21:47:45 -0700 Subject: [PATCH] Release v1.6.0 --- CHANGELOG.md | 3 +++ README.md | 10 +++++----- bower.json | 2 +- dist/jquery.imagemapster.js | 19 +++++++++---------- dist/jquery.imagemapster.min.js | 7 +++---- dist/jquery.imagemapster.min.js.map | 2 +- dist/jquery.imagemapster.zepto.js | 19 +++++++++---------- dist/jquery.imagemapster.zepto.min.js | 7 +++---- dist/jquery.imagemapster.zepto.min.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- 11 files changed, 37 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c28e76f..ef113a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ - Make callback data structures consistent - Improve docs +## Version 1.6.0 - 2024.03.12 +- [Issue 394](https://github.com/jamietre/ImageMapster/issues/394) [TouchScreen only] Weird highlight glitch when touch on the other area beside the map. + ## Version 1.5.4 - 2021.02.20 - [Issue 83](https://github.com/jamietre/ImageMapster/issues/83) Fix boundlist sync with selected state - [Issue 377](https://github.com/jamietre/ImageMapster/issues/377) onConfigured not called after rebind diff --git a/README.md b/README.md index 1592858..d0400ae 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ ImageMapster includes several examples. To view the examples: ## Zepto Compatibility -As of ImageMapster v1.3.2, ImageMapster contains full support for Zepto v1.2.0. The latest Zepto compatible version of ImageMapster is [1.5.4](https://github.com/jamietre/ImageMapster/releases/tag/v1.5.4). +As of ImageMapster v1.3.2, ImageMapster contains full support for Zepto v1.2.0. The latest Zepto compatible version of ImageMapster is [1.6.0](https://github.com/jamietre/ImageMapster/releases/tag/v1.6.0). Prior to ImageMapster v1.3.2 and with any version of Zepto except v1.2.0, ImageMapster is unlikely to work as expected. In the early versions of ImageMapster, Zepto support was maintained, however due to changes in Zepto, as of v1.2.5 of ImageMapster, support for Zepto compatability was not maintained as it required too much effort and pushing ImageMapster forward with jQuery was the priority. @@ -177,8 +177,8 @@ To use ImageMapster >= v1.3.2 < 2.0.0 with Zepto v.1.2.0, Zepto must contain the :warning: **_As of ImageMapster v1.3.0, if targeting ES5 browers, you must include a Promise polyfill such as [es6-promise](https://www.npmjs.com/package/es6-promise). See [Issue 341](https://github.com/jamietre/ImageMapster/issues/341) for details._** -1. [jsDelivr](https://www.jsdelivr.com/package/npm/imagemapster?version=1.5.4) - https://www.jsdelivr.com/package/npm/imagemapster?version=1.5.4 -2. [cdnjs](https://cdnjs.com/libraries/imagemapster/1.5.4) - https://cdnjs.com/libraries/imagemapster/1.5.4 +1. [jsDelivr](https://www.jsdelivr.com/package/npm/imagemapster?version=1.6.0) - https://www.jsdelivr.com/package/npm/imagemapster?version=1.6.0 +2. [cdnjs](https://cdnjs.com/libraries/imagemapster/1.6.0) - https://cdnjs.com/libraries/imagemapster/1.6.0 Use `jquery.imagemapster.zepto.min.js` @@ -194,7 +194,7 @@ Use `jquery.imagemapster.zepto.min.js` > ``` @@ -207,7 +207,7 @@ Using `webpack` and `zepto-modules` as an example: #### Install from NPM ```sh -npm install zepto-modules imagemapster@1.5.4 --save +npm install zepto-modules imagemapster@1.6.0 --save ``` #### src/yourzepto.js diff --git a/bower.json b/bower.json index 47b3a07..3898905 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ImageMapster", - "version": "1.5.4", + "version": "1.6.0", "homepage": "https://github.com/jamietre/ImageMapster", "description": "jQuery plugin that activates areas in HTML imagemaps with support for highlighting, selecting, tooltips, resizing and more", "main": "dist/jquery.imagemapster.min.js", diff --git a/dist/jquery.imagemapster.js b/dist/jquery.imagemapster.js index dd1a75d..0bda1f0 100644 --- a/dist/jquery.imagemapster.js +++ b/dist/jquery.imagemapster.js @@ -1,7 +1,7 @@ /*! -* imagemapster - v1.5.4 - 2021-02-20 +* imagemapster - v1.6.0 - 2024-03-12 * https://github.com/jamietre/ImageMapster/ -* Copyright (c) 2011 - 2021 James Treworgy +* Copyright (c) 2011 - 2024 James Treworgy * License: MIT */ (function (factory) { @@ -31,7 +31,7 @@ factory(jQuery); } }(function (jQuery) { - /* + /* jqueryextensions.js Extend/intercept jquery behavior */ @@ -66,23 +66,22 @@ // https://github.com/jquery/jquery/issues/2871#issuecomment-175175180 // https://jsbin.com/bupesajoza/edit?html,js,output var setupListener = function (ns, type, listener) { - if (ns.includes('noPreventDefault')) { - window.addEventListener(type, listener, { passive: true }); + if (ns.includes('mapster') && ns.includes('noPreventDefault')) { + this.addEventListener(type, listener, { passive: true }); } else { - console.warn('non-passive events - listener not added'); return false; } }; - // special events for noPreventDefault + // special events for mapster.noPreventDefault $.event.special.touchstart = { setup: function (_, ns, listener) { - return setupListener(ns, 'touchstart', listener); + return setupListener.call(this, ns, 'touchstart', listener); } }; $.event.special.touchend = { setup: function (_, ns, listener) { - return setupListener(ns, 'touchend', listener); + return setupListener.call(this, ns, 'touchend', listener); } }; } @@ -107,7 +106,7 @@ (function ($) { 'use strict'; - var mapster_version = '1.5.4'; + var mapster_version = '1.6.0'; // all public functions in $.mapster.impl are methods $.fn.mapster = function (method) { diff --git a/dist/jquery.imagemapster.min.js b/dist/jquery.imagemapster.min.js index e43a2db..7ff881a 100644 --- a/dist/jquery.imagemapster.min.js +++ b/dist/jquery.imagemapster.min.js @@ -1,9 +1,8 @@ /*! -* imagemapster - v1.5.4 - 2021-02-20 +* imagemapster - v1.6.0 - 2024-03-12 * https://github.com/jamietre/ImageMapster/ -* Copyright (c) 2011 - 2021 James Treworgy +* Copyright (c) 2011 - 2024 James Treworgy * License: MIT */ - -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),a(t),t}:a(jQuery)}(function(jQuery){!function(a){"use strict";a.event&&a.event.special&&function(){var i,e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0}});window.addEventListener("testPassive.mapster",function(){},t),window.removeEventListener("testPassive.mapster",function(){},t)}catch(e){}e&&(i=function(e,t,a){if(!e.includes("noPreventDefault"))return console.warn("non-passive events - listener not added"),!1;window.addEventListener(t,a,{passive:!0})},a.event.special.touchstart={setup:function(e,t,a){return i(t,"touchstart",a)}},a.event.special.touchend={setup:function(e,t,a){return i(t,"touchend",a)}})}()}(jQuery),function($){"use strict";var mapster_version="1.5.4",Aa,Ba,Ca;$.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:{}},defaults:{clickNavigate:!1,navigateMode:"location",wrapClass:null,wrapCss:null,onGetList:null,sortList:!1,listenToList:!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,safeLoad:!1,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,a){$.each(this.hooks[e]||[],function(e,t){t.apply(a)})},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(a,i){function e(){var e=this,t=Array.prototype.slice.call(arguments,0);e.base=a.prototype,e.base.init=function(){a.prototype.constructor.apply(e,t)},i.apply(e,t)}return(e.prototype=new a).constructor=e},asArray:function(e){return e.constructor===Array?e:this.split(e)},split:function(e,t){for(var a,i=e.split(","),n=0;n=e.index;t--)m.map_cache[t].index--};function hasVml(){var e=$("
").appendTo("body");e.html('');var t=e[0].firstChild;t.style.behavior="url(#default#VML)";t=!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(a,e){var i,n=a.options.areas;e&&$.each(e,function(e,t){t&&t.key&&(0<=(i=u.indexOfProp(n,"key",t.key))?$.extend(n[i],t):n.push(t),(i=a.getDataForKey(t.key))&&$.extend(i.options,t))})}function merge_options(e,t){var a=u.updateProps({},t);delete a.areas,u.updateProps(e.options,a),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)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(t){return new m.Method(this,function(){if(!1!==t){var e=this.highlightId;return 0<=e?this.data[e].key:null}this.ensureNoHighlight()},function(){this.highlight()},{name:"highlight",args:arguments,key:t,first:!0}).go()},me.keys=function(e,i){var n=[],a=m.getMapData(this);if(!a||!a.complete)throw"Can't access data until binding complete.";function o(e){var t,a=[];i?(t=e.areas(),$.each(t,function(e,t){a=a.concat(t.keys)})):a.push(e.key),$.each(a,function(e,t){$.inArray(t,n)<0&&n.push(t)})}return a&&a.complete?("string"==typeof e?i?o(a.getDataForKey(e)):n=[a.getKeysForGroup(e)]:(i=e,this.each(function(e,t){"AREA"===t.nodeName&&o(a.getDataForArea(t))})),n.join(",")):""},me.select=function(){me.set.call(this,!0)},me.deselect=function(){me.set.call(this,!1)},me.set=function(i,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){!function(e){if(e){switch(i){case!0:e.select(l);break;case!1:e.deselect(!0);break;default:e.toggle(l)}}}(t)}),i||e.removeSelectionFinish()}return this.filter("img,area").each(function(e,t){var a;(s=m.getMapData(t))!==o&&(o&&p(o),c=[],r=""),s&&(a="","IMG"===t.nodeName.toUpperCase()?m.queueCommand(s,$(t),"set",[i,n,l])||(n instanceof Array?n.length&&(a=n.join(",")):a=n,a&&$.each(u.split(a),function(e,t){h(s.getDataForKey(t.toString())),o=s})):(l=n,m.queueCommand(s,$(t),"set",[i,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 a=u.isBool(e)?e:t;return new m.Method(this,function(){var e=$.extend({},this.options);return a&&(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 a?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 a,i=null;return $(this).each(function(e,t){if("IMG"===t.nodeName)return(a=m.getMapData(t))&&(i=a.state()),!1}),i},me.bind=function(o){return this.each(function(e,t){var a,i=$(t),n=m.getMapData(t);if(n){if(me.unbind.apply(i),!n.complete)return!0;n=null}if(t=(a=this.getAttribute("usemap"))&&$('map[name="'+a.substr(1)+'"]'),!(i.is("img")&&a&&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,a){var i,n=this,o=e.coords(),s=n.elementName?'name="'+n.elementName+'" ':"",r=a?'class="'+a+'" ':"",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":i="'+c+"";break;case"poly":case"polygon":i="'+c+"";break;case"circ":case"circle":i="'+c+""}return e=h(i),h(n.canvas).append(e),e},render:function(){var a,i=this;return h.each(this.shapes,function(e,t){i.renderShape(t.mapArea,t.options)}),this.masks.length&&h.each(this.masks,function(e,t){a=c.updateProps({},t.options,{fillOpacity:1,fillColor:t.options.fillColorMask}),i.renderShape(t.mapArea,a,"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 a;i[t]=(a=t,function(){return i[a]=(r.hasCanvas()?n:o)[a]||s,i[a].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 a=this;a.ids&&0").addClass("mapster_el").hide(),a=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",i)}else a=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[a]}return a}},bind:function(){var t=this,a=t.owner.options.configTimeout/200,i=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=t=c.graphics.createVisibleCanvas(c),c.overlay_canvas=a=c.graphics.createVisibleCanvas(c),e=y(c.images[1]).addClass("mapster_el "+c.images[0].className).attr({id:null,usemap:null}),(o=d.size(c.images[0])).complete&&e.css({width:o.width,height:o.height}),c.buildDataset(),r=y.extend({display:"block",position:"relative",padding:0},!0===l.enableAutoResizeSupport?{}:{width:r.width,height:r.height}),l.wrapCss&&y.extend(r,l.wrapCss),s.parent()[0]!==c.wrapper[0]&&s.before(c.wrapper),i.css(r),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 a;return t?.98<(a=e.width/t.width||e.height/t.height)&&a<1.02&&(a=1):(a=1,t=e),{scale:1!==a,scalePct:a,realWidth:t.width,realHeight:t.height,width:e.width,height:e.height,ratio:e.width/e.height}},f.utils.scaleMap=function(e,t,a){e=m.size(e),t=m.size(t,!0);if(!t.complete())throw"Another script, such as an extension, appears to be interfering with image loading. Please let us know about this.";return e.complete()||(e=t),this.getScaleInfo(e,a?t:null)},f.MapData.prototype.resize=function(t,a,i,n){var o,s,r,c,e,l=this;function u(e,t,a){f.hasCanvas()?(e.width=t,e.height=a):(d(e).width(t),d(e).height(a))}function h(){var e;u(l.overlay_canvas,t,a),0<=c&&((e=l.data[c]).tempOptions={fade:!1},l.getDataForKey(e.key).highlight(),e.tempOptions=null),u(l.base_canvas,t,a),l.redrawSelections(),l.currentAction="",m.isFunction(n)&&n(),l.processCommandQueue()}function p(){d(l.image).css(r),l.scaleInfo=m.getScaleInfo({width:t,height:a},{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||i,l.scaleInfo.width===t&&l.scaleInfo.height===a||(c=l.highlightId,t||(e=a/l.scaleInfo.realHeight,t=Math.round(l.scaleInfo.realWidth*e)),a||(e=t/l.scaleInfo.realWidth,a=Math.round(l.scaleInfo.realHeight*e)),r={width:String(t)+"px",height:String(a)+"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)),i?(s=[],l.currentAction="resizing",e.filter(":visible").each(function(e,t){o=m.defer(),s.push(o),d(t).animate(r,{duration:i,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(),null,e,t)},f.MapData.prototype.configureAutoResize=function(){var e=this,t=e.instanceEventNamespace();function a(){!0===e.options.autoResize&&e.autoResize(e.options.autoResizeDuration,e.options.onAutoResize)}d(e.image).on("load"+t,a),d(window).on("focus"+t,a),d(window).on("resize"+t,function(){e.autoResizeTimer&&clearTimeout(e.autoResizeTimer),e.autoResizeTimer=setTimeout(a,e.options.autoResizeDelay)}),d(window).on("readystatechange"+t,a),d(window.document).on("fullscreenchange"+t,a),a()},f.MapArea=m.subclass(f.MapArea,function(){this.base.init(),this.owner.scaleInfo.scale&&this.resize()}),e.coords=function(e,t){var a,i=[],n=e||this.owner.scaleInfo.scalePct,o=t||0;if(1===n&&0===t)return this.originalCoords;for(a=0;a',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 a,i,n,o=this,s=o.owner,r=o.effectiveOptions();if(t=t?c.extend({},t):{},e=e||r.toolTip,a=t.closeEvents||r.toolTipClose||s.options.toolTipClose||"tooltip-click",n=void 0!==t.template?t.template:s.options.toolTipContainer,t.closeEvents="string"==typeof a?a=l.split(a):a,t.fadeDuration=t.fadeDuration||(s.options.toolTipFade?s.options.fadeDuration||r.fadeDuration:0),i=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:i}):e;if(e)return s.activeToolTip=e=u(e,n,t.css),s.activeToolTipID=o.areaId,n=function(){s.clearToolTip()},h(a,"area-click","click",c(s.map),null,n),h(a,"tooltip-click","click",e,null,n),h(a,"image-mouseout","mouseout",c(s.image),function(e){return e.relatedTarget&&"AREA"!==e.relatedTarget.nodeName&&e.relatedTarget!==o.area},n),h(a,"image-click","click",c(s.image),null,n),p(e,i,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,a,i,n,o=this;s?(n=(e=c(s))&&0=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/200,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(),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?s.options.fadeDuration||r.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=e.index;t--)m.map_cache[t].index--};function hasVml(){var e=$("
").appendTo("body");e.html('');var t=e[0].firstChild;t.style.behavior="url(#default#VML)";t=!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)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(t){return new m.Method(this,function(){if(!1!==t){var e=this.highlightId;return 0<=e?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)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)})}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(",")):""},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){!function(e){if(e){switch(a){case!0:e.select(l);break;case!1:e.deselect(!0);break;default:e.toggle(l)}}}(t)}),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(t=(i=this.getAttribute("usemap"))&&$('map[name="'+i.substr(1)+'"]'),!(a.is("img")&&i&&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 e=h(a),h(n.canvas).append(e),e},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/200,a=function(){for(var e=t.length;0
'),l.wrapClass&&(!0===l.wrapClass?a.addClass(s[0].className):a.addClass(l.wrapClass))),c.wrapper=a,c.scaleInfo=r=d.scaleMap(c.images[0],c.images[1],l.scaleMap),c.base_canvas=t=c.graphics.createVisibleCanvas(c),c.overlay_canvas=i=c.graphics.createVisibleCanvas(c),e=y(c.images[1]).addClass("mapster_el "+c.images[0].className).attr({id:null,usemap:null}),(o=d.size(c.images[0])).complete&&e.css({width:o.width,height:o.height}),c.buildDataset(),r=y.extend({display:"block",position:"relative",padding:0},!0===l.enableAutoResizeSupport?{}:{width:r.width,height:r.height}),l.wrapCss&&y.extend(r,l.wrapCss),s.parent()[0]!==c.wrapper[0]&&s.before(c.wrapper),a.css(r),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())throw"Another script, such as an extension, appears to be interfering with image loading. Please let us know about this.";return e.complete()||(e=t),this.getScaleInfo(e,i?t:null)},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(),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?s.options.fadeDuration||r.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=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/200,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(),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?s.options.fadeDuration||r.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