--- a/src/pyams_content/zmi/resources/js/jquery-imagemapster-1.2.10.min.js Fri Nov 09 10:41:05 2018 +0100
+++ b/src/pyams_content/zmi/resources/js/jquery-imagemapster-1.2.10.min.js Fri Nov 09 15:22:13 2018 +0100
@@ -1,1 +1,1 @@
-(function(a){a(function(){var d,j,u,c;k.defer=f;k.reject=i;k.isPromise=q;k.all=e;k.some=o;k.any=p;k.map=x;k.reduce=n;k.chain=s;d=Object.freeze||function(y){return y};function g(){}g.prototype=d({always:function(y,z){return this.then(y,y,z)},otherwise:function(y){return this.then(c,y)}});function t(y){var z=new g();z.then=function(C){var A;try{if(C){A=C(y)}return r(A===c?y:A)}catch(B){return w(B)}};return d(z)}function w(z){var y=new g();y.then=function(D,A){var B;try{if(A){B=A(z);return r(B===c?z:B)}return w(z)}catch(C){return w(C)}};return d(y)}function i(y){return k(y,function(z){return w(z)})}function f(){var H,J,F,D,B,z,A;F=[];D=[];B=function E(N,L,M){var K=f();F.push(function(O){O.then(N,L).then(K.resolve,K.reject,K.progress)});M&&D.push(M);return K.promise};function C(M,K,L){return B(M,K,L)}function G(K){A(t(K))}function I(K){A(w(K))}z=function(M){var K,L=0;while(K=D[L++]){K(M)}};function y(K){z(K)}A=function(L){var N,K=0;B=L.then;A=z=function M(){throw new Error("already completed")};D=c;while(N=F[K++]){N(L)}F=[]};H={};J=new g();J.then=H.then=C;H.promise=d(J);H.resolver=d({resolve:(H.resolve=G),reject:(H.reject=I),progress:(H.progress=y)});return H}function q(y){return y&&typeof y.then==="function"}function k(A,C,B,z){var y=r(A);return y.then(C,B,z)}function r(y){var A,z;if(y instanceof g){A=y}else{z=f();if(q(y)){y.then(z.resolve,z.reject,z.progress);A=z.promise}else{z.resolve(y);A=z.promise}}return A}function o(B,A,C,z,y){m(2,arguments);return k(B,function(H){var M,J,L,P,F,G,O,K,I;K=H.length>>>0;M=Math.max(0,Math.min(A,K));J=[];P=f();L=k(P,C,z,y);function N(R){F(R)}function Q(R){G(R)}function D(R){O(R)}function E(){F=G=O=h}if(!M){P.resolve(J)}else{F=function(R){J.push(R);if(!--M){E();P.resolve(J)}};G=function(R){E();P.reject(R)};O=P.progress;for(I=0;I<K;++I){if(I in H){k(H[I],N,Q,D)}}}return L})}function e(A,B,z,y){m(1,arguments);return k(A,function(C){return v(C,l,[])}).then(B,z,y)}function l(z,A,y){z[y]=A;return z}function p(A,C,z,y){function B(D){return C?C(D[0]):D[0]}return o(A,1,B,z,y)}function x(z,y){return k(z,function(A){return b(A,y)})}function b(B,C){var A,y,z;y=B.length>>>0;A=new Array(y);for(z=0;z<y;z++){if(z in B){A[z]=k(B[z],C)}}return v(A,l,A)}function n(B,A,y){var z=u.call(arguments,1);return k(B,function(C){return v.apply(c,[C].concat(z))})}function v(C,A,y){var B,z;B=C.length;z=[function(E,F,D){return k(E,function(G){return k(F,function(H){return A(G,H,D,B)})})}];if(arguments.length>2){z.push(y)}return j.apply(C,z)}function s(y,B,A){var z=arguments.length>2;return k(y,function(C){if(z){C=A}B.resolve(C);return C},function(C){B.reject(C);return w(C)},B.progress)}function m(B,A){var y,z=A.length;while(z>B){y=A[--z];if(y!=null&&typeof y!="function"){throw new Error("callback is not a function")}}}function h(){}u=[].slice;j=[].reduce||function(D){var z,B,A,y,C;C=0;z=Object(this);y=z.length>>>0;B=arguments;if(B.length<=1){for(;;){if(C in z){A=z[C++];break}if(++C>=y){throw new TypeError()}}}else{A=B[1]}for(;C<y;++C){if(C in z){A=D(A,z[C],C,z)}}return A};return k})})(typeof define=="function"?define:function(a){typeof module!="undefined"?(module.exports=a()):(jQuery.mapster_when=a())});(function($){$.fn.mapster=function(method){var m=$.mapster.impl;if($.isFunction(m[method])){return m[method].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof method==="object"||!method){return m.bind.apply(this,arguments)}else{$.error("Method "+method+" does not exist on jQuery.mapster")}}};$.mapster={version:"1.2.10",render_defaults:{isSelectable:true,isDeselectable:true,fade:false,fadeDuration:150,fill:true,fillColor:"000000",fillColorMask:"FFFFFF",fillOpacity:0.7,highlight:true,stroke:false,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,includeKeys:"",altImage:null,altImageId:null,altImages:{}},defaults:{clickNavigate:false,wrapClass:null,wrapCss:null,onGetList:null,sortList:false,listenToList:false,mapKey:"",mapValue:"",singleSelect:false,listKey:"value",listSelectedAttribute:"selected",listSelectedClass:null,onClick:null,onMouseover:null,onMouseout:null,mouseoutDelay:0,onStateChange:null,boundList:null,onConfigured:null,configTimeout:30000,noHrefIsMask:true,scaleMap:true,safeLoad:false,areas:[]},shared_defaults:{render_highlight:{fade:true},render_select:{fade:false},staticState:null,selected:null},area_defaults:{includeKeys:"",isMask:false},canvas_style:{position:"absolute",left:0,top:0,padding:0,border:0},hasCanvas:null,isTouch:null,map_cache:[],hooks:{},addHook:function(name,callback){this.hooks[name]=(this.hooks[name]||[]).push(callback)},callHooks:function(name,context){$.each(this.hooks[name]||[],function(i,e){e.apply(context)})},utils:{when:$.mapster_when,defer:$.mapster_when.defer,subclass:function(BaseClass,constr){var Subclass=function(){var me=this,args=Array.prototype.slice.call(arguments,0);me.base=BaseClass.prototype;me.base.init=function(){BaseClass.prototype.constructor.apply(me,args)};constr.apply(me,args)};Subclass.prototype=new BaseClass();Subclass.prototype.constructor=Subclass;return Subclass},asArray:function(obj){return obj.constructor===Array?obj:this.split(obj)},split:function(text,cb){var i,el,arr=text.split(",");for(i=0;i<arr.length;i++){el=$.trim(arr[i]);if(el===""){arr.splice(i,1)}else{arr[i]=cb?cb(el):el}}return arr},updateProps:function(_target,_template){var onlyProps,target=_target||{},template=$.isEmptyObject(target)?_template:_target;onlyProps=[];$.each(template,function(prop){onlyProps.push(prop)});$.each(Array.prototype.slice.call(arguments,1),function(i,src){$.each(src||{},function(prop){if(!onlyProps||$.inArray(prop,onlyProps)>=0){var p=src[prop];if($.isPlainObject(p)){target[prop]=$.extend(target[prop]||{},p)}else{if(p&&p.constructor===Array){target[prop]=p.slice(0)}else{if(typeof p!=="undefined"){target[prop]=src[prop]}}}}})});return target},isElement:function(o){return(typeof HTMLElement==="object"?o instanceof HTMLElement:o&&typeof o==="object"&&o.nodeType===1&&typeof o.nodeName==="string")},indexOfProp:function(obj,prop,val){var result=obj.constructor===Array?-1:null;$.each(obj,function(i,e){if(e&&(prop?e[prop]:e)===val){result=i;return false}});return result},boolOrDefault:function(obj,def){return this.isBool(obj)?obj:def||false},isBool:function(obj){return typeof obj==="boolean"},isUndef:function(obj){return typeof obj==="undefined"},ifFunction:function(obj,that,args){if($.isFunction(obj)){obj.call(that,args)}},size:function(image,raw){var u=$.mapster.utils;return{width:raw?(image.width||image.naturalWidth):u.imgWidth(image,true),height:raw?(image.height||image.naturalHeight):u.imgHeight(image,true),complete:function(){return !!this.height&&!!this.width}}},setOpacity:function(el,opacity){if($.mapster.hasCanvas()){el.style.opacity=opacity}else{$(el).each(function(i,e){if(typeof e.opacity!=="undefined"){e.opacity=opacity}else{$(e).css("opacity",opacity)}})}},fader:(function(){var elements={},lastKey=0,fade_func=function(el,op,endOp,duration){var index,cbIntervals=duration/15,obj,u=$.mapster.utils;if(typeof el==="number"){obj=elements[el];if(!obj){return}}else{index=u.indexOfProp(elements,null,el);if(index){delete elements[index]}elements[++lastKey]=obj=el;el=lastKey}endOp=endOp||1;op=(op+(endOp/cbIntervals)>endOp-0.01)?endOp:op+(endOp/cbIntervals);u.setOpacity(obj,op);if(op<endOp){setTimeout(function(){fade_func(el,op,endOp,duration)},15)}};return fade_func}())},getBoundList:function(opts,key_list){if(!opts.boundList){return null}var index,key,result=$(),list=$.mapster.utils.split(key_list);opts.boundList.each(function(i,e){for(index=0;index<list.length;index++){key=list[index];if($(e).is("["+opts.listKey+'="'+key+'"]')){result=result.add(e)}}});return result},setBoundListProperties:function(opts,target,selected){target.each(function(i,e){if(opts.listSelectedClass){if(selected){$(e).addClass(opts.listSelectedClass)}else{$(e).removeClass(opts.listSelectedClass)}}if(opts.listSelectedAttribute){$(e).attr(opts.listSelectedAttribute,selected)}})},getMapDataIndex:function(obj){var img,id;switch(obj.tagName&&obj.tagName.toLowerCase()){case"area":id=$(obj).parent().attr("name");img=$("img[usemap='#"+id+"']")[0];break;case"img":img=obj;break}return img?this.utils.indexOfProp(this.map_cache,"image",img):-1},getMapData:function(obj){var index=this.getMapDataIndex(obj.length?obj[0]:obj);if(index>=0){return index>=0?this.map_cache[index]:null}},queueCommand:function(map_data,that,command,args){if(!map_data){return false}if(!map_data.complete||map_data.currentAction){map_data.commands.push({that:that,command:command,args:args});return true}return false},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(i,e){var capProp=e.substr(0,1).toUpperCase()+e.substr(1);u["img"+capProp]=function(img,jqwidth){return(jqwidth?$(img)[e]():0)||img[e]||img["natural"+capProp]||img["client"+capProp]||img["offset"+capProp]}});m.Method=function(that,func_map,func_area,opts){var me=this;me.name=opts.name;me.output=that;me.input=that;me.first=opts.first||false;me.args=opts.args?ap.slice.call(opts.args,0):[];me.key=opts.key;me.func_map=func_map;me.func_area=func_area;me.name=opts.name;me.allowAsync=opts.allowAsync||false};m.Method.prototype={constructor:m.Method,go:function(){var i,data,ar,len,result,src=this.input,area_list=[],me=this;len=src.length;for(i=0;i<len;i++){data=$.mapster.getMapData(src[i]);if(data){if(!me.allowAsync&&m.queueCommand(data,me.input,me.name,me.args)){if(this.first){result=""}continue}ar=data.getData(src[i].nodeName==="AREA"?src[i]:this.key);if(ar){if($.inArray(ar,area_list)<0){area_list.push(ar)}}else{result=this.func_map.apply(data,me.args)}if(this.first||typeof result!=="undefined"){break}}}$(area_list).each(function(i,e){result=me.func_area.apply(e,me.args)});if(typeof result!=="undefined"){return result}else{return this.output}}};$.mapster.impl=(function(){var me={},addMap=function(map_data){return m.map_cache.push(map_data)-1},removeMap=function(map_data){m.map_cache.splice(map_data.index,1);for(var i=m.map_cache.length-1;i>=this.index;i--){m.map_cache[i].index--}};function hasVml(){var a=$("<div />").appendTo("body");a.html('<v:shape id="vml_flag1" adj="1" />');var b=a[0].firstChild;b.style.behavior="url(#default#VML)";var has=b?typeof b.adj==="object":true;a.remove();return has}function namespaces(){return typeof(document.namespaces)==="object"?document.namespaces:null}function hasCanvas(){var d=namespaces();return d&&d.g_vml_?false:$("<canvas />")[0].getContext?true:false}function merge_areas(map_data,areas){var ar,index,map_areas=map_data.options.areas;if(areas){$.each(areas,function(i,e){if(!e||!e.key){return}index=u.indexOfProp(map_areas,"key",e.key);if(index>=0){$.extend(map_areas[index],e)}else{map_areas.push(e)}ar=map_data.getDataForKey(e.key);if(ar){$.extend(ar.options,e)}})}}function merge_options(map_data,options){var temp_opts=u.updateProps({},options);delete temp_opts.areas;u.updateProps(map_data.options,temp_opts);merge_areas(map_data,options.areas);u.updateProps(map_data.area_options,map_data.options)}me.get=function(key){var md=m.getMapData(this);if(!(md&&md.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:key,first:true,allowAsync:true,defaultReturn:""})).go()};me.data=function(key){return(new m.Method(this,null,function(){return this},{name:"data",args:arguments,key:key})).go()};me.highlight=function(key){return(new m.Method(this,function(){if(key===false){this.ensureNoHighlight()}else{var id=this.highlightId;return id>=0?this.data[id].key:null}},function(){this.highlight()},{name:"highlight",args:arguments,key:key,first:true})).go()};me.keys=function(key,all){var keyList=[],md=m.getMapData(this);if(!(md&&md.complete)){throw ("Can't access data until binding complete.")}function addUniqueKeys(ad){var areas,keys=[];if(!all){keys.push(ad.key)}else{areas=ad.areas();$.each(areas,function(i,e){keys=keys.concat(e.keys)})}$.each(keys,function(i,e){if($.inArray(e,keyList)<0){keyList.push(e)}})}if(!(md&&md.complete)){return""}if(typeof key==="string"){if(all){addUniqueKeys(md.getDataForKey(key))}else{keyList=[md.getKeysForGroup(key)]}}else{all=key;this.each(function(i,e){if(e.nodeName==="AREA"){addUniqueKeys(md.getDataForArea(e))}})}return keyList.join(",")};me.select=function(){me.set.call(this,true)};me.deselect=function(){me.set.call(this,false)};me.set=function(selected,key,options){var lastMap,map_data,opts=options,key_list,area_list;function setSelection(ar){if(ar){switch(selected){case true:ar.select(opts);break;case false:ar.deselect(true);break;default:ar.toggle(opts);break}}}function addArea(ar){if(ar&&$.inArray(ar,area_list)<0){area_list.push(ar);key_list+=(key_list===""?"":",")+ar.key}}function finishSetForMap(map_data){$.each(area_list,function(i,el){setSelection(el)});if(!selected){map_data.removeSelectionFinish()}if(map_data.options.boundList){m.setBoundListProperties(map_data.options,m.getBoundList(map_data.options,key_list),selected)}}this.filter("img,area").each(function(i,e){var keys;map_data=m.getMapData(e);if(map_data!==lastMap){if(lastMap){finishSetForMap(lastMap)}area_list=[];key_list=""}if(map_data){keys="";if(e.nodeName.toUpperCase()==="IMG"){if(!m.queueCommand(map_data,$(e),"set",[selected,key,opts])){if(key instanceof Array){if(key.length){keys=key.join(",")}}else{keys=key}if(keys){$.each(u.split(keys),function(i,key){addArea(map_data.getDataForKey(key.toString()));lastMap=map_data})}}}else{opts=key;if(!m.queueCommand(map_data,$(e),"set",[selected,opts])){addArea(map_data.getDataForArea(e));lastMap=map_data}}}});if(map_data){finishSetForMap(map_data)}return this};me.unbind=function(preserveState){return(new m.Method(this,function(){this.clearEvents();this.clearMapData(preserveState);removeMap(this)},null,{name:"unbind",args:arguments})).go()};me.rebind=function(options){return(new m.Method(this,function(){var me=this;me.complete=false;me.configureOptions(options);me.bindImages().then(function(){me.buildDataset(true);me.complete=true})},null,{name:"rebind",args:arguments})).go()};me.get_options=function(key,effective){var eff=u.isBool(key)?key:effective;return(new m.Method(this,function(){var opts=$.extend({},this.options);if(eff){opts.render_select=u.updateProps({},m.render_defaults,opts,opts.render_select);opts.render_highlight=u.updateProps({},m.render_defaults,opts,opts.render_highlight)}return opts},function(){return eff?this.effectiveOptions():this.options},{name:"get_options",args:arguments,first:true,allowAsync:true,key:key})).go()};me.set_options=function(options){return(new m.Method(this,function(){merge_options(this,options)},null,{name:"set_options",args:arguments})).go()};me.unload=function(){var i;for(i=m.map_cache.length-1;i>=0;i--){if(m.map_cache[i]){me.unbind.call($(m.map_cache[i].image))}}me.graphics=null};me.snapshot=function(){return(new m.Method(this,function(){$.each(this.data,function(i,e){e.selected=false});this.base_canvas=this.graphics.createVisibleCanvas(this);$(this.image).before(this.base_canvas)},null,{name:"snapshot"})).go()};me.state=function(){var md,result=null;$(this).each(function(i,e){if(e.nodeName==="IMG"){md=m.getMapData(e);if(md){result=md.state()}return false}});return result};me.bind=function(options){return this.each(function(i,e){var img,map,usemap,md;img=$(e);md=m.getMapData(e);if(md){me.unbind.apply(img);if(!md.complete){img.bind();return true}md=null}usemap=this.getAttribute("usemap");map=usemap&&$('map[name="'+usemap.substr(1)+'"]');if(!(img.is("img")&&usemap&&map.size()>0)){return true}img.css("border",0);if(!md){md=new m.MapData(this,options);md.index=addMap(md);md.map=map;md.bindImages().then(function(){md.initialize()})}})};me.init=function(useCanvas){var style,shapes;m.hasCanvas=function(){if(!u.isBool(m.hasCanvas.value)){m.hasCanvas.value=u.isBool(useCanvas)?useCanvas:hasCanvas()}return m.hasCanvas.value};m.hasVml=function(){if(!u.isBool(m.hasVml.value)){var d=namespaces();if(d&&!d.v){d.add("v","urn:schemas-microsoft-com:vml");style=document.createStyleSheet();shapes=["shape","rect","oval","circ","fill","stroke","imagedata","group","textbox"];$.each(shapes,function(i,el){style.addRule("v\\:"+el,"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)};return me}());$.mapster.impl.init()}(jQuery));(function(e){var a,d=e.mapster,i=d.utils,g,b;function h(l,n,m){var o=l,p=o.map_data,k=m.isMask;e.each(n.areas(),function(q,r){m.isMask=k||(r.nohref&&p.options.noHrefIsMask);o.addShape(r,m)});m.isMask=k}function c(k){return Math.max(0,Math.min(parseInt(k,16),255))}function f(k,l){return"rgba("+c(k.substr(0,2))+","+c(k.substr(2,2))+","+c(k.substr(4,2))+","+l+")"}d.Graphics=function(l){var k=this;k.active=false;k.canvas=null;k.width=0;k.height=0;k.shapes=[];k.masks=[];k.map_data=l};a=d.Graphics.prototype={constructor:d.Graphics,begin:function(l,k){var m=e(l);this.elementName=k;this.canvas=l;this.width=m.width();this.height=m.height();this.shapes=[];this.masks=[];this.active=true},addShape:function(m,l){var k=l.isMask?this.masks:this.shapes;k.push({mapArea:m,options:l})},createVisibleCanvas:function(k){return e(this.createCanvasFor(k)).addClass("mapster_el").css(d.canvas_style)[0]},addShapeGroup:function(r,n,s){var q=this,o,l,m,p=this.map_data,k=r.effectiveRenderOptions(n);if(s){e.extend(k,s)}if(n==="select"){l="static_"+r.areaId.toString();m=p.base_canvas}else{m=p.overlay_canvas}q.begin(m,l);if(k.includeKeys){o=i.split(k.includeKeys);e.each(o,function(u,v){var t=p.getDataForKey(v.toString());h(q,t,t.effectiveRenderOptions(n))})}h(q,r,k);q.render();if(k.fade){i.fader(d.hasCanvas()?m:e(m).find("._fill").not(".mapster_mask"),0,d.hasCanvas()?1:k.fillOpacity,k.fadeDuration)}}};function j(){}g={renderShape:function(l,m,n){var k,o=m.coords(null,n);switch(m.shape){case"rect":l.rect(o[0],o[1],o[2]-o[0],o[3]-o[1]);break;case"poly":l.moveTo(o[0],o[1]);for(k=2;k<m.length;k+=2){l.lineTo(o[k],o[k+1])}l.lineTo(o[0],o[1]);break;case"circ":case"circle":l.arc(o[0],o[1],o[2],0,Math.PI*2,false);break}},addAltImage:function(l,n,m,k){l.beginPath();this.renderShape(l,m);l.closePath();l.clip();l.globalAlpha=k.altImageOpacity||k.fillOpacity;l.drawImage(n,0,0,m.owner.scaleInfo.width,m.owner.scaleInfo.height)},render:function(){var p,n,m=this,o=m.map_data,r=m.masks.length,q=m.createCanvasFor(o),l=q.getContext("2d"),k=m.canvas.getContext("2d");if(r){p=m.createCanvasFor(o);n=p.getContext("2d");n.clearRect(0,0,p.width,p.height);e.each(m.masks,function(s,t){n.save();n.beginPath();m.renderShape(n,t.mapArea);n.closePath();n.clip();n.lineWidth=0;n.fillStyle="#000";n.fill();n.restore()})}e.each(m.shapes,function(t,u){l.save();if(u.options.fill){if(u.options.altImageId){m.addAltImage(l,o.images[u.options.altImageId],u.mapArea,u.options)}else{l.beginPath();m.renderShape(l,u.mapArea);l.closePath();l.fillStyle=f(u.options.fillColor,u.options.fillOpacity);l.fill()}}l.restore()});e.each(m.shapes.concat(m.masks),function(t,u){var v=u.options.strokeWidth===1?0.5:0;if(u.options.stroke){l.save();l.strokeStyle=f(u.options.strokeColor,u.options.strokeOpacity);l.lineWidth=u.options.strokeWidth;l.beginPath();m.renderShape(l,u.mapArea,v);l.closePath();l.stroke();l.restore()}});if(r){n.globalCompositeOperation="source-out";n.drawImage(q,0,0);k.drawImage(p,0,0)}else{k.drawImage(q,0,0)}m.active=false;return m.canvas},createCanvasFor:function(k){return e('<canvas width="'+k.scaleInfo.width+'" height="'+k.scaleInfo.height+'"></canvas>')[0]},clearHighlight:function(){var k=this.map_data.overlay_canvas;k.getContext("2d").clearRect(0,0,k.width,k.height)},refreshSelections:function(){var k,l=this.map_data;k=l.base_canvas;l.base_canvas=this.createVisibleCanvas(l);e(l.base_canvas).hide();e(k).before(l.base_canvas);l.redrawSelections();e(l.base_canvas).show();e(k).remove()}};b={renderShape:function(n,v,k){var p=this,t,u,m,l,r,q,s,o=n.coords();r=p.elementName?'name="'+p.elementName+'" ':"";q=k?'class="'+k+'" ':"";l='<v:fill color="#'+v.fillColor+'" class="_fill" opacity="'+(v.fill?v.fillOpacity:0)+'" /><v:stroke class="_fill" opacity="'+v.strokeOpacity+'"/>';u=v.stroke?" strokeweight="+v.strokeWidth+' stroked="t" strokecolor="#'+v.strokeColor+'"':' stroked="f"';t=v.fill?' filled="t"':' filled="f"';switch(n.shape){case"rect":s="<v:rect "+q+r+t+u+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+o[0]+"px;top:"+o[1]+"px;width:"+(o[2]-o[0])+"px;height:"+(o[3]-o[1])+'px;">'+l+"</v:rect>";break;case"poly":s="<v:shape "+q+r+t+u+' coordorigin="0,0" coordsize="'+p.width+","+p.height+'" path="m '+o[0]+","+o[1]+" l "+o.slice(2).join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+p.width+"px;height:"+p.height+'px;">'+l+"</v:shape>";break;case"circ":case"circle":s="<v:oval "+q+r+t+u+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(o[0]-o[2])+"px;top:"+(o[1]-o[2])+"px;width:"+(o[2]*2)+"px;height:"+(o[2]*2)+'px;">'+l+"</v:oval>";break}m=e(s);e(p.canvas).append(m);return m},render:function(){var l,k=this;e.each(this.shapes,function(m,n){k.renderShape(n.mapArea,n.options)});if(this.masks.length){e.each(this.masks,function(m,n){l=i.updateProps({},n.options,{fillOpacity:1,fillColor:n.options.fillColorMask});k.renderShape(n.mapArea,l,"mapster_mask")})}this.active=false;return this.canvas},createCanvasFor:function(m){var k=m.scaleInfo.width,l=m.scaleInfo.height;return e('<var width="'+k+'" height="'+l+'" style="zoom:1;overflow:hidden;display:block;width:'+k+"px;height:"+l+'px;"></var>')[0]},clearHighlight:function(){e(this.map_data.overlay_canvas).children().remove()},removeSelections:function(k){if(k>=0){e(this.map_data.base_canvas).find('[name="static_'+k.toString()+'"]').remove()}else{e(this.map_data.base_canvas).children().remove()}}};e.each(["renderShape","addAltImage","render","createCanvasFor","clearHighlight","removeSelections","refreshSelections"],function(k,l){a[l]=(function(m){return function(){a[m]=(d.hasCanvas()?g[m]:b[m])||j;return a[m].apply(this,arguments)}}(l))})}(jQuery));(function(d){var a=d.mapster,b=a.utils,c=[];a.MapImages=function(e){this.owner=e;this.clear()};a.MapImages.prototype={constructor:a.MapImages,slice:function(){return c.slice.apply(this,arguments)},splice:function(){c.slice.apply(this.status,arguments);var e=c.slice.apply(this,arguments);return e},complete:function(){return d.inArray(false,this.status)<0},_add:function(f){var e=c.push.call(this,f)-1;this.status[e]=false;return e},indexOf:function(e){return d.inArray(e,this)},clear:function(){var e=this;if(e.ids&&e.ids.length>0){d.each(e.ids,function(f,g){delete e[g]})}e.ids=[];e.length=0;e.status=[];e.splice(0)},add:function(g,i){var e,h,f=this;if(!g){return}if(typeof g==="string"){h=g;g=f[h];if(typeof g==="object"){return f.indexOf(g)}g=d("<img />").addClass("mapster_el").hide();e=f._add(g[0]);g.bind("load",function(j){f.imageLoaded.call(f,j)}).bind("error",function(j){f.imageLoadError.call(f,j)});g.attr("src",h)}else{e=f._add(d(g)[0])}if(i){if(this[i]){throw (i+" is already used or is not available as an altImage alias.")}f.ids.push(i);f[i]=f[e]}return e},bind:function(g){var h=this,i,e=h.owner.options.configTimeout/200,f=function(){var j;j=h.length;while(j-->0){if(!h.isLoaded(j)){break}}if(h.complete()){h.resolve()}else{if(e-->0){h.imgTimeout=window.setTimeout(function(){f.call(h,true)},50)}else{h.imageLoadError.call(h)}}};i=h.deferred=b.defer();f();return i},resolve:function(){var e=this,f=e.deferred;if(f){e.deferred=null;f.resolve()}},imageLoaded:function(h){var g=this,f=g.indexOf(h.target);if(f>=0){g.status[f]=true;if(d.inArray(false,g.status)<0){g.resolve()}}},imageLoadError:function(g){clearTimeout(this.imgTimeout);this.triesLeft=0;var f=g?"The image "+g.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 f},isLoaded:function(g){var f,h=this,e=h.status;if(e[g]){return true}f=h[g];if(typeof f.complete!=="undefined"){e[g]=f.complete}else{e[g]=!!b.imgWidth(f)}return e[g]}}}(jQuery));(function(h){var d=h.mapster,k=d.utils;function a(m){h.extend(m,{complete:false,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 e(m){return[m,m.render_highlight,m.render_select]}function g(o){var n=o.options,m=o.images;if(d.hasCanvas()){h.each(n.altImages||{},function(p,q){m.add(q,p)});h.each([n].concat(n.areas),function(p,q){h.each(e(q),function(r,s){if(s&&s.altImage){s.altImageId=m.add(s.altImage)}})})}o.area_options=k.updateProps({},d.area_defaults,n)}function f(q,o,p,n){n=n||k.when.defer();function m(r){if(q.currentAreaId!==r&&q.highlightId>=0){n.resolve()}}if(q.activeAreaEvent){window.clearTimeout(q.activeAreaEvent);q.activeAreaEvent=0}if(o<0){return}if(p.owner.currentAction||o){q.activeAreaEvent=window.setTimeout((function(){return function(){f(q,0,p,n)}}(p)),o||100)}else{m(p.areaId)}return n}function c(m){if(!d.hasCanvas()){this.blur()}m.preventDefault()}function j(n,o){var p=n.getAllDataForArea(this),m=p.length?p[0]:null;if(!m||m.isNotRendered()||m.owner.currentAction){return}if(n.currentAreaId===m.areaId){return}if(n.highlightId!==m.areaId){n.clearEffects();m.highlight();if(n.options.showToolTip){h.each(p,function(q,r){if(r.effectiveOptions().toolTip){r.showToolTip()}})}}n.currentAreaId=m.areaId;if(h.isFunction(n.options.onMouseover)){n.options.onMouseover.call(this,{e:o,options:m.effectiveOptions(),key:m.key,selected:m.isSelected()})}}function i(p,q){var n,m=p.getDataForArea(this),o=p.options;if(p.currentAreaId<0||!m){return}n=p.getDataForArea(q.relatedTarget);if(n===m){return}p.currentAreaId=-1;m.area=null;f(p,o.mouseoutDelay,m).then(p.clearEffects);if(h.isFunction(o.onMouseout)){o.onMouseout.call(this,{e:q,options:o,key:m.key,selected:m.isSelected()})}}function b(n){var m=n.options;n.ensureNoHighlight();if(m.toolTipClose&&h.inArray("area-mouseout",m.toolTipClose)>=0&&n.activeToolTip){n.clearToolTip()}}function l(w,u){var r,v,o,q,x,s,t=this,p=w.getDataForArea(this),n=w.options;function m(z){var y,A;x=(z.isSelectable()&&(z.isDeselectable()||!z.isSelected()));if(x){q=!z.isSelected()}else{q=z.isSelected()}o=d.getBoundList(n,z.key);if(h.isFunction(n.onClick)){s=n.onClick.call(t,{e:u,listTarget:o,key:z.key,selected:q});if(k.isBool(s)){if(!s){return false}A=h(z.area).attr("href");if(A!=="#"){window.location.href=A;return false}}}if(x){r=z.toggle()}if(n.boundList&&n.boundList.length>0){d.setBoundListProperties(n,o,z.isSelected())}y=z.effectiveOptions();if(y.includeKeys){v=k.split(y.includeKeys);h.each(v,function(C,D){var B=w.getDataForKey(D.toString());if(!B.options.isMask){m(B)}})}}c.call(this,u);if(n.clickNavigate&&p.href){window.location.href=p.href;return}if(p&&!p.owner.currentAction){n=w.options;m(p)}}d.MapData=function(o,m){var n=this;n.image=o;n.images=new d.MapImages(n);n.graphics=new d.Graphics(n);n.imgCssText=o.style.cssText||null;a(n);n.configureOptions(m);n.mouseover=function(p){j.call(this,n,p)};n.mouseout=function(p){i.call(this,n,p)};n.click=function(p){l.call(this,n,p)};n.clearEffects=function(p){b.call(this,n,p)}};d.MapData.prototype={constructor:d.MapData,configureOptions:function(m){this.options=k.updateProps({},d.defaults,m)},bindImages:function(){var n=this,m=n.images;if(m.length>2){m.splice(2)}else{if(m.length===0){m.add(n.image);m.add(n.image.src)}}g(n);return n.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(m){return typeof m==="string"&&this._xref.hasOwnProperty(m)?this._xref[m]:-1},getSelected:function(){var m="";h.each(this.data,function(n,o){if(o.isSelected()){m+=(m?",":"")+this.key}});return m},getAllDataForArea:function(s,r){var p,n,m,q=this,o=h(s).filter("area").attr(q.options.mapKey);if(o){m=[];o=k.split(o);for(p=0;p<(r||o.length);p++){n=q.data[q._idFromKey(o[p])];n.area=s.length?s[0]:s;m.push(n)}}return m},getDataForArea:function(n){var m=this.getAllDataForArea(n,1);return m?m[0]||null:null},getDataForKey:function(m){return this.data[this._idFromKey(m)]},getKeysForGroup:function(n){var m=this.getDataForKey(n);return !m?"":m.isPrimary?m.key:this.getPrimaryKeysForMapAreas(m.areas()).join(",")},getPrimaryKeysForMapAreas:function(m){var n=[];h.each(m,function(o,p){if(h.inArray(p.keys[0],n)<0){n.push(p.keys[0])}});return n},getData:function(m){if(typeof m==="string"){return this.getDataForKey(m)}else{if(m&&m.mapster||k.isElement(m)){return this.getDataForArea(m)}else{return null}}},ensureNoHighlight:function(){var m;if(this.highlightId>=0){this.graphics.clearHighlight();m=this.data[this.highlightId];m.changeState("highlight",false);this.setHighlightId(-1)}},setHighlightId:function(m){this.highlightId=m},clearSelections:function(){h.each(this.data,function(m,n){if(n.selected){n.deselect(true)}});this.removeSelectionFinish()},setAreaOptions:function(n){var p,o,m;n=n||[];for(p=n.length-1;p>=0;p--){o=n[p];if(o){m=this.getDataForKey(o.key);if(m){k.updateProps(m.options,o);if(k.isBool(o.selected)){m.selected=o.selected}}}}},drawSelections:function(o){var m,n=k.asArray(o);for(m=n.length-1;m>=0;m--){this.data[n[m]].drawSelection()}},redrawSelections:function(){h.each(this.data,function(m,n){if(n.isSelectedOrStatic()){n.drawSelection()}})},initialize:function(){var y,r,n,p,u,v,t,z,s,o,x,q,w=this,m=w.options;if(w.complete){return}s=h(w.image);u=s.parent().attr("id");if(u&&u.length>=12&&u.substring(0,12)==="mapster_wrap"){p=s.parent();p.attr("id",w.wrapId())}else{p=h('<div id="'+w.wrapId()+'"></div>');if(m.wrapClass){if(m.wrapClass===true){p.addClass(s[0].className)}else{p.addClass(m.wrapClass)}}}w.wrapper=p;w.scaleInfo=q=k.scaleMap(w.images[0],w.images[1],m.scaleMap);w.base_canvas=r=w.graphics.createVisibleCanvas(w);w.overlay_canvas=n=w.graphics.createVisibleCanvas(w);y=h(w.images[1]).addClass("mapster_el "+w.images[0].className).attr({id:null,usemap:null});z=k.size(w.images[0]);if(z.complete){y.css({width:z.width,height:z.height})}w.buildDataset();v={display:"block",position:"relative",padding:0,width:q.width,height:q.height};if(m.wrapCss){h.extend(v,m.wrapCss)}if(s.parent()[0]!==w.wrapper[0]){s.before(w.wrapper)}p.css(v);h(w.images.slice(2)).hide();for(t=1;t<w.images.length;t++){p.append(w.images[t])}p.append(r).append(n).append(s.css(d.canvas_style));k.setOpacity(w.images[0],0);h(w.images[1]).show();k.setOpacity(w.images[1],1);if(m.isSelectable&&m.onGetList){x=w.data.slice(0);if(m.sortList){if(m.sortList==="desc"){o=function(B,A){return B===A?0:(B>A?-1:1)}}else{o=function(B,A){return B===A?0:(B<A?-1:1)}}x.sort(function(B,A){B=B.value;A=A.value;return o(B,A)})}w.options.boundList=m.onGetList.call(w.image,x)}w.complete=true;w.processCommandQueue();if(m.onConfigured&&typeof m.onConfigured==="function"){m.onConfigured.call(s,true)}},buildDataset:function(o){var y,n,z,x,m,C,u,r,E,t,w,p,q,B,D=this,s=D.options,v;function A(G,H){var F=new d.AreaData(D,G,H);F.areaId=D._xref[G]=D.data.push(F)-1;return F.areaId}D._xref={};D.data=[];if(!o){D.mapAreas=[]}v=!s.mapKey;if(v){s.mapKey="data-mapster-key"}y=d.hasVml()?"area":(v?"area[coords]":"area["+s.mapKey+"]");n=h(D.map).find(y).unbind(".mapster");for(w=0;w<n.length;w++){x=0;C=n[w];m=h(C);if(!C.coords){continue}if(v){u=String(w);m.attr("data-mapster-key",u)}else{u=C.getAttribute(s.mapKey)}if(o){r=D.mapAreas[m.data("mapster")-1];r.configure(u)}else{r=new d.MapArea(D,C,u);D.mapAreas.push(r)}t=r.keys;for(z=t.length-1;z>=0;z--){E=t[z];if(s.mapValue){p=m.attr(s.mapValue)}if(v){x=A(D.data.length,p);q=D.data[x];q.key=E=x.toString()}else{x=D._xref[E];if(x>=0){q=D.data[x];if(p&&!D.data[x].value){q.value=p}}else{x=A(E,p);q=D.data[x];q.isPrimary=z===0}}r.areaDataXref.push(x);q.areasXref.push(w)}B=m.attr("href");if(B&&B!=="#"&&!q.href){q.href=B}if(!r.nohref){m.bind("click.mapster",D.click);if(!d.isTouch){m.bind("mouseover.mapster",D.mouseover).bind("mouseout.mapster",D.mouseout).bind("mousedown.mapster",D.mousedown)}}m.data("mapster",w+1)}D.setAreaOptions(s.areas);D.redrawSelections()},processCommandQueue:function(){var n,m=this;while(!m.currentAction&&m.commands.length){n=m.commands[0];m.commands.splice(0,1);d.impl[n.command].apply(n.that,n.args)}},clearEvents:function(){h(this.map).find("area").unbind(".mapster");h(this.images).unbind(".mapster")},_clearCanvases:function(m){if(!m){h(this.base_canvas).remove()}h(this.overlay_canvas).remove()},clearMapData:function(n){var m=this;this._clearCanvases(n);h.each(this.data,function(o,p){p.reset()});this.data=null;if(!n){this.image.style.cssText=this.imgCssText;h(this.wrapper).before(this.image).remove()}m.images.clear();this.image=null;k.ifFunction(this.clearTooltip,this)},removeSelectionFinish:function(){var m=this.graphics;m.refreshSelections();m.clearHighlight()}}}(jQuery));(function(f){var c=f.mapster,d=c.utils;function b(g){var h=this,i=h.owner;if(i.options.singleSelect){i.clearSelections()}if(!h.isSelected()){if(g){h.optsCache=f.extend(h.effectiveRenderOptions("select"),g,{altImageId:i.images.add(g.altImage)})}h.drawSelection();h.selected=true;h.changeState("select",true)}if(i.options.singleSelect){i.graphics.refreshSelections()}}function e(g){var h=this;h.selected=false;h.changeState("select",false);h.optsCache=null;h.owner.graphics.removeSelections(h.areaId);if(!g){h.owner.removeSelectionFinish()}}function a(g){var h=this;if(!h.isSelected()){h.select(g)}else{h.deselect()}return h.isSelected()}c.AreaData=function(g,h,i){f.extend(this,{owner:g,key:h||"",isPrimary:true,areaId:-1,href:"",value:i||"",options:{},selected:null,areasXref:[],area:null,optsCache:null})};c.AreaData.prototype={constuctor:c.AreaData,select:b,deselect:e,toggle:a,areas:function(){var h,g=[];for(h=0;h<this.areasXref.length;h++){g.push(this.owner.mapAreas[this.areasXref[h]])}return g},coords:function(h){var g=[];f.each(this.areas(),function(j,k){g=g.concat(k.coords(h))});return g},reset:function(){f.each(this.areas(),function(g,h){h.reset()});this.areasXref=[];this.options=null},isSelectedOrStatic:function(){var g=this.effectiveOptions();return d.isBool(g.staticState)?g.staticState:this.isSelected()},isSelected:function(){return d.isBool(this.selected)?this.selected:d.isBool(this.owner.area_options.selected)?this.owner.area_options.selected:false},isSelectable:function(){return d.isBool(this.effectiveOptions().staticState)?false:(d.isBool(this.owner.options.staticState)?false:d.boolOrDefault(this.effectiveOptions().isSelectable,true))},isDeselectable:function(){return d.isBool(this.effectiveOptions().staticState)?false:(d.isBool(this.owner.options.staticState)?false:d.boolOrDefault(this.effectiveOptions().isDeselectable,true))},isNotRendered:function(){var g=f(this.area);return g.attr("nohref")||!g.attr("href")||this.effectiveOptions().isMask},effectiveOptions:function(g){var h=d.updateProps({},this.owner.area_options,this.options,g||{},{id:this.areaId});h.selected=this.isSelected();return h},effectiveRenderOptions:function(j,g){var h,i=this.optsCache;if(!i||j==="highlight"){h=this.effectiveOptions(g);i=d.updateProps({},h,h["render_"+j]);if(j!=="highlight"){this.optsCache=i}}return f.extend({},i)},changeState:function(g,h){if(f.isFunction(this.owner.options.onStateChange)){this.owner.options.onStateChange.call(this.owner.image,{key:this.key,state:g,selected:h})}},highlight:function(g){var h=this.owner;if(this.effectiveOptions().highlight){h.graphics.addShapeGroup(this,"highlight",g)}h.setHighlightId(this.areaId);this.changeState("highlight",true)},drawSelection:function(){this.owner.graphics.addShapeGroup(this,"select")}};c.MapArea=function(g,h,j){if(!g){return}var i=this;i.owner=g;i.area=h;i.areaDataXref=[];i.originalCoords=[];f.each(d.split(h.coords),function(k,l){i.originalCoords.push(parseFloat(l))});i.length=i.originalCoords.length;i.shape=h.shape.toLowerCase();i.nohref=h.nohref||!h.href;i.configure(j)};c.MapArea.prototype={constructor:c.MapArea,configure:function(g){this.keys=d.split(g)},reset:function(){this.area=null},coords:function(g){return f.map(this.originalCoords,function(h){return g?h:h+g})}}}(jQuery));(function(b){var a=b.mapster.utils;a.areaCorners=function(p,r,o,s,q){var i,n,D,B,C,A,y,w,v,t,l,k,E,u,e=0,d=0,h,f,m,g,z,c,x=[];p=p.length?p:[p];o=o?b(o):b(document.body);i=o.offset();h=i.left;f=i.top;if(r){i=b(r).offset();e=i.left;d=i.top}for(u=0;u<p.length;u++){c=p[u];if(c.nodeName==="AREA"){m=a.split(c.coords,parseInt);switch(c.shape){case"circle":l=m[0];k=m[1];g=m[2];x=[];for(u=0;u<360;u+=20){z=u*Math.PI/180;x.push(l+g*Math.cos(z),k+g*Math.sin(z))}break;case"rect":x.push(m[0],m[1],m[2],m[1],m[2],m[3],m[0],m[3]);break;default:x=x.concat(m);break}for(u=0;u<x.length;u+=2){x[u]=parseInt(x[u],10)+e;x[u+1]=parseInt(x[u+1],10)+d}}else{c=b(c);i=c.position();x.push(i.left,i.top,i.left+c.width(),i.top,i.left+c.width(),i.top+c.height(),i.left,i.top+c.height())}}D=B=y=v=999999;C=A=w=t=-1;for(u=x.length-2;u>=0;u-=2){l=x[u];k=x[u+1];if(l<D){D=l;t=k}if(l>C){C=l;v=k}if(k<B){B=k;w=l}if(k>A){A=k;y=l}}if(s&&q){n=false;b.each([[w-s,B-q],[y,B-q],[D-s,t-q],[D-s,v],[C,t-q],[C,v],[w-s,A],[y,A]],function(j,F){if(!n&&(F[0]>h&&F[1]>f)){E=F;n=true;return false}});if(!n){E=[C,A]}}return E}}(jQuery));(function(c){var a=c.mapster,b=a.utils,d=a.MapArea.prototype;a.utils.getScaleInfo=function(e,g){var f;if(!g){f=1;g=e}else{f=e.width/g.width||e.height/g.height;if(f>0.98&&f<1.02){f=1}}return{scale:(f!==1),scalePct:f,realWidth:g.width,realHeight:g.height,width:e.width,height:e.height,ratio:e.width/e.height}};a.utils.scaleMap=function(h,f,i){var g=b.size(h),e=b.size(f,true);if(!e.complete()){throw ("Another script, such as an extension, appears to be interfering with image loading. Please let us know about this.")}if(!g.complete()){g=e}return this.getScaleInfo(g,i?e:null)};a.MapData.prototype.resize=function(g,t,j,s){var f,r,i,k,e,n,o=this;s=s||j;function q(u,p,v){if(a.hasCanvas()){u.width=p;u.height=v}else{c(u).width(p);c(u).height(v)}}function l(){o.currentAction="";if(c.isFunction(s)){s()}o.processCommandQueue()}function m(){q(o.overlay_canvas,g,t);if(e>=0){var p=o.data[e];p.tempOptions={fade:false};o.getDataForKey(p.key).highlight();p.tempOptions=null}q(o.base_canvas,g,t);o.redrawSelections();l()}function h(){c(o.image).css(i);o.scaleInfo=b.getScaleInfo({width:g,height:t},{width:o.scaleInfo.realWidth,height:o.scaleInfo.realHeight});c.each(o.data,function(p,u){c.each(u.areas(),function(v,w){w.resize()})})}if(o.scaleInfo.width===g&&o.scaleInfo.height===t){return}e=o.highlightId;if(!g){n=t/o.scaleInfo.realHeight;g=Math.round(o.scaleInfo.realWidth*n)}if(!t){n=g/o.scaleInfo.realWidth;t=Math.round(o.scaleInfo.realHeight*n)}i={width:String(g)+"px",height:String(t)+"px"};if(!a.hasCanvas()){c(o.base_canvas).children().remove()}k=c(o.wrapper).find(".mapster_el").add(o.wrapper);if(j){r=[];o.currentAction="resizing";k.each(function(p,u){f=b.defer();r.push(f);c(u).animate(i,{duration:j,complete:f.resolve,easing:"linear"})});f=b.defer();r.push(f);b.when.all(r).then(m);h();f.resolve()}else{k.css(i);h();m()}};a.MapArea=b.subclass(a.MapArea,function(){this.base.init();if(this.owner.scaleInfo.scale){this.resize()}});d.coords=function(f,i){var e,h=[],g=f||this.owner.scaleInfo.scalePct,k=i||0;if(g===1&&i===0){return this.originalCoords}for(e=0;e<this.length;e++){h.push(Math.round(this.originalCoords[e]*g)+k)}return h};d.resize=function(){this.area.coords=this.coords().join(",")};d.reset=function(){this.area.coords=this.coords(1).join(",")};a.impl.resize=function(g,f,h,i){if(!g&&!f){return false}var e=(new a.Method(this,function(){this.resize(g,f,h,i)},null,{name:"resize",args:arguments})).go();return e}}(jQuery));(function(g){var a=g.mapster,d=a.utils;g.extend(a.defaults,{toolTipContainer:'<div style="border: 2px solid black; background: #EEEEEE; width:160px; padding:4px; margin: 4px; -moz-box-shadow: 3px 3px 5px #535353; -webkit-box-shadow: 3px 3px 5px #535353; box-shadow: 3px 3px 5px #535353; -moz-border-radius: 6px 6px 6px 6px; -webkit-border-radius: 6px; border-radius: 6px 6px 6px 6px; opacity: 0.9;"></dteniv>',showToolTip:false,toolTipFade:true,toolTipClose:["area-mouseout","image-mouseout"],onShowToolTip:null,onHideToolTip:null});g.extend(a.area_defaults,{toolTip:null,toolTipClose:null});function e(j,k,i){var l;if(k){l=typeof k==="string"?g(k):g(k).clone();l.append(j)}else{l=g(j)}l.css(g.extend((i||{}),{display:"block",position:"absolute"})).hide();g("body").append(l);l.attr("data-opacity",l.css("opacity")).css("opacity",0);return l.show()}function h(m,k){var i={left:k.left+"px",top:k.top+"px"},j=m.attr("data-opacity")||0,l=m.css("z-index");if(parseInt(l,10)===0||l==="auto"){i["z-index"]=9999}m.css(i).addClass("mapster_tooltip");if(k.fadeDuration&&k.fadeDuration>0){d.fader(m[0],0,j,k.fadeDuration)}else{d.setOpacity(m[0],j)}}a.MapData.prototype.clearToolTip=function(){if(this.activeToolTip){this.activeToolTip.stop().remove();this.activeToolTip=null;this.activeToolTipID=null;d.ifFunction(this.options.onHideToolTip,this)}};function b(k,i,l,o,m,j){var n=l+".mapster-tooltip";if(g.inArray(i,k)>=0){o.unbind(n).bind(n,function(p){if(!m||m.call(this,p)){o.unbind(".mapster-tooltip");if(j){j.call(this)}}});return{object:o,event:n}}}function f(m,o,n,i,k){var j,l={};k=k||{};if(o){j=d.areaCorners(o,n,i,m.outerWidth(true),m.outerHeight(true));l.left=j[0];l.top=j[1]}else{l.left=k.left;l.top=k.top}l.left+=(k.offsetx||0);l.top+=(k.offsety||0);l.css=k.css;l.fadeDuration=k.fadeDuration;h(m,l);return m}a.AreaData.prototype.showToolTip=function(m,s){var r,j,l,n,p,k={},q=this,o=q.owner,i=q.effectiveOptions();s=s?g.extend({},s):{};m=m||i.toolTip;j=s.closeEvents||i.toolTipClose||o.options.toolTipClose||"tooltip-click";p=typeof s.template!=="undefined"?s.template:o.options.toolTipContainer;s.closeEvents=typeof j==="string"?j=d.split(j):j;s.fadeDuration=s.fadeDuration||(o.options.toolTipFade?(o.options.fadeDuration||i.fadeDuration):0);l=q.area?q.area:g.map(q.areas(),function(t){return t.area});if(o.activeToolTipID===q.areaId){return}o.clearToolTip();o.activeToolTip=r=e(m,p,s.css);o.activeToolTipID=q.areaId;n=function(){o.clearToolTip()};b(j,"area-click","click",g(o.map),null,n);b(j,"tooltip-click","click",r,null,n);b(j,"image-mouseout","mouseout",g(o.image),function(t){return(t.relatedTarget&&t.relatedTarget.nodeName!=="AREA"&&t.relatedTarget!==q.area)},n);f(r,l,o.image,s.container,p,s);d.ifFunction(o.options.onShowToolTip,q.area,{toolTip:r,options:k,areaOptions:i,key:q.key,selected:q.isSelected()});return r};function c(i){return(i?((typeof i==="string"||i.jquery)?i:i.content):null)}a.impl.tooltip=function(k,j){return(new a.Method(this,function l(){var n,o,m=this;if(!k){m.clearToolTip()}else{o=g(k);if(m.activeToolTipID===o[0]){return}m.clearToolTip();m.activeToolTip=n=e(c(j),j.template||m.options.toolTipContainer,j.css);m.activeToolTipID=o[0];b(["tooltip-click"],"tooltip-click","click",n,null,function(){m.clearToolTip()});m.activeToolTip=n=f(n,o,m.image,j.container,j)}},function i(){if(g.isPlainObject(k)&&!j){j=k}this.showToolTip(c(j),j)},{name:"tooltip",args:arguments,key:k})).go()}}(jQuery));
\ No newline at end of file
+!function(e){e(function(){function e(){}function t(t){var n=new e;return n.then=function(e){var n;try{return e&&(n=e(t)),r(n===g?t:n)}catch(e){return a(e)}},f(n)}function a(t){var n=new e;return n.then=function(e,n){var i;try{return n?(i=n(t),r(i===g?t:i)):a(t)}catch(e){return a(e)}},f(n)}function n(){var i,o,r,s,c,l,u;return r=[],s=[],c=function(e,t,a){var i=n();return r.push(function(a){a.then(e,t).then(i.resolve,i.reject,i.progress)}),a&&s.push(a),i.promise},l=function(e){for(var t,a=0;t=s[a++];)t(e)},u=function(e){var t,a=0;for(c=e.then,u=l=function(){throw new Error("already completed")},s=g;t=r[a++];)t(e);r=[]},i={},o=new e,o.then=i.then=function(e,t,a){return c(e,t,a)},i.promise=f(o),i.resolver=f({resolve:i.resolve=function(e){u(t(e))},reject:i.reject=function(e){u(a(e))},progress:i.progress=function(e){l(e)}}),i}function i(e){return e&&"function"==typeof e.then}function o(e,t,a,n){return r(e).then(t,a,n)}function r(t){var a,o;return t instanceof e?a=t:(o=n(),i(t)?(t.then(o.resolve,o.reject,o.progress),a=o.promise):(o.resolve(t),a=o.promise)),a}function s(e,t,a,i,r){return h(2,arguments),o(e,function(e){function s(){f=d=m=p}var c,l,u,h,f,d,m,g,v;if(g=e.length>>>0,c=Math.max(0,Math.min(t,g)),l=[],h=n(),u=o(h,a,i,r),c)for(f=function(e){l.push(e),--c||(s(),h.resolve(l))},d=function(e){s(),h.reject(e)},m=h.progress,v=0;v<g;++v)v in e&&o(e[v],function(e){f(e)},function(e){d(e)},function(e){m(e)});else h.resolve(l);return u})}function c(e,t,a){return e[a]=t,e}function l(e,t){var a,n,i;for(n=e.length>>>0,a=new Array(n),i=0;i<n;i++)i in e&&(a[i]=o(e[i],t));return u(a,c,a)}function u(e,t,a){var n,i;return n=e.length,i=[function(e,a,i){return o(e,function(e){return o(a,function(a){return t(e,a,i,n)})})}],arguments.length>2&&i.push(a),d.apply(e,i)}function h(e,t){for(var a,n=t.length;n>e;)if(null!=(a=t[--n])&&"function"!=typeof a)throw new Error("callback is not a function")}function p(){}var f,d,m,g;return o.defer=n,o.reject=function(e){return o(e,function(e){return a(e)})},o.isPromise=i,o.all=function(e,t,a,n){return h(1,arguments),o(e,function(e){return u(e,c,[])}).then(t,a,n)},o.some=s,o.any=function(e,t,a,n){return s(e,1,function(e){return t?t(e[0]):e[0]},a,n)},o.map=function(e,t){return o(e,function(e){return l(e,t)})},o.reduce=function(e,t,a){var n=m.call(arguments,1);return o(e,function(e){return u.apply(g,[e].concat(n))})},o.chain=function(e,t,n){var i=arguments.length>2;return o(e,function(e){return i&&(e=n),t.resolve(e),e},function(e){return t.reject(e),a(e)},t.progress)},f=Object.freeze||function(e){return e},e.prototype=f({always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(g,e)}}),m=[].slice,d=[].reduce||function(e){var t,a,n,i,o;if(o=0,t=Object(this),i=t.length>>>0,(a=arguments).length<=1)for(;;){if(o in t){n=t[o++];break}if(++o>=i)throw new TypeError}else n=a[1];for(;o<i;++o)o in t&&(n=e(n,t[o],o,t));return n},o})}("function"==typeof define?define:function(e){"undefined"!=typeof module?module.exports=e():jQuery.mapster_when=e()}),function($){$.fn.mapster=function(e){var t=$.mapster.impl;return $.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:"1.2.10",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,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,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,isTouch:null,map_cache:[],hooks:{},addHook:function(e,t){this.hooks[e]=(this.hooks[e]||[]).push(t)},callHooks:function(e,t){$.each(this.hooks[e]||[],function(e,a){a.apply(t)})},utils:{when:$.mapster_when,defer:$.mapster_when.defer,subclass:function(e,t){var a=function(){var a=this,n=Array.prototype.slice.call(arguments,0);a.base=e.prototype,a.base.init=function(){e.prototype.constructor.apply(a,n)},t.apply(a,n)};return a.prototype=new e,a.prototype.constructor=a,a},asArray:function(e){return e.constructor===Array?e:this.split(e)},split:function(e,t){var a,n,i=e.split(",");for(a=0;a<i.length;a++)""===(n=$.trim(i[a]))?i.splice(a,1):i[a]=t?t(n):n;return i},updateProps:function(e,t){var a,n=e||{},i=$.isEmptyObject(n)?t:e;return a=[],$.each(i,function(e){a.push(e)}),$.each(Array.prototype.slice.call(arguments,1),function(e,t){$.each(t||{},function(e){if(!a||$.inArray(e,a)>=0){var i=t[e];$.isPlainObject(i)?n[e]=$.extend(n[e]||{},i):i&&i.constructor===Array?n[e]=i.slice(0):void 0!==i&&(n[e]=t[e])}})}),n},isElement:function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName},indexOfProp:function(e,t,a){var n=e.constructor===Array?-1:null;return $.each(e,function(e,i){if(i&&(t?i[t]:i)===a)return n=e,!1}),n},boolOrDefault:function(e,t){return this.isBool(e)?e:t||!1},isBool:function(e){return"boolean"==typeof e},isUndef:function(e){return void 0===e},ifFunction:function(e,t,a){$.isFunction(e)&&e.call(t,a)},size:function(e,t){var a=$.mapster.utils;return{width:t?e.width||e.naturalWidth:a.imgWidth(e,!0),height:t?e.height||e.naturalHeight:a.imgHeight(e,!0),complete:function(){return!!this.height&&!!this.width}}},setOpacity:function(e,t){$.mapster.hasCanvas()?e.style.opacity=t:$(e).each(function(e,a){void 0!==a.opacity?a.opacity=t:$(a).css("opacity",t)})},fader:function(){var e={},t=0,a=function(n,i,o,r){var s,c,l=r/15,u=$.mapster.utils;if("number"==typeof n){if(!(c=e[n]))return}else(s=u.indexOfProp(e,null,n))&&delete e[s],e[++t]=c=n,n=t;i=i+(o=o||1)/l>o-.01?o:i+o/l,u.setOpacity(c,i),i<o&&setTimeout(function(){a(n,i,o,r)},15)};return a}()},getBoundList:function(e,t){if(!e.boundList)return null;var a,n,i=$(),o=$.mapster.utils.split(t);return e.boundList.each(function(t,r){for(a=0;a<o.length;a++)n=o[a],$(r).is("["+e.listKey+'="'+n+'"]')&&(i=i.add(r))}),i},setBoundListProperties:function(e,t,a){t.each(function(t,n){e.listSelectedClass&&(a?$(n).addClass(e.listSelectedClass):$(n).removeClass(e.listSelectedClass)),e.listSelectedAttribute&&$(n).attr(e.listSelectedAttribute,a)})},getMapDataIndex:function(e){var t,a;switch(e.tagName&&e.tagName.toLowerCase()){case"area":a=$(e).parent().attr("name"),t=$("img[usemap='#"+a+"']")[0];break;case"img":t=e}return t?this.utils.indexOfProp(this.map_cache,"image",t):-1},getMapData:function(e){var t=this.getMapDataIndex(e.length?e[0]:e);if(t>=0)return t>=0?this.map_cache[t]:null},queueCommand:function(e,t,a,n){return!!e&&(!(e.complete&&!e.currentAction)&&(e.commands.push({that:t,command:a,args:n}),!0))},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 a=t.substr(0,1).toUpperCase()+t.substr(1);u["img"+a]=function(e,n){return(n?$(e)[t]():0)||e[t]||e["natural"+a]||e["client"+a]||e["offset"+a]}}),m.Method=function(e,t,a,n){var i=this;i.name=n.name,i.output=e,i.input=e,i.first=n.first||!1,i.args=n.args?ap.slice.call(n.args,0):[],i.key=n.key,i.func_map=t,i.func_area=a,i.name=n.name,i.allowAsync=n.allowAsync||!1},m.Method.prototype={constructor:m.Method,go:function(){var e,t,a,n,i,o=this.input,r=[],s=this;for(n=o.length,e=0;e<n;e++)if(t=$.mapster.getMapData(o[e])){if(!s.allowAsync&&m.queueCommand(t,s.input,s.name,s.args)){this.first&&(i="");continue}if((a=t.getData("AREA"===o[e].nodeName?o[e]:this.key))?$.inArray(a,r)<0&&r.push(a):i=this.func_map.apply(t,s.args),this.first||void 0!==i)break}return $(r).each(function(e,t){i=s.func_area.apply(t,s.args)}),void 0!==i?i:this.output}},$.mapster.impl=function(){function hasVml(){var e=$("<div />").appendTo("body");e.html('<v:shape id="vml_flag1" adj="1" />');var t=e[0].firstChild;t.style.behavior="url(#default#VML)";var a=!t||"object"==typeof t.adj;return e.remove(),a}function namespaces(){return"object"==typeof document.namespaces?document.namespaces:null}function hasCanvas(){var e=namespaces();return(!e||!e.g_vml_)&&!!$("<canvas />")[0].getContext}function merge_areas(e,t){var a,n,i=e.options.areas;t&&$.each(t,function(t,o){o&&o.key&&((n=u.indexOfProp(i,"key",o.key))>=0?$.extend(i[n],o):i.push(o),(a=e.getDataForKey(o.key))&&$.extend(a.options,o))})}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)}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(!1!==e){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 a(e){var a,i=[];t?(a=e.areas(),$.each(a,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=[],i=m.getMapData(this);if(!i||!i.complete)throw"Can't access data until binding complete.";return i&&i.complete?("string"==typeof e?t?a(i.getDataForKey(e)):n=[i.getKeysForGroup(e)]:(t=e,this.each(function(e,t){"AREA"===t.nodeName&&a(i.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,a){function n(t){if(t)switch(e){case!0:t.select(h);break;case!1:t.deselect(!0);break;default:t.toggle(h)}}function i(e){e&&$.inArray(e,l)<0&&(l.push(e),c+=(""===c?"":",")+e.key)}function o(t){$.each(l,function(e,t){n(t)}),e||t.removeSelectionFinish(),t.options.boundList&&m.setBoundListProperties(t.options,m.getBoundList(t.options,c),e)}var r,s,c,l,h=a;return this.filter("img,area").each(function(a,n){var p;(s=m.getMapData(n))!==r&&(r&&o(r),l=[],c=""),s&&(p="","IMG"===n.nodeName.toUpperCase()?m.queueCommand(s,$(n),"set",[e,t,h])||(t instanceof Array?t.length&&(p=t.join(",")):p=t,p&&$.each(u.split(p),function(e,t){i(s.getDataForKey(t.toString())),r=s})):(h=t,m.queueCommand(s,$(n),"set",[e,h])||(i(s.getDataForArea(n)),r=s)))}),s&&o(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(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 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(){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(a,n){if("IMG"===n.nodeName)return(e=m.getMapData(n))&&(t=e.state()),!1}),t},me.bind=function(e){return this.each(function(t,a){var n,i,o,r;if(n=$(a),r=m.getMapData(a)){if(me.unbind.apply(n),!r.complete)return n.bind(),!0;r=null}if(o=this.getAttribute("usemap"),i=o&&$('map[name="'+o.substr(1)+'"]'),!(n.is("img")&&o&&i.size()>0))return!0;n.css("border",0),r||((r=new m.MapData(this,e)).index=addMap(r),r.map=i,r.bindImages().then(function(){r.initialize()}))})},me.init=function(e){var t,a;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(),a=["shape","rect","oval","circ","fill","stroke","imagedata","group","textbox"],$.each(a,function(e,a){t.addRule("v\\:"+a,"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 t(t,a,n){var i=t,o=i.map_data,r=n.isMask;e.each(a.areas(),function(e,t){n.isMask=r||t.nohref&&o.options.noHrefIsMask,i.addShape(t,n)}),n.isMask=r}function a(e){return Math.max(0,Math.min(parseInt(e,16),255))}function n(e,t){return"rgba("+a(e.substr(0,2))+","+a(e.substr(2,2))+","+a(e.substr(4,2))+","+t+")"}function i(){}var o,r,s,c=e.mapster,l=c.utils;c.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},o=c.Graphics.prototype={constructor:c.Graphics,begin:function(t,a){var n=e(t);this.elementName=a,this.canvas=t,this.width=n.width(),this.height=n.height(),this.shapes=[],this.masks=[],this.active=!0},addShape:function(e,t){(t.isMask?this.masks:this.shapes).push({mapArea:e,options:t})},createVisibleCanvas:function(t){return e(this.createCanvasFor(t)).addClass("mapster_el").css(c.canvas_style)[0]},addShapeGroup:function(a,n,i){var o,r,s,u=this,h=this.map_data,p=a.effectiveRenderOptions(n);i&&e.extend(p,i),"select"===n?(r="static_"+a.areaId.toString(),s=h.base_canvas):s=h.overlay_canvas,u.begin(s,r),p.includeKeys&&(o=l.split(p.includeKeys),e.each(o,function(e,a){var i=h.getDataForKey(a.toString());t(u,i,i.effectiveRenderOptions(n))})),t(u,a,p),u.render(),p.fade&&l.fader(c.hasCanvas()?s:e(s).find("._fill").not(".mapster_mask"),0,c.hasCanvas()?1:p.fillOpacity,p.fadeDuration)}},r={renderShape:function(e,t,a){var n,i=t.coords(null,a);switch(t.shape){case"rect":e.rect(i[0],i[1],i[2]-i[0],i[3]-i[1]);break;case"poly":for(e.moveTo(i[0],i[1]),n=2;n<t.length;n+=2)e.lineTo(i[n],i[n+1]);e.lineTo(i[0],i[1]);break;case"circ":case"circle":e.arc(i[0],i[1],i[2],0,2*Math.PI,!1)}},addAltImage:function(e,t,a,n){e.beginPath(),this.renderShape(e,a),e.closePath(),e.clip(),e.globalAlpha=n.altImageOpacity||n.fillOpacity,e.drawImage(t,0,0,a.owner.scaleInfo.width,a.owner.scaleInfo.height)},render:function(){var t,a,i=this,o=i.map_data,r=i.masks.length,s=i.createCanvasFor(o),c=s.getContext("2d"),l=i.canvas.getContext("2d");return r&&(t=i.createCanvasFor(o),(a=t.getContext("2d")).clearRect(0,0,t.width,t.height),e.each(i.masks,function(e,t){a.save(),a.beginPath(),i.renderShape(a,t.mapArea),a.closePath(),a.clip(),a.lineWidth=0,a.fillStyle="#000",a.fill(),a.restore()})),e.each(i.shapes,function(e,t){c.save(),t.options.fill&&(t.options.altImageId?i.addAltImage(c,o.images[t.options.altImageId],t.mapArea,t.options):(c.beginPath(),i.renderShape(c,t.mapArea),c.closePath(),c.fillStyle=n(t.options.fillColor,t.options.fillOpacity),c.fill())),c.restore()}),e.each(i.shapes.concat(i.masks),function(e,t){var a=1===t.options.strokeWidth?.5:0;t.options.stroke&&(c.save(),c.strokeStyle=n(t.options.strokeColor,t.options.strokeOpacity),c.lineWidth=t.options.strokeWidth,c.beginPath(),i.renderShape(c,t.mapArea,a),c.closePath(),c.stroke(),c.restore())}),r?(a.globalCompositeOperation="source-out",a.drawImage(s,0,0),l.drawImage(t,0,0)):l.drawImage(s,0,0),i.active=!1,i.canvas},createCanvasFor:function(t){return e('<canvas width="'+t.scaleInfo.width+'" height="'+t.scaleInfo.height+'"></canvas>')[0]},clearHighlight:function(){var e=this.map_data.overlay_canvas;e.getContext("2d").clearRect(0,0,e.width,e.height)},refreshSelections:function(){var t,a=this.map_data;t=a.base_canvas,a.base_canvas=this.createVisibleCanvas(a),e(a.base_canvas).hide(),e(t).before(a.base_canvas),a.redrawSelections(),e(a.base_canvas).show(),e(t).remove()}},s={renderShape:function(t,a,n){var i,o,r,s,c,l,u,h=this,p=t.coords();switch(c=h.elementName?'name="'+h.elementName+'" ':"",l=n?'class="'+n+'" ':"",s='<v:fill color="#'+a.fillColor+'" class="_fill" opacity="'+(a.fill?a.fillOpacity:0)+'" /><v:stroke class="_fill" opacity="'+a.strokeOpacity+'"/>',o=a.stroke?" strokeweight="+a.strokeWidth+' stroked="t" strokecolor="#'+a.strokeColor+'"':' stroked="f"',i=a.fill?' filled="t"':' filled="f"',t.shape){case"rect":u="<v:rect "+l+c+i+o+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+p[0]+"px;top:"+p[1]+"px;width:"+(p[2]-p[0])+"px;height:"+(p[3]-p[1])+'px;">'+s+"</v:rect>";break;case"poly":u="<v:shape "+l+c+i+o+' coordorigin="0,0" coordsize="'+h.width+","+h.height+'" path="m '+p[0]+","+p[1]+" l "+p.slice(2).join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+h.width+"px;height:"+h.height+'px;">'+s+"</v:shape>";break;case"circ":case"circle":u="<v:oval "+l+c+i+o+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(p[0]-p[2])+"px;top:"+(p[1]-p[2])+"px;width:"+2*p[2]+"px;height:"+2*p[2]+'px;">'+s+"</v:oval>"}return r=e(u),e(h.canvas).append(r),r},render:function(){var t,a=this;return e.each(this.shapes,function(e,t){a.renderShape(t.mapArea,t.options)}),this.masks.length&&e.each(this.masks,function(e,n){t=l.updateProps({},n.options,{fillOpacity:1,fillColor:n.options.fillColorMask}),a.renderShape(n.mapArea,t,"mapster_mask")}),this.active=!1,this.canvas},createCanvasFor:function(t){var a=t.scaleInfo.width,n=t.scaleInfo.height;return e('<var width="'+a+'" height="'+n+'" style="zoom:1;overflow:hidden;display:block;width:'+a+"px;height:"+n+'px;"></var>')[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,t){o[t]=function(e){return function(){return o[e]=(c.hasCanvas()?r[e]:s[e])||i,o[e].apply(this,arguments)}}(t)})}(jQuery),function(e){var t=e.mapster,a=t.utils,n=[];t.MapImages=function(e){this.owner=e,this.clear()},t.MapImages.prototype={constructor:t.MapImages,slice:function(){return n.slice.apply(this,arguments)},splice:function(){return n.slice.apply(this.status,arguments),n.slice.apply(this,arguments)},complete:function(){return e.inArray(!1,this.status)<0},_add:function(e){var t=n.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,a){delete t[a]}),t.ids=[],t.length=0,t.status=[],t.splice(0)},add:function(t,a){var n,i,o=this;if(t){if("string"==typeof t){if(i=t,"object"==typeof(t=o[i]))return o.indexOf(t);t=e("<img />").addClass("mapster_el").hide(),n=o._add(t[0]),t.bind("load",function(e){o.imageLoaded.call(o,e)}).bind("error",function(e){o.imageLoadError.call(o,e)}),t.attr("src",i)}else n=o._add(e(t)[0]);if(a){if(this[a])throw a+" is already used or is not available as an altImage alias.";o.ids.push(a),o[a]=o[n]}return n}},bind:function(e){var t,n=this,i=n.owner.options.configTimeout/200,o=function(){var e;for(e=n.length;e-- >0&&n.isLoaded(e););n.complete()?n.resolve():i-- >0?n.imgTimeout=window.setTimeout(function(){o.call(n,!0)},50):n.imageLoadError.call(n)};return t=n.deferred=a.defer(),o(),t},resolve:function(){var e=this,t=e.deferred;t&&(e.deferred=null,t.resolve())},imageLoaded:function(t){var a=this,n=a.indexOf(t.target);n>=0&&(a.status[n]=!0,e.inArray(!1,a.status)<0&&a.resolve())},imageLoadError:function(e){throw clearTimeout(this.imgTimeout),this.triesLeft=0,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."},isLoaded:function(e){var t,n=this,i=n.status;return!!i[e]||(void 0!==(t=n[e]).complete?i[e]=t.complete:i[e]=!!a.imgWidth(t),i[e])}}}(jQuery),function(e){function t(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 a(e){return[e,e.render_highlight,e.render_select]}function n(t){var n=t.options,i=t.images;u.hasCanvas()&&(e.each(n.altImages||{},function(e,t){i.add(t,e)}),e.each([n].concat(n.areas),function(t,n){e.each(a(n),function(e,t){t&&t.altImage&&(t.altImageId=i.add(t.altImage))})})),t.area_options=h.updateProps({},u.area_defaults,n)}function i(e,t,a,n){if(n=n||h.when.defer(),e.activeAreaEvent&&(window.clearTimeout(e.activeAreaEvent),e.activeAreaEvent=0),!(t<0))return a.owner.currentAction||t?e.activeAreaEvent=window.setTimeout(function(){i(e,0,a,n)},t||100):function(t){e.currentAreaId!==t&&e.highlightId>=0&&n.resolve()}(a.areaId),n}function o(e){u.hasCanvas()||this.blur(),e.preventDefault()}function r(t,a){var n=t.getAllDataForArea(this),i=n.length?n[0]:null;!i||i.isNotRendered()||i.owner.currentAction||t.currentAreaId!==i.areaId&&(t.highlightId!==i.areaId&&(t.clearEffects(),i.highlight(),t.options.showToolTip&&e.each(n,function(e,t){t.effectiveOptions().toolTip&&t.showToolTip()})),t.currentAreaId=i.areaId,e.isFunction(t.options.onMouseover)&&t.options.onMouseover.call(this,{e:a,options:i.effectiveOptions(),key:i.key,selected:i.isSelected()}))}function s(t,a){var n=t.getDataForArea(this),o=t.options;t.currentAreaId<0||!n||t.getDataForArea(a.relatedTarget)!==n&&(t.currentAreaId=-1,n.area=null,i(t,o.mouseoutDelay,n).then(t.clearEffects),e.isFunction(o.onMouseout)&&o.onMouseout.call(this,{e:a,options:o,key:n.key,selected:n.isSelected()}))}function c(t){var a=t.options;t.ensureNoHighlight(),a.toolTipClose&&e.inArray("area-mouseout",a.toolTipClose)>=0&&t.activeToolTip&&t.clearToolTip()}function l(t,a){function n(o){var d,g;if(l=o.isSelectable()&&(o.isDeselectable()||!o.isSelected()),c=l?!o.isSelected():o.isSelected(),s=u.getBoundList(m,o.key),e.isFunction(m.onClick)&&(p=m.onClick.call(f,{e:a,listTarget:s,key:o.key,selected:c}),h.isBool(p))){if(!p)return!1;if("#"!==(g=e(o.area).attr("href")))return window.location.href=g,!1}l&&(i=o.toggle()),m.boundList&&m.boundList.length>0&&u.setBoundListProperties(m,s,o.isSelected()),(d=o.effectiveOptions()).includeKeys&&(r=h.split(d.includeKeys),e.each(r,function(e,a){var i=t.getDataForKey(a.toString());i.options.isMask||n(i)}))}var i,r,s,c,l,p,f=this,d=t.getDataForArea(this),m=t.options;o.call(this,a),m.clickNavigate&&d.href?window.location.href=d.href:d&&!d.owner.currentAction&&(m=t.options,n(d))}var u=e.mapster,h=u.utils;u.MapData=function(e,a){var n=this;n.image=e,n.images=new u.MapImages(n),n.graphics=new u.Graphics(n),n.imgCssText=e.style.cssText||null,t(n),n.configureOptions(a),n.mouseover=function(e){r.call(this,n,e)},n.mouseout=function(e){s.call(this,n,e)},n.click=function(e){l.call(this,n,e)},n.clearEffects=function(e){c.call(this,n,e)}},u.MapData.prototype={constructor:u.MapData,configureOptions:function(e){this.options=h.updateProps({},u.defaults,e)},bindImages:function(){var e=this,t=e.images;return t.length>2?t.splice(2):0===t.length&&(t.add(e.image),t.add(e.image.src)),n(e),e.images.bind()},isActive:function(){return!this.complete||this.currentAction},state:function(){return{complete:this.complete,resizing:"resizing"===this.currentAction,zoomed:this.zoomed,zoomedArea:this.zoomedArea,scaleInfo:this.scaleInfo}},wrapId:function(){return"mapster_wrap_"+this.index},_idFromKey:function(e){return"string"==typeof e&&this._xref.hasOwnProperty(e)?this._xref[e]:-1},getSelected:function(){var t="";return e.each(this.data,function(e,a){a.isSelected()&&(t+=(t?",":"")+this.key)}),t},getAllDataForArea:function(t,a){var n,i,o,r=this,s=e(t).filter("area").attr(r.options.mapKey);if(s)for(o=[],s=h.split(s),n=0;n<(a||s.length);n++)(i=r.data[r._idFromKey(s[n])]).area=t.length?t[0]:t,o.push(i);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 a=[];return e.each(t,function(t,n){e.inArray(n.keys[0],a)<0&&a.push(n.keys[0])}),a},getData:function(e){return"string"==typeof e?this.getDataForKey(e):e&&e.mapster||h.isElement(e)?this.getDataForArea(e):null},ensureNoHighlight:function(){this.highlightId>=0&&(this.graphics.clearHighlight(),this.data[this.highlightId].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,a,n;for(t=(e=e||[]).length-1;t>=0;t--)(a=e[t])&&(n=this.getDataForKey(a.key))&&(h.updateProps(n.options,a),h.isBool(a.selected)&&(n.selected=a.selected))},drawSelections:function(e){var t,a=h.asArray(e);for(t=a.length-1;t>=0;t--)this.data[a[t]].drawSelection()},redrawSelections:function(){e.each(this.data,function(e,t){t.isSelectedOrStatic()&&t.drawSelection()})},initialize:function(){var t,a,n,i,o,r,s,c,l,p,f,d,m=this,g=m.options;if(!m.complete){for((o=(l=e(m.image)).parent().attr("id"))&&o.length>=12&&"mapster_wrap"===o.substring(0,12)?(i=l.parent()).attr("id",m.wrapId()):(i=e('<div id="'+m.wrapId()+'"></div>'),g.wrapClass&&(!0===g.wrapClass?i.addClass(l[0].className):i.addClass(g.wrapClass))),m.wrapper=i,m.scaleInfo=d=h.scaleMap(m.images[0],m.images[1],g.scaleMap),m.base_canvas=a=m.graphics.createVisibleCanvas(m),m.overlay_canvas=n=m.graphics.createVisibleCanvas(m),t=e(m.images[1]).addClass("mapster_el "+m.images[0].className).attr({id:null,usemap:null}),(c=h.size(m.images[0])).complete&&t.css({width:c.width,height:c.height}),m.buildDataset(),r={display:"block",position:"relative",padding:0,width:d.width,height:d.height},g.wrapCss&&e.extend(r,g.wrapCss),l.parent()[0]!==m.wrapper[0]&&l.before(m.wrapper),i.css(r),e(m.images.slice(2)).hide(),s=1;s<m.images.length;s++)i.append(m.images[s]);i.append(a).append(n).append(l.css(u.canvas_style)),h.setOpacity(m.images[0],0),e(m.images[1]).show(),h.setOpacity(m.images[1],1),g.isSelectable&&g.onGetList&&(f=m.data.slice(0),g.sortList&&(p="desc"===g.sortList?function(e,t){return e===t?0:e>t?-1:1}:function(e,t){return e===t?0:e<t?-1:1},f.sort(function(e,t){return e=e.value,t=t.value,p(e,t)})),m.options.boundList=g.onGetList.call(m.image,f)),m.complete=!0,m.processCommandQueue(),g.onConfigured&&"function"==typeof g.onConfigured&&g.onConfigured.call(l,!0)}},buildDataset:function(t){function a(e,t){var a=new u.AreaData(w,e,t);return a.areaId=w._xref[e]=w.data.push(a)-1,a.areaId}var n,i,o,r,s,c,l,h,p,f,d,m,g,v,y,w=this,b=w.options;for(w._xref={},w.data=[],t||(w.mapAreas=[]),(y=!b.mapKey)&&(b.mapKey="data-mapster-key"),n=u.hasVml()?"area":y?"area[coords]":"area["+b.mapKey+"]",i=e(w.map).find(n).unbind(".mapster"),d=0;d<i.length;d++)if(r=0,c=i[d],s=e(c),c.coords){for(y?(l=String(d),s.attr("data-mapster-key",l)):l=c.getAttribute(b.mapKey),t?(h=w.mapAreas[s.data("mapster")-1]).configure(l):(h=new u.MapArea(w,c,l),w.mapAreas.push(h)),o=(f=h.keys).length-1;o>=0;o--)p=f[o],b.mapValue&&(m=s.attr(b.mapValue)),y?(r=a(w.data.length,m),(g=w.data[r]).key=p=r.toString()):(r=w._xref[p])>=0?(g=w.data[r],m&&!w.data[r].value&&(g.value=m)):(r=a(p,m),(g=w.data[r]).isPrimary=0===o),h.areaDataXref.push(r),g.areasXref.push(d);(v=s.attr("href"))&&"#"!==v&&!g.href&&(g.href=v),h.nohref||(s.bind("click.mapster",w.click),u.isTouch||s.bind("mouseover.mapster",w.mouseover).bind("mouseout.mapster",w.mouseout).bind("mousedown.mapster",w.mousedown)),s.data("mapster",d+1)}w.setAreaOptions(b.areas),w.redrawSelections()},processCommandQueue:function(){for(var e,t=this;!t.currentAction&&t.commands.length;)e=t.commands[0],t.commands.splice(0,1),u.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 a=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()),a.images.clear(),this.image=null,h.ifFunction(this.clearTooltip,this)},removeSelectionFinish:function(){var e=this.graphics;e.refreshSelections(),e.clearHighlight()}}}(jQuery),function(e){var t=e.mapster,a=t.utils;t.AreaData=function(t,a,n){e.extend(this,{owner:t,key:a||"",isPrimary:!0,areaId:-1,href:"",value:n||"",options:{},selected:null,areasXref:[],area:null,optsCache:null})},t.AreaData.prototype={constuctor:t.AreaData,select:function(t){var a=this,n=a.owner;n.options.singleSelect&&n.clearSelections(),a.isSelected()||(t&&(a.optsCache=e.extend(a.effectiveRenderOptions("select"),t,{altImageId:n.images.add(t.altImage)})),a.drawSelection(),a.selected=!0,a.changeState("select",!0)),n.options.singleSelect&&n.graphics.refreshSelections()},deselect:function(e){var t=this;t.selected=!1,t.changeState("select",!1),t.optsCache=null,t.owner.graphics.removeSelections(t.areaId),e||t.owner.removeSelectionFinish()},toggle:function(e){var t=this;return t.isSelected()?t.deselect():t.select(e),t.isSelected()},areas:function(){var e,t=[];for(e=0;e<this.areasXref.length;e++)t.push(this.owner.mapAreas[this.areasXref[e]]);return t},coords:function(t){var a=[];return e.each(this.areas(),function(e,n){a=a.concat(n.coords(t))}),a},reset:function(){e.each(this.areas(),function(e,t){t.reset()}),this.areasXref=[],this.options=null},isSelectedOrStatic:function(){var e=this.effectiveOptions();return a.isBool(e.staticState)?e.staticState:this.isSelected()},isSelected:function(){return a.isBool(this.selected)?this.selected:!!a.isBool(this.owner.area_options.selected)&&this.owner.area_options.selected},isSelectable:function(){return!a.isBool(this.effectiveOptions().staticState)&&(!a.isBool(this.owner.options.staticState)&&a.boolOrDefault(this.effectiveOptions().isSelectable,!0))},isDeselectable:function(){return!a.isBool(this.effectiveOptions().staticState)&&(!a.isBool(this.owner.options.staticState)&&a.boolOrDefault(this.effectiveOptions().isDeselectable,!0))},isNotRendered:function(){var t=e(this.area);return t.attr("nohref")||!t.attr("href")||this.effectiveOptions().isMask},effectiveOptions:function(e){var t=a.updateProps({},this.owner.area_options,this.options,e||{},{id:this.areaId});return t.selected=this.isSelected(),t},effectiveRenderOptions:function(t,n){var i,o=this.optsCache;return o&&"highlight"!==t||(i=this.effectiveOptions(n),o=a.updateProps({},i,i["render_"+t]),"highlight"!==t&&(this.optsCache=o)),e.extend({},o)},changeState:function(t,a){e.isFunction(this.owner.options.onStateChange)&&this.owner.options.onStateChange.call(this.owner.image,{key:this.key,state:t,selected:a})},highlight:function(e){var t=this.owner;this.effectiveOptions().highlight&&t.graphics.addShapeGroup(this,"highlight",e),t.setHighlightId(this.areaId),this.changeState("highlight",!0)},drawSelection:function(){this.owner.graphics.addShapeGroup(this,"select")}},t.MapArea=function(t,n,i){if(t){var o=this;o.owner=t,o.area=n,o.areaDataXref=[],o.originalCoords=[],e.each(a.split(n.coords),function(e,t){o.originalCoords.push(parseFloat(t))}),o.length=o.originalCoords.length,o.shape=n.shape.toLowerCase(),o.nohref=n.nohref||!n.href,o.configure(i)}},t.MapArea.prototype={constructor:t.MapArea,configure:function(e){this.keys=a.split(e)},reset:function(){this.area=null},coords:function(t){return e.map(this.originalCoords,function(e){return t?e:e+t})}}}(jQuery),function(e){var t=e.mapster.utils;t.areaCorners=function(a,n,i,o,r){var s,c,l,u,h,p,f,d,m,g,v,y,w,b,k,_,C,A,I,S,T=0,x=0,M=[];for(a=a.length?a:[a],s=(i=e(i?i:document.body)).offset(),k=s.left,_=s.top,n&&(T=(s=e(n).offset()).left,x=s.top),b=0;b<a.length;b++)if("AREA"===(S=a[b]).nodeName){switch(C=t.split(S.coords,parseInt),S.shape){case"circle":for(v=C[0],y=C[1],A=C[2],M=[],b=0;b<360;b+=20)I=b*Math.PI/180,M.push(v+A*Math.cos(I),y+A*Math.sin(I));break;case"rect":M.push(C[0],C[1],C[2],C[1],C[2],C[3],C[0],C[3]);break;default:M=M.concat(C)}for(b=0;b<M.length;b+=2)M[b]=parseInt(M[b],10)+T,M[b+1]=parseInt(M[b+1],10)+x}else s=(S=e(S)).position(),M.push(s.left,s.top,s.left+S.width(),s.top,s.left+S.width(),s.top+S.height(),s.left,s.top+S.height());for(l=u=f=m=999999,h=p=d=g=-1,b=M.length-2;b>=0;b-=2)v=M[b],y=M[b+1],v<l&&(l=v,g=y),v>h&&(h=v,m=y),y<u&&(u=y,d=v),y>p&&(p=y,f=v);return o&&r&&(c=!1,e.each([[d-o,u-r],[f,u-r],[l-o,g-r],[l-o,m],[h,g-r],[h,m],[d-o,p],[f,p]],function(e,t){if(!c&&t[0]>k&&t[1]>_)return w=t,c=!0,!1}),c||(w=[h,p])),w}}(jQuery),function(e){var t=e.mapster,a=t.utils,n=t.MapArea.prototype;t.utils.getScaleInfo=function(e,t){var a;return t?(a=e.width/t.width||e.height/t.height)>.98&&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}},t.utils.scaleMap=function(e,t,n){var i=a.size(e),o=a.size(t,!0);if(!o.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=o),this.getScaleInfo(i,n?o:null)},t.MapData.prototype.resize=function(n,i,o,r){function s(a,n,i){t.hasCanvas()?(a.width=n,a.height=i):(e(a).width(n),e(a).height(i))}function c(){v.currentAction="",e.isFunction(r)&&r(),v.processCommandQueue()}function l(){if(s(v.overlay_canvas,n,i),m>=0){var e=v.data[m];e.tempOptions={fade:!1},v.getDataForKey(e.key).highlight(),e.tempOptions=null}s(v.base_canvas,n,i),v.redrawSelections(),c()}function u(){e(v.image).css(f),v.scaleInfo=a.getScaleInfo({width:n,height:i},{width:v.scaleInfo.realWidth,height:v.scaleInfo.realHeight}),e.each(v.data,function(t,a){e.each(a.areas(),function(e,t){t.resize()})})}var h,p,f,d,m,g,v=this;r=r||o,v.scaleInfo.width===n&&v.scaleInfo.height===i||(m=v.highlightId,n||(g=i/v.scaleInfo.realHeight,n=Math.round(v.scaleInfo.realWidth*g)),i||(g=n/v.scaleInfo.realWidth,i=Math.round(v.scaleInfo.realHeight*g)),f={width:String(n)+"px",height:String(i)+"px"},t.hasCanvas()||e(v.base_canvas).children().remove(),d=e(v.wrapper).find(".mapster_el").add(v.wrapper),o?(p=[],v.currentAction="resizing",d.each(function(t,n){h=a.defer(),p.push(h),e(n).animate(f,{duration:o,complete:h.resolve,easing:"linear"})}),h=a.defer(),p.push(h),a.when.all(p).then(l),u(),h.resolve()):(d.css(f),u(),l()))},t.MapArea=a.subclass(t.MapArea,function(){this.base.init(),this.owner.scaleInfo.scale&&this.resize()}),n.coords=function(e,t){var a,n=[],i=e||this.owner.scaleInfo.scalePct,o=t||0;if(1===i&&0===t)return this.originalCoords;for(a=0;a<this.length;a++)n.push(Math.round(this.originalCoords[a]*i)+o);return n},n.resize=function(){this.area.coords=this.coords().join(",")},n.reset=function(){this.area.coords=this.coords(1).join(",")},t.impl.resize=function(e,a,n,i){return!(!e&&!a)&&new t.Method(this,function(){this.resize(e,a,n,i)},null,{name:"resize",args:arguments}).go()}}(jQuery),function(e){function t(t,a,n){var i;return a?(i="string"==typeof a?e(a):e(a).clone()).append(t):i=e(t),i.css(e.extend(n||{},{display:"block",position:"absolute"})).hide(),e("body").append(i),i.attr("data-opacity",i.css("opacity")).css("opacity",0),i.show()}function a(e,t){var a={left:t.left+"px",top:t.top+"px"},n=e.attr("data-opacity")||0,i=e.css("z-index");0!==parseInt(i,10)&&"auto"!==i||(a["z-index"]=9999),e.css(a).addClass("mapster_tooltip"),t.fadeDuration&&t.fadeDuration>0?s.fader(e[0],0,n,t.fadeDuration):s.setOpacity(e[0],n)}function n(t,a,n,i,o,r){var s=n+".mapster-tooltip";if(e.inArray(a,t)>=0)return i.unbind(s).bind(s,function(e){o&&!o.call(this,e)||(i.unbind(".mapster-tooltip"),r&&r.call(this))}),{object:i,event:s}}function i(e,t,n,i,o){var r,c={};return o=o||{},t?(r=s.areaCorners(t,n,i,e.outerWidth(!0),e.outerHeight(!0)),c.left=r[0],c.top=r[1]):(c.left=o.left,c.top=o.top),c.left+=o.offsetx||0,c.top+=o.offsety||0,c.css=o.css,c.fadeDuration=o.fadeDuration,a(e,c),e}function o(e){return e?"string"==typeof e||e.jquery?e:e.content:null}var r=e.mapster,s=r.utils;e.extend(r.defaults,{toolTipContainer:'<div style="border: 2px solid black; background: #EEEEEE; width:160px; padding:4px; margin: 4px; -moz-box-shadow: 3px 3px 5px #535353; -webkit-box-shadow: 3px 3px 5px #535353; box-shadow: 3px 3px 5px #535353; -moz-border-radius: 6px 6px 6px 6px; -webkit-border-radius: 6px; border-radius: 6px 6px 6px 6px; opacity: 0.9;"></dteniv>',showToolTip:!1,toolTipFade:!0,toolTipClose:["area-mouseout","image-mouseout"],onShowToolTip:null,onHideToolTip:null}),e.extend(r.area_defaults,{toolTip:null,toolTipClose:null}),r.MapData.prototype.clearToolTip=function(){this.activeToolTip&&(this.activeToolTip.stop().remove(),this.activeToolTip=null,this.activeToolTipID=null,s.ifFunction(this.options.onHideToolTip,this))},r.AreaData.prototype.showToolTip=function(a,o){var r,c,l,u,h,p=this,f=p.owner,d=p.effectiveOptions();if(o=o?e.extend({},o):{},a=a||d.toolTip,c=o.closeEvents||d.toolTipClose||f.options.toolTipClose||"tooltip-click",h=void 0!==o.template?o.template:f.options.toolTipContainer,o.closeEvents="string"==typeof c?c=s.split(c):c,o.fadeDuration=o.fadeDuration||(f.options.toolTipFade?f.options.fadeDuration||d.fadeDuration:0),l=p.area?p.area:e.map(p.areas(),function(e){return e.area}),f.activeToolTipID!==p.areaId)return f.clearToolTip(),f.activeToolTip=r=t(a,h,o.css),f.activeToolTipID=p.areaId,u=function(){f.clearToolTip()},n(c,"area-click","click",e(f.map),null,u),n(c,"tooltip-click","click",r,null,u),n(c,"image-mouseout","mouseout",e(f.image),function(e){return e.relatedTarget&&"AREA"!==e.relatedTarget.nodeName&&e.relatedTarget!==p.area},u),i(r,l,f.image,o.container,h),s.ifFunction(f.options.onShowToolTip,p.area,{toolTip:r,options:{},areaOptions:d,key:p.key,selected:p.isSelected()}),r},r.impl.tooltip=function(a,s){return new r.Method(this,function(){var r,c,l=this;if(a){if(c=e(a),l.activeToolTipID===c[0])return;l.clearToolTip(),l.activeToolTip=r=t(o(s),s.template||l.options.toolTipContainer,s.css),l.activeToolTipID=c[0],n(["tooltip-click"],"tooltip-click","click",r,null,function(){l.clearToolTip()}),l.activeToolTip=r=i(r,c,l.image,s.container,s)}else l.clearToolTip()},function(){e.isPlainObject(a)&&!s&&(s=a),this.showToolTip(o(s),s)},{name:"tooltip",args:arguments,key:a}).go()}}(jQuery);
--- a/src/pyams_content/zmi/resources/js/pyams_content.min.js Fri Nov 09 10:41:05 2018 +0100
+++ b/src/pyams_content/zmi/resources/js/pyams_content.min.js Fri Nov 09 15:22:13 2018 +0100
@@ -1,1 +1,1 @@
-!function(t,e){"use strict";var a=e.MyAMS,i={widget:{treeview:{selectFolder:function(e,a){t(e.target).siblings('input[type="hidden"]').val(a.id)},unselectFolder:function(e,a){t(e.target).siblings('input[type="hidden"]').val(null)}}},TinyMCE:{initEditor:function(t){return tinyMCE.addI18n("fr",{"Link list":"Liste de liens","Toggle h3 header":"En-tête H3","Toggle h4 header":"En-tête H4","Insert internal link":"Insérer un lien interne","Link title":"Texte à afficher","Internal number":"N° interne"}),tinymce.PluginManager.add("internal_links",function(t,e){t.addButton("internal_links",{icon:"cloud-check",tooltip:"Insert internal link",image:"/--static--/pyams_content/img/internal-link.png",onclick:function(){t.windowManager.open({title:"Insert internal link",body:[{type:"textbox",name:"oid",label:"Internal number"},{type:"textbox",name:"title",label:"Link title",value:t.selection.getContent()}],onsubmit:function(e){t.insertContent('<a href="oid://'+e.data.oid+'">'+e.data.title+"</a>")}})}})}),tinyMCE.PluginManager.add("headers",function(t,e){["h3","h4"].forEach(function(e){t.addButton("header-"+e,{tooltip:"Toggle "+e+" header",text:e.toUpperCase(),onClick:function(){t.execCommand("mceToggleFormat",!1,e)},onPostRender:function(){var a=this,i=function(){t.formatter.formatChanged(e,function(t){a.active(t)})};t.formatter?i():t.on("init",i)}})})}),t.image_list=i.TinyMCE.getImagesList,t.link_list=i.TinyMCE.getLinksList,t.style_formats=[{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],t.plugins+=" internal_links headers",t.toolbar1&&(t.toolbar1="undo redo | header-h3 header-h4 styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"),t.toolbar2&&(t.toolbar2="forecolor backcolor | charmap internal_links link | fullscreen preview print | code"),t},getImagesList:function(e){var i=t(document.activeElement).parents("form");if(i.exists()){var n=i.attr("data-ams-form-handler")||i.attr("action"),s=n.substr(0,n.lastIndexOf("/")+1);return a.ajax.post(s+"get-images-list.json",{},e)}},getLinksList:function(e){var i=t(document.activeElement).parents("form");if(i.exists()){var n=i.attr("data-ams-form-handler")||i.attr("action"),s=n.substr(0,n.lastIndexOf("/")+1);return a.ajax.post(s+"get-links-list.json",{},e)}}},galleries:{addMediaCallback:function(e){var a=t(".gallery",t('[id="'+e.parent+'"]')),n=a.siblings(".switcher");n.parents("fieldset:first").hasClass("switched")&&n.click();for(var s=0;s<e.medias.length;s++)a.append(e.medias[s]);a.sortable({helper:"clone",stop:i.galleries.setOrder})},updateMediaTitle:function(e){t('img[id="'+e.media_id+'"]').attr("original-title",e.title)},switchMediaVisibility:function(e){return function(){var e=t(this),i=e.parents(".media"),n=i.parents(".gallery");t("i",e).attr("class","fa fa-fw fa-spinner fa-pulse"),a.ajax.post(n.data("ams-location")+"/set-media-visibility.json",{object_name:i.data("ams-element-name")},function(a,i){a.visible?(t("i",e).attr("class","fa fa-fw fa-eye"),e.parents(".btn-group").siblings("a.fancyimg").removeClass("not-visible")):(t("i",e).attr("class","fa fa-fw fa-eye-slash text-danger"),e.parents(".btn-group").siblings("a.fancyimg").addClass("not-visible"))})}},setOrder:function(e,i){if(!i||!i.item.hasClass("already-dropped")){var n=i.item.parents(".gallery"),s=t(".media",n).listattr("data-ams-element-name");a.ajax.post(n.data("ams-location")+"/set-medias-order.json",{medias:JSON.stringify(s)})}},removeMedia:function(e){return function(){var e=t(this);a.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i> '+a.i18n.DELETE_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(t){if(t===a.i18n.BTN_OK){var i=e.parents(".gallery").data("ams-location"),n=e.parents(".media"),s=n.data("ams-element-name");a.ajax.post(i+"/delete-element.json",{object_name:s},function(t,e){n.remove(),t.handle_json&&a.ajax.handleJSON(t)})}})}},afterFancyboxLoad:function(t,e){t.element.hasClass("not-visible")&&t.inner.prepend('<div class="hidden-mask"></div>')}},illustration:{addIllustration:function(){var e=t(this),a=e.parents(".btn-group").siblings("legend.switcher");t("i.fa-plus",a).click(),e.hide(),t('input[type="file"]',a.siblings(".form-group:first")).click()}},paragraphs:{preReload:function(){i.paragraphs.switched=t("i.switch.fa-minus-square-o","#paragraphs_list").parents("tr").listattr("id")},postReload:function(){t(i.paragraphs.switched).each(function(){t("i.switch.fa-plus-square-o",'[id="'+this+'"]').parents("div").first().click()}),delete i.paragraphs.switched},refreshParagraph:function(e){var a=t('tr[id="'+e.object_id+'"]');t("span.title",a).html(e.title||" - - - - - - - -")},switchEditor:function(e){var i=t(this),n=t("i.switch",i),s=i.parents("td"),r=t(".editor",s),o=i.parents("tr");if(n.hasClass("fa-plus-square-o")){var l=o.parents("table");r.html('<h1 class="loading"><i class="fa fa-2x fa-gear fa-spin"></i></h1>'),a.ajax.post(l.data("ams-location")+"/get-paragraph-editor.json",{object_name:o.data("ams-element-name")},function(t){r.html(t),t&&(a.initContent(r),n.removeClass("fa-plus-square-o").addClass("fa-minus-square-o"),o.data("ams-disabled-handlers",!0),a.skin.scrollTo(r,{offset:r.height()-o.height()}))})}else a.skin.cleanContainer(r),r.empty(),n.removeClass("fa-minus-square-o").addClass("fa-plus-square-o"),o.removeData("ams-disabled-handlers")},switchLastEditor:function(e){var a=t('table[id="'+e+'"]'),i=t("tr:last",a);t('[data-ams-click-handler="PyAMS_content.paragraphs.switchEditor"]',i).click()},switchAllEditors:function(e){var i=t(this),n=t("i",i),s=i.parents("table");n.hasClass("fa-plus-square-o")?(n.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),a.ajax.post(s.data("ams-location")+"/get-paragraphs-editors.json",{},function(e){for(var i in e)if(e.hasOwnProperty(i)){var r=t('tr[data-ams-element-name="'+i+'"]',s),o=t(".editor",r);o.is(":empty")&&o.html(e[i]),t(".fa-plus-square-o",r).removeClass("fa-plus-square-o").addClass("fa-minus-square-o"),r.data("ams-disabled-handlers",!0)}t("i.fa-plus-square-o",t("tbody",s)).exists()||n.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o"),a.initContent(s)})):(t(".editor",s).each(function(){a.skin.cleanContainer(t(this)),t(this).empty()}),t(".fa-minus-square-o",s).removeClass("fa-minus-square-o").addClass("fa-plus-square-o"),t("tr",s).removeData("ams-disabled-handlers"))},updateToolbar:function(e){var i=t('tr[id="'+e.object_id+'"]'),n=t(".title-toolbar",i);n.replaceWith(e.toolbar_tag),n=t(".title-toolbar",i),a.initContent(n)},updateMarkers:function(e){var i=t('tr[id="'+e.object_id+'"]'),n=t(".title-toolbar",i),s=t("DIV.action."+e.marker_type,n);s.exists()?s.replaceWith(e.marker_tag):t(e.marker_tag).appendTo(n),e.marker_tag&&(s=t("DIV.action."+e.marker_type,n),a.initContent(s)),a.helpers.sort(n,"weight")}},pictograms:{initManagerSelection:function(){var e=t(this),a=t('input[type="hidden"]',t(".selected-pictograms",e)).listattr("value");return{selected:JSON.stringify(a)}},switchPictogram:function(){var e=t(this),a=e.parents(".pictograms"),i=a.parents(".pictograms-manager");a.hasClass("available-pictograms")?t(".selected-pictograms",i).append(e):t(".available-pictograms",i).append(e)}},themes:{initExtracts:function(e){var i=t('select[name="manager_themes.widgets.thesaurus_name:list"]',e).val(),n=t('select[name="manager_themes.widgets.extract_name:list"]',e),s=n.val();i&&a.jsonrpc.post("getExtracts",{thesaurus_name:i},{url:"/api/thesaurus/json"},function(e){n.empty(),t(e.result).each(function(){t("<option></option>").attr("value",this.id).attr("selected",this.id===s).text(this.text).appendTo(n)})})},getExtracts:function(e){var i=t(e.currentTarget).parents("form"),n=t('select[name="manager_themes.widgets.thesaurus_name:list"]',i).val(),s=t('select[name="manager_themes.widgets.extract_name:list"]',i),r=s.data("select2");n&&"--NOVALUE--"!==n?a.jsonrpc.post("getExtracts",{thesaurus_name:n},{url:"/api/thesaurus/json"},function(t){r.results.empty(),r.opts.populateResults.call(r,r.results,t.result,{term:""})}):(s.select2("data",null),r.results.empty(),r.opts.populateResults.call(r,r.results,[],{term:""}))}},fields:{refreshField:function(e){var a=t('table[id="form_fields_list"]'),i=t('tr[data-ams-element-name="'+e.object_name+'"]',a);t("td:nth-child(4)",i).html(e.title)}},imgmap:{init:function(){var e=t(this);a.ajax.check(t.fn.canvasAreaDraw,"/--static--/pyams_content/js/jquery-canvasAreaDraw"+a.devext+".js",function(){e.canvasAreaDraw({imageUrl:e.data("ams-image-url")})})},initPreview:function(){var e=t(this);a.ajax.check(t.fn.mapster,"/--static--/pyams_content/js/jquery-imagemapster-1.2.10"+a.devext+".js",function(){e.mapster({fillColor:"ff0000",fillOpacity:.35,selected:!0,highlight:!0,staticState:!0})})}},site:{switchVisibility:function(){return function(){var e=t(this),i=e.parents("tr").first();a.ajax.post(i.data("ams-location")+"/switch-content-visibility.json",{object_name:i.data("ams-element-name")},function(a,i){var n="fa-eye";a.visible||(n+="-slash"),a.published||(n+=" text-danger"),t("i",e).attr("class","fa fa-fw "+n)})}}},review:{timer:null,timer_duration:{general:3e4,chat:5e3},initComments:function(e){var n=t(".chat-body",e);n.animate({scrollTop:n[0].scrollHeight},1e3),clearInterval(i.review.timer),i.review.timer=setInterval(i.review.updateComments,i.review.timer_duration.chat),a.skin.registerCleanCallback(i.review.cleanCommentsCallback)},cleanCommentsCallback:function(){clearInterval(i.review.timer),i.review.timer=setInterval(i.review.updateComments,i.review.timer_duration.general)},updateComments:function(){var e,i=t(".badge",'nav a[href="#review-comments.html"]'),n=t(".chat-body",".widget-body");e=n.exists()?t(".message",n).length:parseInt(i.text()),a.ajax.post("get-last-review-comments.json",{count:e},function(a){n.exists()&&i.removeClass("bg-color-danger").addClass("bg-color-info"),e!==a.count&&(i.text(a.count).removeClass("hidden"),n.exists()&&(t(".messages",n).append(a.content),n.animate({scrollTop:n[0].scrollHeight},1e3)),n.exists()||i.removeClass("bg-color-info").addClass("bg-color-danger").animate({padding:"3px 12px 2px","margin-right":"9px"},"slow",function(){t(this).animate({padding:"3px 6px 2px","margin-right":"15px"},"slow")}))})},initCommentData:function(e){var a=t(".chat-body",".widget-body");return{count:t(".message",a).length}},addCommentAction:function(){return function(){t('textarea[name="comment"]').focus()}},addCommentCallback:function(e){var a=t(this),i=a.parents(".widget-body");t(".messages",i).append(e.content),t('textarea[name="comment"]',a).val("");var n=t(".chat-body",i);n.animate({scrollTop:n[0].scrollHeight},1e3),t(".badge",'nav a[href="#review-comments.html"]').text(e.count).removeClass("hidden")}},header:{submitEditForm:function(){var e=t(this).parents("form").first();a.form.submit(e,{form_data:{autosubmit:!0}})}},footer:{submitEditForm:function(){var e=t(this).parents("form").first();a.form.submit(e,{form_data:{autosubmit:!0}})}},profile:{switchFavorite:function(){var e=t(this),i=e.data("sequence-oid");a.ajax.post("switch-user-favorite.json",{oid:i},function(t,a){t.favorite?e.removeClass("fa-star-o").addClass("fa-star"):e.removeClass("fa-star").addClass("fa-star-o")})}}};t(".badge",'nav a[href="#review-comments.html"]').exists()&&(i.review.timer=setInterval(i.review.updateComments,i.review.timer_duration.general)),e.PyAMS_content=i}(jQuery,this);
+!function(t,e){"use strict";var a=e.MyAMS,i={widget:{treeview:{selectFolder:function(e,a){t(e.target).siblings('input[type="hidden"]').val(a.id)},unselectFolder:function(e,a){t(e.target).siblings('input[type="hidden"]').val(null)}}},TinyMCE:{initEditor:function(t){return tinyMCE.addI18n("fr",{"Link list":"Liste de liens","Toggle h3 header":"En-tête H3","Toggle h4 header":"En-tête H4","Insert internal link":"Insérer un lien interne","Link title":"Texte à afficher","Internal number":"N° interne"}),tinymce.PluginManager.add("internal_links",function(t,e){t.addButton("internal_links",{icon:"cloud-check",tooltip:"Insert internal link",image:"/--static--/pyams_content/img/internal-link.png",stateSelector:'a[href^="oid://"]',onclick:function(){var e={},a=t.dom,i=t.selection,n=i.getNode(),s=a.getParent(n,"a[href]");e.text=s?s.innerText||s.textContent:i.getContent({format:"text"}),e.href=s?a.getAttrib(s,"href"):"",t.windowManager.open({title:"Insert internal link",body:[{type:"textbox",name:"oid",label:"Internal number",value:e.href,onchange:function(){e.href=this.value()}},{type:"textbox",name:"title",label:"Link title",value:e.text,onchange:function(){e.text=this.value()}}],onsubmit:function(n){t.focus(),e.href?s?("innerText"in s?s.innerText=e.text:s.textContent=e.text,a.setAttribs(s,{href:e.href}),i.select(s),t.undoManager.add()):t.insertContent('<a href="oid://'+n.data.oid+'">'+n.data.title+"</a>"):t.execCommand("unlink")}})}})}),tinyMCE.PluginManager.add("headers",function(t,e){["h3","h4"].forEach(function(e){t.addButton("header-"+e,{tooltip:"Toggle "+e+" header",text:e.toUpperCase(),onClick:function(){t.execCommand("mceToggleFormat",!1,e)},onPostRender:function(){var a=this,i=function(){t.formatter.formatChanged(e,function(t){a.active(t)})};t.formatter?i():t.on("init",i)}})})}),t.image_list=i.TinyMCE.getImagesList,t.link_list=i.TinyMCE.getLinksList,t.style_formats=[{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],t.plugins+=" internal_links headers",t.toolbar1&&(t.toolbar1="undo redo | header-h3 header-h4 styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"),t.toolbar2&&(t.toolbar2="forecolor backcolor | charmap internal_links link | fullscreen preview print | code"),t},getImagesList:function(e){var i=t(document.activeElement).parents("form");if(i.exists()){var n=i.attr("data-ams-form-handler")||i.attr("action"),s=n.substr(0,n.lastIndexOf("/")+1);return a.ajax.post(s+"get-images-list.json",{},e)}},getLinksList:function(e){var i=t(document.activeElement).parents("form");if(i.exists()){var n=i.attr("data-ams-form-handler")||i.attr("action"),s=n.substr(0,n.lastIndexOf("/")+1);return a.ajax.post(s+"get-links-list.json",{},e)}}},galleries:{addMediaCallback:function(e){var a=t(".gallery",t('[id="'+e.parent+'"]')),n=a.siblings(".switcher");n.parents("fieldset:first").hasClass("switched")&&n.click();for(var s=0;s<e.medias.length;s++)a.append(e.medias[s]);a.sortable({helper:"clone",stop:i.galleries.setOrder})},updateMediaTitle:function(e){t('img[id="'+e.media_id+'"]').attr("original-title",e.title)},switchMediaVisibility:function(e){return function(){var e=t(this),i=e.parents(".media"),n=i.parents(".gallery");t("i",e).attr("class","fa fa-fw fa-spinner fa-pulse"),a.ajax.post(n.data("ams-location")+"/set-media-visibility.json",{object_name:i.data("ams-element-name")},function(a,i){a.visible?(t("i",e).attr("class","fa fa-fw fa-eye"),e.parents(".btn-group").siblings("a.fancyimg").removeClass("not-visible")):(t("i",e).attr("class","fa fa-fw fa-eye-slash text-danger"),e.parents(".btn-group").siblings("a.fancyimg").addClass("not-visible"))})}},setOrder:function(e,i){if(!i||!i.item.hasClass("already-dropped")){var n=i.item.parents(".gallery"),s=t(".media",n).listattr("data-ams-element-name");a.ajax.post(n.data("ams-location")+"/set-medias-order.json",{medias:JSON.stringify(s)})}},removeMedia:function(e){return function(){var e=t(this);a.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i> '+a.i18n.DELETE_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(t){if(t===a.i18n.BTN_OK){var i=e.parents(".gallery").data("ams-location"),n=e.parents(".media"),s=n.data("ams-element-name");a.ajax.post(i+"/delete-element.json",{object_name:s},function(t,e){n.remove(),t.handle_json&&a.ajax.handleJSON(t)})}})}},afterFancyboxLoad:function(t,e){t.element.hasClass("not-visible")&&t.inner.prepend('<div class="hidden-mask"></div>')}},illustration:{addIllustration:function(){var e=t(this),a=e.parents(".btn-group").siblings("legend.switcher");t("i.fa-plus",a).click(),e.hide(),t('input[type="file"]',a.siblings(".form-group:first")).click()}},paragraphs:{preReload:function(){i.paragraphs.switched=t("i.switch.fa-minus-square-o","#paragraphs_list").parents("tr").listattr("id")},postReload:function(){t(i.paragraphs.switched).each(function(){t("i.switch.fa-plus-square-o",'[id="'+this+'"]').parents("div").first().click()}),delete i.paragraphs.switched},refreshParagraph:function(e){var a=t('tr[id="'+e.object_id+'"]');t("span.title",a).html(e.title||" - - - - - - - -")},switchEditor:function(e){var i=t(this),n=t("i.switch",i),s=i.parents("td"),r=t(".editor",s),o=i.parents("tr");if(n.hasClass("fa-plus-square-o")){var l=o.parents("table");r.html('<h1 class="loading"><i class="fa fa-2x fa-gear fa-spin"></i></h1>'),a.ajax.post(l.data("ams-location")+"/get-paragraph-editor.json",{object_name:o.data("ams-element-name")},function(t){r.html(t),t&&(a.initContent(r),n.removeClass("fa-plus-square-o").addClass("fa-minus-square-o"),o.data("ams-disabled-handlers",!0),a.skin.scrollTo(r,{offset:r.height()-o.height()}))})}else a.skin.cleanContainer(r),r.empty(),n.removeClass("fa-minus-square-o").addClass("fa-plus-square-o"),o.removeData("ams-disabled-handlers")},switchLastEditor:function(e){var a=t('table[id="'+e+'"]'),i=t("tr:last",a);t('[data-ams-click-handler="PyAMS_content.paragraphs.switchEditor"]',i).click()},switchAllEditors:function(e){var i=t(this),n=t("i",i),s=i.parents("table");n.hasClass("fa-plus-square-o")?(n.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),a.ajax.post(s.data("ams-location")+"/get-paragraphs-editors.json",{},function(e){for(var i in e)if(e.hasOwnProperty(i)){var r=t('tr[data-ams-element-name="'+i+'"]',s),o=t(".editor",r);o.is(":empty")&&o.html(e[i]),t(".fa-plus-square-o",r).removeClass("fa-plus-square-o").addClass("fa-minus-square-o"),r.data("ams-disabled-handlers",!0)}t("i.fa-plus-square-o",t("tbody",s)).exists()||n.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o"),a.initContent(s)})):(t(".editor",s).each(function(){a.skin.cleanContainer(t(this)),t(this).empty()}),t(".fa-minus-square-o",s).removeClass("fa-minus-square-o").addClass("fa-plus-square-o"),t("tr",s).removeData("ams-disabled-handlers"))},updateToolbar:function(e){var i=t('tr[id="'+e.object_id+'"]'),n=t(".title-toolbar",i);n.replaceWith(e.toolbar_tag),n=t(".title-toolbar",i),a.initContent(n)},updateMarkers:function(e){var i=t('tr[id="'+e.object_id+'"]'),n=t(".title-toolbar",i),s=t("DIV.action."+e.marker_type,n);s.exists()?s.replaceWith(e.marker_tag):t(e.marker_tag).appendTo(n),e.marker_tag&&(s=t("DIV.action."+e.marker_type,n),a.initContent(s)),a.helpers.sort(n,"weight")}},pictograms:{initManagerSelection:function(){var e=t(this),a=t('input[type="hidden"]',t(".selected-pictograms",e)).listattr("value");return{selected:JSON.stringify(a)}},switchPictogram:function(){var e=t(this),a=e.parents(".pictograms"),i=a.parents(".pictograms-manager");a.hasClass("available-pictograms")?t(".selected-pictograms",i).append(e):t(".available-pictograms",i).append(e)}},themes:{initExtracts:function(e){var i=t('select[name="manager_themes.widgets.thesaurus_name:list"]',e).val(),n=t('select[name="manager_themes.widgets.extract_name:list"]',e),s=n.val();i&&a.jsonrpc.post("getExtracts",{thesaurus_name:i},{url:"/api/thesaurus/json"},function(e){n.empty(),t(e.result).each(function(){t("<option></option>").attr("value",this.id).attr("selected",this.id===s).text(this.text).appendTo(n)})})},getExtracts:function(e){var i=t(e.currentTarget).parents("form"),n=t('select[name="manager_themes.widgets.thesaurus_name:list"]',i).val(),s=t('select[name="manager_themes.widgets.extract_name:list"]',i),r=s.data("select2");n&&"--NOVALUE--"!==n?a.jsonrpc.post("getExtracts",{thesaurus_name:n},{url:"/api/thesaurus/json"},function(t){r.results.empty(),r.opts.populateResults.call(r,r.results,t.result,{term:""})}):(s.select2("data",null),r.results.empty(),r.opts.populateResults.call(r,r.results,[],{term:""}))}},fields:{refreshField:function(e){var a=t('table[id="form_fields_list"]'),i=t('tr[data-ams-element-name="'+e.object_name+'"]',a);t("td:nth-child(4)",i).html(e.title)}},imgmap:{init:function(){var e=t(this);a.ajax.check(t.fn.canvasAreaDraw,"/--static--/pyams_content/js/jquery-canvasAreaDraw"+a.devext+".js",function(){e.canvasAreaDraw({imageUrl:e.data("ams-image-url")})})},initPreview:function(){var e=t(this);a.ajax.check(t.fn.mapster,"/--static--/pyams_content/js/jquery-imagemapster-1.2.10"+a.devext+".js",function(){e.mapster({fillColor:"ff0000",fillOpacity:.35,selected:!0,highlight:!0,staticState:!0})})}},site:{switchVisibility:function(){return function(){var e=t(this),i=e.parents("tr").first();a.ajax.post(i.data("ams-location")+"/switch-content-visibility.json",{object_name:i.data("ams-element-name")},function(a,i){var n="fa-eye";a.visible||(n+="-slash"),a.published||(n+=" text-danger"),t("i",e).attr("class","fa fa-fw "+n)})}}},review:{timer:null,timer_duration:{general:3e4,chat:5e3},initComments:function(e){var n=t(".chat-body",e);n.animate({scrollTop:n[0].scrollHeight},1e3),clearInterval(i.review.timer),i.review.timer=setInterval(i.review.updateComments,i.review.timer_duration.chat),a.skin.registerCleanCallback(i.review.cleanCommentsCallback)},cleanCommentsCallback:function(){clearInterval(i.review.timer),i.review.timer=setInterval(i.review.updateComments,i.review.timer_duration.general)},updateComments:function(){var e,i=t(".badge",'nav a[href="#review-comments.html"]'),n=t(".chat-body",".widget-body");e=n.exists()?t(".message",n).length:parseInt(i.text()),a.ajax.post("get-last-review-comments.json",{count:e},function(a){n.exists()&&i.removeClass("bg-color-danger").addClass("bg-color-info"),e!==a.count&&(i.text(a.count).removeClass("hidden"),n.exists()&&(t(".messages",n).append(a.content),n.animate({scrollTop:n[0].scrollHeight},1e3)),n.exists()||i.removeClass("bg-color-info").addClass("bg-color-danger").animate({padding:"3px 12px 2px","margin-right":"9px"},"slow",function(){t(this).animate({padding:"3px 6px 2px","margin-right":"15px"},"slow")}))})},initCommentData:function(e){var a=t(".chat-body",".widget-body");return{count:t(".message",a).length}},addCommentAction:function(){return function(){t('textarea[name="comment"]').focus()}},addCommentCallback:function(e){var a=t(this),i=a.parents(".widget-body");t(".messages",i).append(e.content),t('textarea[name="comment"]',a).val("");var n=t(".chat-body",i);n.animate({scrollTop:n[0].scrollHeight},1e3),t(".badge",'nav a[href="#review-comments.html"]').text(e.count).removeClass("hidden")}},header:{submitEditForm:function(){var e=t(this).parents("form").first();a.form.submit(e,{form_data:{autosubmit:!0}})}},footer:{submitEditForm:function(){var e=t(this).parents("form").first();a.form.submit(e,{form_data:{autosubmit:!0}})}},profile:{switchFavorite:function(){var e=t(this),i=e.data("sequence-oid");a.ajax.post("switch-user-favorite.json",{oid:i},function(t,a){t.favorite?e.removeClass("fa-star-o").addClass("fa-star"):e.removeClass("fa-star").addClass("fa-star-o")})}}};t(".badge",'nav a[href="#review-comments.html"]').exists()&&(i.review.timer=setInterval(i.review.updateComments,i.review.timer_duration.general)),e.PyAMS_content=i}(jQuery,this);