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