(function(D){var A,B,H,J,I,G,E,C,F;A=document.namespaces;has_canvas=document.createElement("canvas");has_canvas=has_canvas&&has_canvas.getContext;if(!(has_canvas||A)){D.fn.maphilight=function(){return this};return }if(has_canvas){E=function(M,L,K){if(L<=1){M.style.opacity=L;window.setTimeout(E,10,M,L+0.1,10)}};C=function(K){return Math.max(0,Math.min(parseInt(K,16),255))};F=function(K,L){return"rgba("+C(K.substr(0,2))+","+C(K.substr(2,2))+","+C(K.substr(4,2))+","+L+")"};B=function(K){var L=D('<canvas style="width:'+K.width+"px;height:"+K.height+'px;"></canvas>').get(0);L.getContext("2d").clearRect(0,0,L.width,L.height);return L};H=function(M,K,P,L){var O,N=M.getContext("2d");N.beginPath();if(K=="rect"){N.rect(P[0],P[1],P[2]-P[0],P[3]-P[1])}else{if(K=="poly"){N.moveTo(P[0],P[1]);for(O=2;O<P.length;O+=2){N.lineTo(P[O],P[O+1])}}else{if(K=="circ"){N.arc(P[0],P[1],P[2],0,Math.PI*2,false)}}}N.closePath();if(L.fill){N.fillStyle=F(L.fillColor,L.fillOpacity);N.fill()}if(L.stroke){N.strokeStyle=F(L.strokeColor,L.strokeOpacity);N.lineWidth=L.strokeWidth;N.stroke()}if(L.fade){E(M,0)}};J=function(K,L){K.getContext("2d").clearRect(0,0,K.width,K.height)}}else{document.createStyleSheet().addRule("v\\:*","behavior: url(#default#VML); antialias: true;");document.namespaces.add("v","urn:schemas-microsoft-com:vml");B=function(K){return D('<var style="zoom:1;overflow:hidden;display:block;width:'+K.width+"px;height:"+K.height+'px;"></var>').get(0)};H=function(N,K,O,M){var Q,P,L;Q='<v:fill color="#'+M.fillColor+'" opacity="'+(M.fill?M.fillOpacity:0)+'" />';P=(M.stroke?'strokeweight="'+M.strokeWidth+'" stroked="t" strokecolor="#'+M.strokeColor+'"':'stroked="f"');L='<v:stroke opacity="'+M.strokeOpacity+'"/>';if(K=="rect"){N.innerHTML='<v:rect filled="t" '+P+' 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;">'+Q+L+"</v:rect>"}else{if(K=="poly"){N.innerHTML='<v:shape filled="t" '+P+' coordorigin="0,0" coordsize="'+N.width+","+N.height+'" path="m '+O[0]+","+O[1]+" l "+O.join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+N.width+"px;height:"+N.height+'px;">'+Q+L+"</v:shape>"}else{if(K=="circ"){N.innerHTML='<v:oval filled="t" '+P+' 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;">'+Q+L+"</v:oval>"}}}};J=function(K){K.innerHTML=""}}I=function(L){var K,M=L.getAttribute("coords").split(",");for(K=0;K<M.length;K++){M[K]=parseFloat(M[K])}return[L.getAttribute("shape").toLowerCase().substr(0,4),M]};G={position:"absolute",left:0,top:0,padding:0};D.fn.maphilight=function(K){K=D.extend({},D.fn.maphilight.defaults,K);return this.each(function(){var M,O,P,N,L;M=D(this);O=D.metadata?D.extend({},K,M.metadata()):K;P=D('map[name="'+M.attr("usemap").substr(1)+'"]');if(!(M.is("img")&&M.attr("usemap")&&P.size()>0&&!M.hasClass("maphilighted"))){return }M.wrap(D('<span style="display:block;background:url('+this.src+");position:relative;padding:0;width:"+this.width+"px;height:"+this.height+'px"></div>'));M.css("opacity",0).css("border",0).css(G);if(D.browser.msie){M.css("filter","Alpha(opacity=0)")}N=B(this);D(N).css(G);N.height=this.height;N.width=this.width;L=function(R){var Q=I(this);H(N,Q[0],Q[1],D.metadata?D.extend({},O,D(this).metadata()):O)};if(O.alwaysOn){D(P).find("area[coords]").each(L)}else{D(P).find("area[coords]").mouseover(L).mouseout(function(Q){J(N)})}M.before(N);M.addClass("maphilighted")})};D.fn.maphilight.defaults={fill:true,fillColor:"000000",fillOpacity:0.2,stroke:true,strokeColor:"0d4694",strokeOpacity:1,strokeWidth:1,fade:true,alwaysOn:false}})(jQuery);