text: !function(a){var b={colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,enableZoom:1,showTooltip:1,borderColor:1,borderWidth:1,borderOpacity:1,selectedRegion:1},c={onLabelShow:"labelShow",onRegionOver:"regionMouseOver",onRegionOut:"regionMouseOut",onRegionClick:"regionClick"};a.fn.vectorMap=function(d){var f,g={map:"world_en",backgroundColor:"#a5bfdd",color:"#f4f3f0",hoverColor:"#c9dfaf",selectedColor:"#c9dfaf",scaleColors:["#b6d6ff","#005ace"],normalizeFunction:"linear",enableZoom:!0,showTooltip:!0,borderColor:"#818181",borderWidth:1,borderOpacity:.25,selectedRegion:null};if("addMap"===d)e.maps[arguments[1]]=arguments[2];else if("set"===d&&b[arguments[1]])this.data("mapObject")["set"+arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1)].apply(this.data("mapObject"),Array.prototype.slice.call(arguments,2));else{a.extend(g,d),g.container=this,this.css({position:"relative",overflow:"hidden"}),f=new e(g),this.data("mapObject",f);for(var h in c)g[h]&&this.bind(c[h]+".jqvmap",g[h])}};var d=function(a,b,c){if(this.mode=window.SVGAngle?"svg":"vml",this.params=c,"svg"==this.mode)this.createSvgNode=function(a){return document.createElementNS(this.svgns,a)};else{try{document.namespaces.rvml||document.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),this.createVmlNode=function(a){return document.createElement("<rvml:"+a+' class="rvml">')}}catch(d){this.createVmlNode=function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)")}"svg"==this.mode?this.canvas=this.createSvgNode("svg"):(this.canvas=this.createVmlNode("group"),this.canvas.style.position="absolute"),this.setSize(a,b)};d.prototype={svgns:"http://www.w3.org/2000/svg",mode:"svg",width:0,height:0,canvas:null,setSize:function(a,b){if("svg"==this.mode)this.canvas.setAttribute("width",a),this.canvas.setAttribute("height",b);else if(this.canvas.style.width=a+"px",this.canvas.style.height=b+"px",this.canvas.coordsize=a+" "+b,this.canvas.coordorigin="0 0",this.rootGroup){for(var c=this.rootGroup.getElementsByTagName("shape"),d=0,e=c.length;d<e;d++)c[d].coordsize=a+" "+b,c[d].style.width=a+"px",c[d].style.height=b+"px";this.rootGroup.coordsize=a+" "+b,this.rootGroup.style.width=a+"px",this.rootGroup.style.height=b+"px"}this.width=a,this.height=b},createPath:function(a){var b;if("svg"==this.mode)b=this.createSvgNode("path"),b.setAttribute("d",a.path),null!==this.params.borderColor&&b.setAttribute("stroke",this.params.borderColor),this.params.borderWidth>0&&(b.setAttribute("stroke-width",this.params.borderWidth),b.setAttribute("stroke-linecap","round"),b.setAttribute("stroke-linejoin","round")),this.params.borderOpacity>0&&b.setAttribute("stroke-opacity",this.params.borderOpacity),b.setFill=function(a){this.setAttribute("fill",a),null===this.getAttribute("original")&&this.setAttribute("original",a)},b.getFill=function(a){return this.getAttribute("fill")},b.getOriginalFill=function(){return this.getAttribute("original")},b.setOpacity=function(a){this.setAttribute("fill-opacity",a)};else{b=this.createVmlNode("shape"),b.coordorigin="0 0",b.coordsize=this.width+" "+this.height,b.style.width=this.width+"px",b.style.height=this.height+"px",b.fillcolor=e.defaultFillColor,b.stroked=!1,b.path=d.pathSvgToVml(a.path);var c=this.createVmlNode("skew");c.on=!0,c.matrix="0.01,0,0,0.01,0,0",c.offset="0,0",b.appendChild(c);var f=this.createVmlNode("fill");b.appendChild(f),b.setFill=function(a){this.getElementsByTagName("fill")[0].color=a},b.getFill=function(a){return this.getElementsByTagName("fill")[0].color},b.setOpacity=function(a){this.getElementsByTagName("fill")[0].opacity=parseInt(100*a,10)+"%"}}return b},createGroup:function(a){var b;return"svg"==this.mode?b=this.createSvgNode("g"):(b=this.createVmlNode("group"),b.style.width=this.width+"px",b.style.height=this.height+"px",b.style.left="0px",b.style.top="0px",b.coordorigin="0 0",b.coordsize=this.width+" "+this.height),a&&(this.rootGroup=b),b},applyTransformParams:function(a,b,c){"svg"==this.mode?this.rootGroup.setAttribute("transform","scale("+a+") translate("+b+", "+c+")"):(this.rootGroup.coordorigin=this.width-b+","+(this.height-c),this.rootGroup.coordsize=this.width/a+","+this.height/a)}},d.pathSvgToVml=function(a){var b,c,d=0,e=0;return a.replace(/([MmLlHhVvCcSs])((?:-?(?:\d+)?(?:\.\d+)?,?\s?)+)/g,function(a,f,g,h){g=g.replace(/(\d)-/g,"$1,-").replace(/\s+/g,",").split(","),g[0]||g.shift();for(var i=0,j=g.length;i<j;i++)g[i]=Math.round(100*g[i]);switch(f){case"m":return d+=g[0],e+=g[1],"t"+g.join(",");case"M":return d=g[0],e=g[1],"m"+g.join(",");case"l":return d+=g[0],e+=g[1],"r"+g.join(",");case"L":return d=g[0],e=g[1],"l"+g.join(",");case"h":return d+=g[0],"r"+g[0]+",0";case"H":return"l"+(d=g[0])+","+e;case"v":return e+=g[0],"r0,"+g[0];case"V":return e=g[0],"l"+d+","+e;case"c":return b=d+g[g.length-4],c=e+g[g.length-3],d+=g[g.length-2],e+=g[g.length-1],"v"+g.join(",");case"C":return b=g[g.length-4],c=g[g.length-3],d=g[g.length-2],e=g[g.length-1],"c"+g.join(",");case"s":return g.unshift(e-c),g.unshift(d-b),b=d+g[g.length-4],c=e+g[g.length-3],d+=g[g.length-2],e+=g[g.length-1],"v"+g.join(",");case"S":return g.unshift(e+e-c),g.unshift(d+d-b),b=g[g.length-4],c=g[g.length-3],d=g[g.length-2],e=g[g.length-1],"c"+g.join(",");default:return!1}return""}).replace(/z/g,"")};var e=function(b){b=b||{};var c=this,g=e.maps[b.map];this.container=b.container,this.defaultWidth=g.width,this.defaultHeight=g.height,this.color=b.color,this.hoverColor=b.hoverColor,this.setBackgroundColor(b.backgroundColor),this.width=b.container.width(),this.height=b.container.height(),this.resize(),jQuery(window).resize(function(){c.width=b.container.width(),c.height=b.container.height(),c.resize(),c.canvas.setSize(c.width,c.height),c.applyTransform()}),this.canvas=new d(this.width,this.height,b),b.container.append(this.canvas.canvas),this.makeDraggable(),this.rootGroup=this.canvas.createGroup(!0),this.index=e.mapIndex,this.label=jQuery("<div/>").addClass("jqvmap-label").appendTo(jQuery("body")),b.enableZoom&&(jQuery("<div/>").addClass("jqvmap-zoomin").text("+").appendTo(b.container),jQuery("<div/>").addClass("jqvmap-zoomout").html("&#x2212;").appendTo(b.container)),c.countries=[];for(var h in g.pathes){var i=this.canvas.createPath({path:g.pathes[h].path});i.setFill(this.color),i.id="jqvmap"+c.index+"_"+h,c.countries[h]=i,jQuery(this.rootGroup).append(i),i.setAttribute("class","jqvmap-region"),null!==b.selectedRegion&&h.toLowerCase()==b.selectedRegion.toLowerCase()&&i.setFill(b.selectedColor)}jQuery(b.container).delegate("svg"==this.canvas.mode?"path":"shape","mouseover mouseout",function(d){var e=d.target,f=d.target.id.split("_").pop(),h=a.Event("labelShow.jqvmap"),i=a.Event("regionMouseOver.jqvmap");"mouseover"==d.type?(jQuery(b.container).trigger(i,[f,g.pathes[f].name]),i.isDefaultPrevented()||(b.hoverOpacity?e.setOpacity(b.hoverOpacity):b.hoverColor&&(e.currentFillColor=e.getFill()+"",e.setFill(b.hoverColor))),b.showTooltip&&(c.label.text(g.pathes[f].name),jQuery(b.container).trigger(h,[c.label,f]),h.isDefaultPrevented()||(c.label.show(),c.labelWidth=c.label.width(),c.labelHeight=c.label.height()))):(e.setOpacity(1),e.currentFillColor&&e.setFill(e.currentFillColor),c.label.hide(),jQuery(b.container).trigger("regionMouseOut.jqvmap",[f,g.pathes[f].name]))}),jQuery(b.container).delegate("svg"==this.canvas.mode?"path":"shape","click",function(a){for(var d in g.pathes)c.countries[d].currentFillColor=c.countries[d].getOriginalFill(),c.countries[d].setFill(c.countries[d].getOriginalFill());var e=a.target,f=a.target.id.split("_").pop();jQuery(b.container).trigger("regionClick.jqvmap",[f,g.pathes[f].name]),e.currentFillColor=b.selectedColor,e.setFill(b.selectedColor)}),b.showTooltip&&b.container.mousemove(function(a){c.label.is(":visible")&&c.label.css({left:a.pageX-15-c.labelWidth,top:a.pageY-15-c.labelHeight})}),this.setColors(b.colors),this.canvas.canvas.appendChild(this.rootGroup),this.applyTransform(),this.colorScale=new f(b.scaleColors,b.normalizeFunction,b.valueMin,b.valueMax),b.values&&(this.values=b.values,this.setValues(b.values)),this.bindZoomButtons(),e.mapIndex++};e.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,countries:{},countriesColors:{},countriesData:{},zoomStep:1.4,zoomMaxStep:4,zoomCurStep:1,setColors:function(a,b){if("string"==typeof a)this.countries[a].setFill(b),this.countries[a].setAttribute("original",b);else{var c=a;for(var d in c)this.countries[d]&&(this.countries[d].setFill(c[d]),this.countries[d].setAttribute("original",c[d]))}},setValues:function(a){var b,c=0,d=Number.MAX_VALUE;for(var e in a)b=parseFloat(a[e]),b>c&&(c=a[e]),b&&b<d&&(d=b);this.colorScale.setMin(d),this.colorScale.setMax(c);var f={};for(e in a)b=parseFloat(a[e]),f[e]=b?this.colorScale.getColor(b):this.color;this.setColors(f),this.values=a},setBackgroundColor:function(a){this.container.css("background-color",a)},setScaleColors:function(a){this.colorScale.setColors(a),this.values&&this.setValues(this.values)},setNormalizeFunction:function(a){this.colorScale.setNormalizeFunction(a),this.values&&this.setValues(this.values)},resize:function(){var a=this.baseScale;this.width/this.height>this.defaultWidth/this.defaultHeight?(this.baseScale=this.height/this.defaultHeight,this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)):(this.baseScale=this.width/this.defaultWidth,this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)),this.scale*=this.baseScale/a,this.transX*=this.baseScale/a,this.transY*=this.baseScale/a},reset:function(){this.countryTitle.reset();for(var a in this.countries)this.countries[a].setFill(e.defaultColor);this.scale=this.baseScale,this.transX=this.baseTransX,this.transY=this.baseTransY,this.applyTransform()},applyTransform:function(){var a,b,c,d;this.defaultWidth*this.scale<=this.width?(a=(this.width-this.defaultWidth*this.scale)/(2*this.scale),c=(this.width-this.defaultWidth*this.scale)/(2*this.scale)):(a=0,c=(this.width-this.defaultWidth*this.scale)/this.scale),this.defaultHeight*this.scale<=this.height?(b=(this.height-this.defaultHeight*this.scale)/(2*this.scale),d=(this.height-this.defaultHeight*this.scale)/(2*this.scale)):(b=0,d=(this.height-this.defaultHeight*this.scale)/this.scale),this.transY>b?this.transY=b:this.transY<d&&(this.transY=d),this.transX>a?this.transX=a:this.transX<c&&(this.transX=c),this.canvas.applyTransformParams(this.scale,this.transX,this.transY)},makeDraggable:function(){var a,b,c=!1,d=this;this.container.mousemove(function(e){if(c){d.transX,d.transY;d.transX-=(a-e.pageX)/d.scale,d.transY-=(b-e.pageY)/d.scale,d.applyTransform(),a=e.pageX,b=e.pageY}return!1}).mousedown(function(d){return c=!0,a=d.pageX,b=d.pageY,!1}).mouseup(function(){return c=!1,!1})},bindZoomButtons:function(){var a=this,b=(jQuery("#zoom").innerHeight()-12-30-6-7-6)/(this.zoomMaxStep-this.zoomCurStep);this.container.find(".jqvmap-zoomin").click(function(){if(a.zoomCurStep<a.zoomMaxStep){a.transX,a.transY,a.scale;a.transX-=(a.width/a.scale-a.width/(a.scale*a.zoomStep))/2,a.transY-=(a.height/a.scale-a.height/(a.scale*a.zoomStep))/2,a.setScale(a.scale*a.zoomStep),a.zoomCurStep++,jQuery("#zoomSlider").css("top",parseInt(jQuery("#zoomSlider").css("top"),10)-b)}}),this.container.find(".jqvmap-zoomout").click(function(){if(a.zoomCurStep>1){a.transX,a.transY,a.scale;a.transX+=(a.width/(a.scale/a.zoomStep)-a.width/a.scale)/2,a.transY+=(a.height/(a.scale/a.zoomStep)-a.height/a.scale)/2,a.setScale(a.scale/a.zoomStep),a.zoomCurStep--,jQuery("#zoomSlider").css("top",parseInt(jQuery("#zoomSlider").css("top"),10)+b)}})},setScale:function(a){this.scale=a,this.applyTransform()},getCountryPath:function(a){return jQuery("#"+a)[0]}},e.xlink="http://www.w3.org/1999/xlink",e.mapIndex=1,e.maps={};var f=function(a,b,c,d){a&&this.setColors(a),b&&this.setNormalizeFunction(b),c&&this.setMin(c),c&&this.setMax(d)};f.prototype={colors:[],setMin:function(a){this.clearMinValue=a,"function"==typeof this.normalize?this.minValue=this.normalize(a):this.minValue=a},setMax:function(a){this.clearMaxValue=a,"function"==typeof this.normalize?this.maxValue=this.normalize(a):this.maxValue=a},setColors:function(a){for(var b=0;b<a.length;b++)a[b]=f.rgbToArray(a[b]);this.colors=a},setNormalizeFunction:function(a){"polynomial"===a?this.normalize=function(a){return Math.pow(a,.2)}:"linear"===a?delete this.normalize:this.normalize=a,this.setMin(this.clearMinValue),this.setMax(this.clearMaxValue)},getColor:function(a){"function"==typeof this.normalize&&(a=this.normalize(a));for(var b,c=[],d=0,e=0;e<this.colors.length-1;e++)b=this.vectorLength(this.vectorSubtract(this.colors[e+1],this.colors[e])),c.push(b),d+=b;var f=(this.maxValue-this.minValue)/d;for(e=0;e<c.length;e++)c[e]*=f;for(e=0,a-=this.minValue;a-c[e]>=0;)a-=c[e],e++;var g;for(g=e==this.colors.length-1?this.vectorToNum(this.colors[e]).toString(16):this.vectorToNum(this.vectorAdd(this.colors[e],this.vectorMult(this.vectorSubtract(this.colors[e+1],this.colors[e]),a/c[e]))).toString(16);g.length<6;)g="0"+g;return"#"+g},vectorToNum:function(a){for(var b=0,c=0;c<a.length;c++)b+=Math.round(a[c])*Math.pow(256,a.length-c-1);return b},vectorSubtract:function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=a[d]-b[d];return c},vectorAdd:function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=a[d]+b[d];return c},vectorMult:function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=a[d]*b;return c},vectorLength:function(a){for(var b=0,c=0;c<a.length;c++)b+=a[c]*a[c];return Math.sqrt(b)}},f.arrayToRgb=function(a){for(var b,c="#",d=0;d<a.length;d++)b=a[d].toString(16),c+=1==b.length?"0"+b:b;return c},f.rgbToArray=function(a){return a=a.substr(1),[parseInt(a.substr(0,2),16),parseInt(a.substr(2,2),16),parseInt(a.substr(4,2),16)]}}(jQuery);