/*
 Highcharts JS v2.1.7 (2011-10-19)
 Exporting module

 (c) 2010-2011 Torstein H?nsi

 License: www.highcharts.com/license
*/
(function(){var h=Highcharts,u=h.Chart,z=h.addEvent,m=h.createElement,v=h.discardElement,r=h.css,p=h.merge,j=h.each,n=h.extend,A=Math.max,i=document,B=window,w=i.documentElement.ontouchstart!==void 0,s=h.getOptions();n(s.lang,{downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",exportButtonTitle:"Export to raster or vector image",printButtonTitle:"Print the chart"});s.navigation={menuStyle:{border:"1px solid #A0A0A0",
background:"#FFFFFF"},menuItemStyle:{padding:"0 5px",background:"none",color:"#303030",fontSize:w?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{align:"right",backgroundColor:{linearGradient:[0,0,0,20],stops:[[0.4,"#F7F7F7"],[0.6,"#E3E3E3"]]},borderColor:"#B0B0B0",borderRadius:3,borderWidth:1,height:20,hoverBorderColor:"#909090",hoverSymbolFill:"#81A7CF",hoverSymbolStroke:"#4572A5",symbolFill:"#E0E0E0",symbolStroke:"#A0A0A0",symbolX:11.5,symbolY:10.5,verticalAlign:"top",
width:24,y:10}};s.exporting={type:"image/png",url:"http://export.highcharts.com/",width:800,enableImages:!1,buttons:{exportButton:{symbol:"exportIcon",x:-10,symbolFill:"#A8BF77",hoverSymbolFill:"#768F3E",_id:"exportButton",_titleKey:"exportButtonTitle",menuItems:[{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",
onclick:function(){this.exportChart({type:"image/svg+xml"})}}]},printButton:{symbol:"printIcon",x:-36,symbolFill:"#B5C9DF",hoverSymbolFill:"#779ABF",_id:"printButton",_titleKey:"printButtonTitle",onclick:function(){this.print()}}}};n(u.prototype,{getSVG:function(b){var c=this,a,e,d,k,f,t,g=p(c.options,b);if(!i.createElementNS)i.createElementNS=function(a,b){var c=i.createElement(b);c.getBBox=function(){return h.Renderer.prototype.Element.prototype.getBBox.apply({element:c})};return c};b=m("div",null,
{position:"absolute",top:"-9999em",width:c.chartWidth+"px",height:c.chartHeight+"px"},i.body);n(g.chart,{renderTo:b,forExport:!0});g.exporting.enabled=!1;if(!g.exporting.enableImages)g.chart.plotBackgroundImage=null;g.series=[];j(c.series,function(a){d=a.options;d.animation=!1;d.showCheckbox=!1;d.visible=a.visible;if(!g.exporting.enableImages&&d&&d.marker&&/^url\(/.test(d.marker.symbol))d.marker.symbol="circle";d.data=[];j(a.data,function(a){k=a.config;f={x:a.x,y:a.y,name:a.name};typeof k==="object"&&
a.config&&k.constructor!==Array&&n(f,k);f.visible=a.visible;d.data.push(f);g.exporting.enableImages||(t=a.config&&a.config.marker)&&/^url\(/.test(t.symbol)&&delete t.symbol});g.series.push(d)});a=new Highcharts.Chart(g);j(["xAxis","yAxis"],function(b){j(c[b],function(c,d){var f=a[b][d],e=c.getExtremes(),g=e.userMin,e=e.userMax;(g!==void 0||e!==void 0)&&f.setExtremes(g,e,!0,!1)})});e=a.container.innerHTML;g=null;a.destroy();v(b);e=e.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,
"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/isTracker="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ href=/g," xlink:href=").replace(/&nbsp;/g,"\u00a0").replace(/&shy;/g,"\u00ad").replace(/id=([^" >]+)/g,'id="$1"').replace(/class=([^" ]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/<img ([^>]*)>/gi,"<image $1 />").replace(/<\/image>/g,"").replace(/<image ([^>]*)([^\/])>/gi,"<image $1$2 />").replace(/width=(\d+)/g,
'width="$1"').replace(/height=(\d+)/g,'height="$1"').replace(/hc-svg-href="/g,'xlink:href="').replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()});e=e.replace(/(url\(#highcharts-[0-9]+)&quot;/g,"$1").replace(/&quot;/g,"'");e.match(/ xmlns="/g).length===2&&(e=e.replace(/xmlns="[^"]+"/,""));return e},exportChart:function(b,c){var a,e=this.getSVG(c),b=p(this.options.exporting,b);a=m("form",{method:"post",action:b.url},{display:"none"},i.body);j(["filename","type","width","svg"],function(c){m("input",
{type:"hidden",name:c,value:{filename:b.filename||"chart",type:b.type,width:b.width,svg:e}[c]},null,a)});a.submit();v(a)},print:function(){var b=this,c=b.container,a=[],e=c.parentNode,d=i.body,k=d.childNodes;if(!b.isPrinting)b.isPrinting=!0,j(k,function(b,c){if(b.nodeType===1)a[c]=b.style.display,b.style.display="none"}),d.appendChild(c),B.print(),setTimeout(function(){e.appendChild(c);j(k,function(b,c){if(b.nodeType===1)b.style.display=a[c]});b.isPrinting=!1},1E3)},contextMenu:function(b,c,a,e,d,
k){var f=this,h=f.options.navigation,g=h.menuItemStyle,i=f.chartWidth,x=f.chartHeight,q="cache-"+b,l=f[q],o=A(d,k),y,p;if(!l)f[q]=l=m("div",{className:"highcharts-"+b},{position:"absolute",zIndex:1E3,padding:o+"px"},f.container),y=m("div",null,n({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},h.menuStyle),l),p=function(){r(l,{display:"none"})},z(l,"mouseleave",p),j(c,function(a){a&&(m("div",{onmouseover:function(){r(this,h.menuItemHoverStyle)},
onmouseout:function(){r(this,g)},innerHTML:a.text||f.options.lang[a.textKey]},n({cursor:"pointer"},g),y)[w?"ontouchstart":"onclick"]=function(){p();a.onclick.apply(f,arguments)})}),f.exportMenuWidth=l.offsetWidth,f.exportMenuHeight=l.offsetHeight;b={display:"block"};a+f.exportMenuWidth>i?b.right=i-a-d-o+"px":b.left=a-o+"px";e+k+f.exportMenuHeight>x?b.bottom=x-e-o+"px":b.top=e+k-o+"px";r(l,b)},addButton:function(b){function c(){m.attr(o);j.attr(l)}var a=this,e=a.renderer,d=p(a.options.navigation.buttonOptions,
b),h=d.onclick,f=d.menuItems,i=d.width,g=d.height,j,m,q,b=d.borderWidth,l={stroke:d.borderColor},o={stroke:d.symbolStroke,fill:d.symbolFill};d.enabled!==!1&&(j=e.rect(0,0,i,g,d.borderRadius,b).align(d,!0).attr(n({fill:d.backgroundColor,"stroke-width":b,zIndex:19},l)).add(),q=e.rect(0,0,i,g,0).align(d).attr({id:d._id,fill:"rgba(255, 255, 255, 0.001)",title:a.options.lang[d._titleKey],zIndex:21}).css({cursor:"pointer"}).on("mouseover",function(){m.attr({stroke:d.hoverSymbolStroke,fill:d.hoverSymbolFill});
j.attr({stroke:d.hoverBorderColor})}).on("mouseout",c).on("click",c).add(),f&&(h=function(){c();var b=q.getBBox();a.contextMenu("export-menu",f,b.x,b.y,i,g)}),q.on("click",function(){h.apply(a,arguments)}),m=e.symbol(d.symbol,d.symbolX,d.symbolY,(d.symbolSize||12)/2).align(d,!0).attr(n(o,{"stroke-width":d.symbolStrokeWidth||1,zIndex:20})).add())}});h.Renderer.prototype.symbols.exportIcon=function(b,c,a){return["M",b-a,c+a,"L",b+a,c+a,b+a,c+a*0.5,b-a,c+a*0.5,"Z","M",b,c+a*0.5,"L",b-a*0.5,c-a/3,b-a/
6,c-a/3,b-a/6,c-a,b+a/6,c-a,b+a/6,c-a/3,b+a*0.5,c-a/3,"Z"]};h.Renderer.prototype.symbols.printIcon=function(b,c,a){return["M",b-a,c+a*0.5,"L",b+a,c+a*0.5,b+a,c-a/3,b-a,c-a/3,"Z","M",b-a*0.5,c-a/3,"L",b-a*0.5,c-a,b+a*0.5,c-a,b+a*0.5,c-a/3,"Z","M",b-a*0.5,c+a*0.5,"L",b-a*0.75,c+a,b+a*0.75,c+a,b+a*0.5,c+a*0.5,"Z"]};u.prototype.callbacks.push(function(b){var c,a=b.options.exporting,e=a.buttons;if(a.enabled!==!1)for(c in e)b.addButton(e[c])})})();
