(function(b){var d,c,g,f,e,i,k,a,j,h;d=document.namespaces;has_canvas=document.createElement("canvas");has_canvas=has_canvas&&has_canvas.getContext;if(!(has_canvas||d)){b.fn.maphilight=function(){return this};return}if(has_canvas){k=function(n,m,l){if(m<=1){n.style.opacity=m;window.setTimeout(k,10,n,m+0.1,10)}};a=function(l){return Math.max(0,Math.min(parseInt(l,16),255))};j=function(l,m){return"rgba("+a(l.substr(0,2))+","+a(l.substr(2,2))+","+a(l.substr(4,2))+","+m+")"};c=function(l){var m=b('<canvas style="width:'+l.width+"px;height:"+l.height+'px;"></canvas>').get(0);m.getContext("2d").clearRect(0,0,m.width,m.height);return m};g=function(m,q,l,n){var o,p=m.getContext("2d");p.beginPath();if(q=="rect"){p.rect(l[0],l[1],l[2]-l[0],l[3]-l[1])}else{if(q=="poly"){p.moveTo(l[0],l[1]);for(o=2;o<l.length;o+=2){p.lineTo(l[o],l[o+1])}}else{if(q=="circ"){p.arc(l[0],l[1],l[2],0,Math.PI*2,false)}}}p.closePath();if(n.fill){p.fillStyle=j(n.fillColor,n.fillOpacity);p.fill()}if(n.stroke){p.strokeStyle=j(n.strokeColor,n.strokeOpacity);p.lineWidth=n.strokeWidth;p.stroke()}if(n.fade){k(m,0)}};f=function(l,m){l.getContext("2d").clearRect(0,0,l.width,l.height)}}else{document.createStyleSheet().addRule("v\\:*","behavior: url(#default#VML); antialias: true;");document.namespaces.add("v","urn:schemas-microsoft-com:vml");c=function(l){return b('<var style="zoom:1;overflow:hidden;display:block;width:'+l.width+"px;height:"+l.height+'px;"></var>').get(0)};g=function(p,s,l,q){var n,m,r,o;n='<v:fill color="#'+q.fillColor+'" opacity="'+(q.fill?q.fillOpacity:0)+'" />';m=(q.stroke?'strokeweight="'+q.strokeWidth+'" stroked="t" strokecolor="#'+q.strokeColor+'"':'stroked="f"');r='<v:stroke opacity="'+q.strokeOpacity+'"/>';if(s=="rect"){o=b('<v:rect filled="t" '+m+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+l[0]+"px;top:"+l[1]+"px;width:"+(l[2]-l[0])+"px;height:"+(l[3]-l[1])+'px;"></v:rect>')}else{if(s=="poly"){o=b('<v:shape filled="t" '+m+' coordorigin="0,0" coordsize="'+p.width+","+p.height+'" path="m '+l[0]+","+l[1]+" l "+l.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;"></v:shape>')}else{if(s=="circ"){o=b('<v:oval filled="t" '+m+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(l[0]-l[2])+"px;top:"+(l[1]-l[2])+"px;width:"+(l[2]*2)+"px;height:"+(l[2]*2)+'px;"></v:oval>')}}}o.get(0).innerHTML=n+r;b(p).append(o)};f=function(l){b(l).empty()}}e=function(m){var n,l=m.getAttribute("coords").split(",");for(n=0;n<l.length;n++){l[n]=parseFloat(l[n])}return[m.getAttribute("shape").toLowerCase().substr(0,4),l]};h=function(l){if(!l.complete){return false}if(typeof l.naturalWidth!="undefined"&&l.naturalWidth==0){return false}return true};i={position:"absolute",left:0,top:0,padding:0,border:0};b.fn.maphilight=function(l){l=b.extend({},b.fn.maphilight.defaults,l);return this.each(function(){var q,n,o,m,p,r;q=b(this);if(!h(this)){return window.setTimeout(function(){q.maphilight()},200)}o=b.metadata?b.extend({},l,q.metadata()):l;m=b('map[name="'+q.attr("usemap").substr(1)+'"]');if(!(q.is("img")&&q.attr("usemap")&&m.size()>0&&!q.hasClass("maphilighted"))){return}n=b("<div>").css({display:"block",background:"url("+this.src+")",position:"relative",padding:0,width:this.width,height:this.height});q.before(n).css("opacity",0).css(i).remove();if(b.browser.msie){q.css("filter","Alpha(opacity=0)")}n.append(q);p=c(this);b(p).css(i);p.height=this.height;p.width=this.width;r=function(s){var t=e(this);g(p,t[0],t[1],b.metadata?b.extend({},o,b(this).metadata()):o)};if(o.alwaysOn){b(m).find("area[coords]").each(r)}else{b(m).find("area[coords]").mouseover(r).mouseout(function(s){f(p)})}q.before(p);q.addClass("maphilighted")})};b.fn.maphilight.defaults={fill:true,fillColor:"000000",fillOpacity:0.2,stroke:true,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,fade:true,alwaysOn:false}})(jQuery);