function TableToDataArrayCustom(n){for(var u=[],h=$("tr",n),a=h.length,c=0,o,f,l,e,t,r,s,i=0;i<a;i++)for(u[i]=[],o=$("td, th",h[i]),t=0;t<o.length;t++)f=$(o[t]),l={text:f.text()||"",colspan:f.attr("colspan")||1,rowspan:f.attr("rowspan")||1},u[i][t]=l,c=Math.max(c,t);for(i=0;i<u.length;i++)for(e=u[i],t=0;t<e.length;t++)r=e[t],r&&r.colspan>1&&e.splice(t+1,0,{text:"",colspan:r.colspan-1,rowspan:r.rowspan}),r&&r.rowspan>1&&(s=u[i+1],s&&s.splice(t,0,{text:"",colspan:1,rowspan:r.rowspan-1}));return u}var annualProfile=annualProfile||{},InfometricsPortal;annualProfile.settings=annualProfile.settings||{};annualProfile.settings.chartTitleSize=25;annualProfile.settings.defaultTopOffset=5;annualProfile.settings.defaultLeftOffset=40;annualProfile.settings.chartBottomMargin=20;annualProfile.settings.sectionErrorHtml='<p class="ui-state-error pad ui-corner-all">There was an error loading the content for this section, please let us know so we can fix it<\/p>';annualProfile.settings.graphErrorHtml='<p class="ui-state-error pad ui-corner-all">There was an error loading the data for this graph, please let us know so we can fix it<\/p>';annualProfile=annualProfile||{};annualProfile.charting=annualProfile.charting||{};Highcharts.setOptions({lang:{thousandsSep:","}});annualProfile.initiliseCharts=function(n){function u(n,t){var u=n.attr(o),e;if(u){var r=ti(u),i=ct(r,n,u),f=u.split("-")[1];f||r[0]==="pie"||(i.infometrics.isPercentageValues=!0,n.attr(nt,"true"));bt(i,n,r[0]);gt(i,t,r,n);at(i,n);dt(i,t,r[0],n);vt(i,n,r[0],t);kt(i,n,r[0],t);lt(i,n);ht(i,n);e=new Highcharts.Chart(i);n.attr(k,!0);ri(n);pubsub.pub("chart-updated",n,t)}}function ht(n){n.series[0].data.length>20&&(n.plotOptions.series.pointPadding=.1,n.plotOptions.series.groupPadding=.1)}function ct(t,r,u){var e=r.attr(ut)||n.textColor||"rgba(0, 0, 0, 0.7)",f={chart:{renderTo:r[0],spacingRight:7,spacingLeft:0,spacingTop:10,spacingBottom:10,backgroundColor:r.attr(it)||"#FFFFFF"},legend:{},title:{text:null,align:"left",style:{color:"#ee6300",fontFamily:'"Khand","Arial Narrow","Arial",sans-serif',fontSize:n.titleFontSize?n.titleFontSize+"px":"18px",fontWeight:"normal",whiteSpace:"nowrap"},margin:2,y:n.titleFontSize||18},subtitle:{text:null,align:"left",style:{color:"black",fontFamily:"Arial,sans-serif",fontSize:"10px",fontWeight:"normal",whiteSpace:"nowrap"},y:n.titleFontSize?n.titleFontSize+11:29},xAxis:{lineWidth:0,tickWidth:1,tickColor:e,tickLength:5,tickmarkPlacement:"on",startOnTick:!1,showLastLabel:!0},yAxis:[],series:[],credits:{enabled:!1,href:"http://www.infometrics.co.nz",position:{align:"left",verticalAlign:"top",x:0,y:8},text:"Infometrics Ltd",style:{}},plotOptions:{series:{pointPadding:.1,groupPadding:.05,borderWidth:0,shadow:!1,lineWidth:n.lineWidth||2,marker:{enabled:!1},turboThreshold:0},column:{},scatter:{marker:{radius:5,states:{hover:{enabled:!0,lineColor:"rgb(100,100,100)"}}},lineWidth:0}},infometrics:{textColor:e,SeriesTypes:t,isPercentageValues:!1,timeSeries:{isTurpleTimeSeries:!1,minMonth:null,months:[]}}},o;return r.attr(i)&&(f.legend.width=r.attr(i)),o=r.attr("data-stack"),(o||u&&u.indexOf("stack")!==-1)&&(f.plotOptions.column.stacking=!0,f.plotOptions.series=f.plotOptions.series||{},f.plotOptions.series.stacking="normal"),t.length===1&&(f.chart.type=t[0]),n&&n.disableAnimation&&(f.plotOptions.series.animation=!1),t[0]==="pie"&&(f.plotOptions.pie={size:"100%",innerSize:"50%",showInLegend:!0,center:["50%","50%"],dataLabels:{enabled:!0,formatter:function(){var n=this.percentage/100*r.height();return n<10?"":(Math.round(this.percentage*10)/10+"%").replace(".0%","%")},distance:-20,style:{color:"white",fontFamily:"UniversLTW01-59UltraCn, Arial",textShadow:"none"}},point:{events:{legendItemClick:function(n){return n.preventDefault(),!1}}}},f.chart.marginTop=0,f.chart.marginLeft=0,f.chart.marginBottom=0,f.chart.spacingTop=0,f.chart.spacingBottom=0),f}function lt(t,i){var r=i.attr(d),e=i.attr(g)||n.labelFontSize,o,u,f;r&&(o=r==="true"?"":r,t.plotOptions=t.plotOptions||{},t.plotOptions.column=t.plotOptions.column||{},t.plotOptions.bar=t.plotOptions.bar||{},u={crop:!1,overflow:"justify",enabled:!0,inside:!1,style:{color:"#262626",fontSize:"10px",fontFamily:"UniversLTW01-59UltraCn, Arial",textShadow:"none"},padding:0,borderWidth:1,borderColor:"transparent",verticalAlign:"top",formatter:function(){return t.infometrics.isPercentageValues?this.y.toFixed(1)+"%":o+this.y.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}},t.plotOptions.column.dataLabels=u,f=$.extend({},u,{verticalAlign:"middle",align:"right"}),f.style.fontSize=e?e+"px":"15px",t.plotOptions.bar.dataLabels=f)}function at(t,i){function r(n){var i=window.location.href.toString().split(window.location.host)[1].split("/")[1].toUpperCase(),t=f.exporting.filename;try{t=decodeURIComponent(t);i=decodeURIComponent(i)}catch(r){}ga("send","event","Download-Chart",i+"-"+t,n+"-"+t)}var u=i.attr(s),f=t;t.exporting=u||n.disableExport?{enabled:!1}:{enabled:!0,scale:10,buttons:{contextButton:{menuItems:[{text:"Print",onclick:function(){r("Print");this.print()}},{separator:!0},{text:"download as Jpeg",onclick:function(){r("JPEG");this.exportChart({type:"image/jpeg"})}},{text:"download as pdf",onclick:function(){r("PDF");this.exportChart({type:"application/pdf"})}},{text:"download as Svg",onclick:function(){r("SVG");this.exportChart({type:"image/svg+xml"})}},{text:"download data as csv",onclick:function(){r("CSV");ii(this.container)}}]}}}}function vt(t,i,u,e){var l=i.attr("data-show-text-every"),c,h,d,g,a,y,o,s,w,b,k,v,nt;if(l=l?parseInt(l):1,t.xAxis.labels={autoRotation:!1,formatter:yt,padding:10},t.xAxis.tickInterval=l||t.infometrics.timeSeries.months.length||1,pt(t),c=t.infometrics.textColor,h=1,t.yAxis=[{gridLineWidth:n.gridLineWidth||1,gridLineColor:c,lineColor:c,lineWidth:1,maxPadding:0,endOnTick:!0,tickInterval:null,gridLineDashStyle:"ShortDot",labels:{},plotLines:[{color:c,width:2,value:0}]}],u!=="pie"&&(d=i.attr(p),g=i.attr(ft),d&&t.series[1]&&(t.yAxis[1]={gridLineWidth:0,lineColor:c,lineWidth:1,maxPadding:.1,opposite:!0,title:{text:null},labels:{}},t.series[0].yAxis=0,t.series[1].yAxis=1,t.series[1].name=t.series[1].name+" (RHS)",h=2)),!t.infometrics.isPercentageValues&&(u==="bar"||u==="column")&&ni(t))for(o=0;o<h;o++)t.yAxis[o].min=0;else if(t.infometrics.isPercentageValues)for(t.tooltip={formatter:ot},a=0;a<h;a++)t.yAxis[a].labels={formatter:et};else u==="pie"&&(t.tooltip={formatter:st});if(i.attr(r))for(y=0;y<h;y++);if(g)for(o=0;o<h;o++)t.yAxis[o].min=0;if(u==="bar")for(s=0;s<t.series.length;s++)t.series[s].index=t.series.length-1-s,t.series[s].legendIndex=s;if(e.forecastStartAfter&&(w=t.xAxis.categories.indexOf(e.forecastStartAfter.toString()),!isNaN(e.forecastStartAfter)&&e.forecastStartAfter<1e3?f(e.forecastStartAfter,t):w!==-1&&f(w,t,e.forecastLineText,e.forecastXpos,e.forecastYpos)),b=i.attr(tt),b)for(k=b.split(","),v=0;v<k.length;v++)nt=parseInt(k[v]),f(nt,t)}function f(t,i,r,u,f){r=r||"Forecast";t&&t!==-1&&t!==i.xAxis.categories.length-1&&t!==NaN&&(i.chart.type==="column"&&(t=t+.5),i.xAxis.plotLines=i.xAxis.plotLines||[],i.xAxis.plotLines.push({color:"black",dashStyle:"Dash",value:t,width:1,zIndex:99,label:{style:{fontSize:n.forecastFontSize||"12px",fontWeight:"bold",zIndex:"99",textAlign:"left"},align:"right",text:r,rotation:0,x:u==undefined||u==""?70:u,y:f==undefined||f==""?20:f}}))}function yt(){var n=this.value,i=this.chart.options.infometrics.timeSeries,t;return i.isTurpleTimeSeries?(t=l(n),t[0]):n}function pt(n){var t=n.xAxis.categories,r,u,f,i;if(n.infometrics.timeSeries.isTurpleTimeSeries=wt(t[0]),t&&t.length>20&&n.infometrics.timeSeries.isTurpleTimeSeries){for(r=[],u=12,f=0;f<t.length;f++)if(i=l(t[f])[1],i<u&&(u=i),$.inArray(i,r)!==-1)break;else r.push(i);n.infometrics.timeSeries.minMonth=u;n.infometrics.timeSeries.months=r;n.xAxis.tickInterval=4}}function l(n){return n.replace(/[()]/g,"").split(",").map(function(n){return parseInt(n.trim())})}function wt(n){return/^\([0-9]{4}[,\s]+[0-9]{1,2}\)$/.test(n)}function bt(t,i,r){var u=["#EC8004","#F09936","#F4B368","#003352","#4D7086","#8099A8","#CCD6DC","#6B8F00","#A6BC66","#E1E9CC"],f,o,s,e;if(r!=="pie"&&(u[0]=n&&n.primaryColor?n.primaryColor:"#EC8004",u[1]=n&&n.seccondaryColor?n.seccondaryColor:"#6B8F00"),n.colours&&n.colours.length)for(f=0;f<n.colours.length;f++)u[f]=n.colours[f];if(o=i.attr(y),o)for(s=o.split(","),e=0;e<s.length;e++)u[e]=s[e];t.colors=u}function kt(t,i,r,u){var d=i.attr(h),g={margin:5,style:{fontFamily:"Arial",fontWeight:"normal",fontSize:"12px"}},s=i.attr(v),e=i.parent("section"),o,p,l,f,k,a,y;if(i.attr(c)=="true"&&(e=i.parent("div")),s||s===""||(s=u.dataAxisTitle),g.text=s?s:null,i.attr("data-disable-title")||(o=i.attr(w),p=u.title,o||p?(l=o||o===""?o:p,i.attr(c)=="true"?(f=$("h3",e),f.length===0&&(f=$("<h3/>"),e.prepend(f)),f.html(l)):e.length===1?(f=$("h1",e),f.length===0&&(f=$("<h1/>"),e.prepend(f)),f.html(l)):o!==""&&(t.title.text=l),t.exporting.filename=l):i.siblings("h1, h2","h3").length===1&&(t.exporting.filename=i.siblings("h1, h2","h3").html()),k=i.attr(b),k&&(t.subtitle.text=k)),a=t.yAxis,a[0].title=g,r!=="pie")for(y=0;y<a.length;y++)a[y].labels.style={fontSize:d||n.axisFontSize||"9px",fontFamily:"Arial",color:t.infometrics.textColor};t.xAxis.labels.style={fontSize:d||n.axisFontSize||"9px",fontFamily:"Arial",color:t.infometrics.textColor,textOverflow:"none"};(r==="column"||r==="spline")&&u&&u.data&&u.data.length>5&&u.data[1][0]&&u.data[1][0].length>2&&(t.xAxis.labels.rotation=-45);t.legend.enabled&&t.title.text&&(r==="spline"||r==="column")&&(t.chart.marginTop=47,t.legend.y=7,t.subtitle.text&&(t.chart.marginTop=t.chart.marginTop+15,t.legend.y=t.legend.y+15))}function dt(t,r,u,f){if(t.legend.enabled=r.data[0].length>2||u!=="bar"&&u!=="column",t.legend.itemStyle={fontSize:f.attr(h)||n.legendFontSize||"9px",fontWeight:"normal",fontFamily:"Arial",color:t.infometrics.textColor},u==="pie"){t.legend.align="right";t.legend.verticalAlign="top";t.legend.layout="vertical";var e=Math.round(f.width()*(f.attr(i)?f.attr(i):.4));t.legend.width=e;t.legend.itemStyle.width=e-30;t.legend.margin=0;f.attr(s)||(t.legend.y=20)}else t.legend.align="center",t.legend.verticalAlign="top";t.legend.floating=f.attr(rt)||!1;t.legend.itemDistance=2;t.legend.symbolHeight=8}function gt(n,t,i){for(var c=[],e,f,s,r,l,h,o,u=1;u<t.data[0].length;u++){for(e={name:t.data[0][u],data:[],zIndex:10-u},i.length>1&&(e.type=i[u-1]||i[i.length-1]),f=1;f<t.data.length;f++){if(s=t.data[f][0],r=t.data[f][u],r||r===0?n.infometrics.isPercentageValues&&(r=Math.round(r*1e4)/100):r=null,e.type&&e.type==="scatter"){r!==null&&e.data.push([f,r]);continue}l={name:s,y:r};e.data[f-1]=l;c[f-1]=s}n.series[u-1]=e}if(n.xAxis.categories=c,t.isCompareChart)for(h=n.series[0].data,o=0;o<h.length;o++)h[o].color=n.colors[o]}function ni(n){var f=!0,i,t,r,u;if(n.series&&n.series.length)for(i=0;i<n.series.length;i++)if(t=n.series[i],t&&t.data&&t.data.length)for(r=0;r<t.data.length;r++)u=t.data[r],u&&u.y&&u.y<0&&(f=!1);return f}function e(n){n&&setTimeout(function(){n()})}function ti(n){for(var r=[],i=n.split("-")[0].split("."),t=0;t<i.length;t++)r[t]=i[t]==="donut"?"pie":i[t]==="line"?"spline":i[t]==="stacked"?"column":i[t];return r}function ii(i){var f=$(i).closest("figure"),e=f.siblings("h1"),o="Chart-Data",r,u,s,h;e.length===1&&(o=e.text().replace(/\s/g,"_"));f.length===1&&(r=f.attr("data-all-data"),r||(r=f.attr(t)),r&&(u=JSON.parse(r),u&&(s=annualProfile.chartDataArrayToCsv(u.data?u.data:u),h=n.csvDownloadUrl,annualProfile.echoCsvStringAsDownload(s,h,o))))}function ri(){for(var i=document.querySelectorAll("text tspan"),n,t=0;t<i.length;t++)n=i[t].innerHTML,n===undefined?(n=i[t].textContent,n=n.replace(/\u00E2\u20AC\u00A6/g,"…"),i[t].textContent=n):(n=n.replace(/\u00E2\u20AC\u00A6/g,"&#x2026;"),i[t].innerHTML=n)}n=n||{};var a="data-json-url",t="data-chart-data",o="data-chart-type",v="data-axis-title",y="data-color",p="data-duel-axis",w="data-chart-title",b="data-chart-subtitle",k="data-chart-rendered",r="data-format",s="data-disable-menu",d="data-label-bars",g="data-label-size",nt="data-is-percentage",tt="data-x-grid",it="data-background-color",h="data-font-size",rt="data-float-legend",i="data-legend-size",ut="data-text-color",ft="data-y-zero",c="data-infographic-title",et=function(){return this.value+"%"},ot=function(){var n=this.y+"%";return this.x+'<br/><span style="color:'+this.series.color+'">●<\/span> '+this.series.name+": <b>"+n+"<\/b><br/>"},st=function(){var n=this.percentage.toFixed(1)+"%";return"<b><span>●<\/span> "+this.series.name+"<\/b><br />"+this.key+": "+n};annualProfile.charting.drawHardCodedCharts=function(n,i){for(var h=$("figure["+o+"]["+t+"]",n).not("[data-json-url]"),s,r,f=0;f<h.length;f++){s=$(h[f]);try{r=JSON.parse(s.attr(t));r&&r.data&&r.data.length&&r.data.length>1&&u(s,r)}catch(c){}}e(i)};annualProfile.charting.drawHardCodedCharts();annualProfile.charting.drawOrUpdate=function(n,i,r){var f=n.attr(a);f?$.ajax(f,{data:r,traditional:!0,type:"POST",dataType:"json",success:function(r){n.attr(t,JSON.stringify(r));u(n,r);i&&e(i)}}):(r&&r.data&&u(n,r),i&&e(i))}},function(n){typeof module=="object"&&module.exports?module.exports=n:n(Highcharts)}(function(n){var l=n.Chart,e=n.addEvent,a=n.removeEvent,v=n.fireEvent,r=n.createElement,s=n.discardElement,o=n.css,u=n.merge,t=n.each,i=n.extend,p=n.splat,w=Math.max,f=document,y=window,b=n.isTouchDevice,k=n.Renderer.prototype.symbols,h=n.getOptions(),c;i(h.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});h.navigation={menuStyle:{border:"1px solid #A0A0A0",background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:"none",color:"#303030",fontSize:b?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{symbolFill:"#E0E0E0",symbolSize:14,symbolStroke:"#666",symbolStrokeWidth:3,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,theme:{fill:"white",stroke:"none"},verticalAlign:"top",width:24}};h.exporting={type:"image/png",url:"http://export.highcharts.com/",buttons:{contextButton:{menuClassName:"highcharts-contextmenu",symbol:"menu",_titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{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"})}}]}}};n.post=function(n,t,i){var e,n=r("form",u({method:"post",action:n,enctype:"multipart/form-data"},i),{display:"none"},f.body);for(e in t)r("input",{type:"hidden",name:e,value:t[e]},null,n);n.submit();s(n)};i(l.prototype,{sanitizeSVG:function(n){return n.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ (NS[0-9]+\:)?href=/g," xlink:href=").replace(/\n/," ").replace(/<\/svg>.*?$/,"<\/svg>").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1="rgb($2)" $1-opacity="$3"').replace(/&nbsp;/g," ").replace(/&shy;/g,"­").replace(/<IMG /g,"<image ").replace(/<(\/?)TITLE>/g,"<$1title>").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g,'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/ id=([^" >]+)/g,' id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(n){return n.toLowerCase()})},getChartHTML:function(){return this.container.innerHTML},getSVG:function(e){var c=this,v,l,h,y,a,o=u(c.options,e),w=o.exporting.allowHTML;return f.createElementNS||(f.createElementNS=function(n,t){return f.createElement(t)}),l=r("div",null,{position:"absolute",top:"-9999em",width:c.chartWidth+"px",height:c.chartHeight+"px"},f.body),h=c.renderTo.style.width,a=c.renderTo.style.height,h=o.exporting.sourceWidth||o.chart.width||/px$/.test(h)&&parseInt(h,10)||600,a=o.exporting.sourceHeight||o.chart.height||/px$/.test(a)&&parseInt(a,10)||400,i(o.chart,{animation:!1,renderTo:l,forExport:!0,renderer:"SVGRenderer",width:h,height:a}),o.exporting.enabled=!1,delete o.data,o.series=[],t(c.series,function(n){y=u(n.options,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:n.visible});y.isInternal||o.series.push(y)}),e&&t(["xAxis","yAxis"],function(n){t(p(e[n]),function(t,i){o[n][i]=u(o[n][i],t)})}),v=new n.Chart(o,c.callback),t(["xAxis","yAxis"],function(n){t(c[n],function(t,i){var u=v[n][i],r=t.getExtremes(),f=r.userMin,r=r.userMax;u&&(f!==void 0||r!==void 0)&&u.setExtremes(f,r,!0,!1)})}),h=v.getChartHTML(),o=null,v.destroy(),s(l),w&&(l=h.match(/<\/svg>(.*?$)/))&&(l='<foreignObject x="0" y="0" width="200" height="200"><body xmlns="http://www.w3.org/1999/xhtml">'+l[1]+"<\/body><\/foreignObject>",h=h.replace("<\/svg>",l+"<\/svg>")),h=this.sanitizeSVG(h),h.replace(/(url\(#highcharts-[0-9]+)&quot;/g,"$1").replace(/&quot;/g,"'")},getSVGForExport:function(n,t){var i=this.options.exporting;return this.getSVG(u({chart:{borderRadius:0}},i.chartOptions,t,{exporting:{sourceWidth:n&&n.sourceWidth||i.sourceWidth,sourceHeight:n&&n.sourceHeight||i.sourceHeight}}))},exportChart:function(t,i){var r=this.getSVGForExport(t,i),t=u(this.options.exporting,t);n.post(t.url,{filename:t.filename||"chart",type:t.type,width:t.width||0,scale:t.scale||2,svg:r},t.formAttributes)},print:function(){var n=this,i=n.container,r=[],o=i.parentNode,u=f.body,e=u.childNodes;n.isPrinting||(n.isPrinting=!0,n.pointer.reset(null,0),v(n,"beforePrint"),t(e,function(n,t){n.nodeType===1&&(r[t]=n.style.display,n.style.display="none")}),u.appendChild(i),y.focus(),y.print(),setTimeout(function(){o.appendChild(i);t(e,function(n,t){n.nodeType===1&&(n.style.display=r[t])});n.isPrinting=!1;v(n,"afterPrint")},1e3))},contextMenu:function(n,u,f,s,h,c,l){var v=this,d=v.options.navigation,g=d.menuItemStyle,nt=v.chartWidth,tt=v.chartHeight,it="cache-"+n,y=v[it],p=w(h,c),b,k,rt,ut=function(t){v.pointer.inClass(t.target,n)||k()};y||(v[it]=y=r("div",{className:n},{position:"absolute",zIndex:1e3,padding:p+"px"},v.container),b=r("div",null,i({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},d.menuStyle),y),k=function(){o(y,{display:"none"});l&&l.setState(0);v.openMenu=!1},e(y,"mouseleave",function(){rt=setTimeout(k,500)}),e(y,"mouseenter",function(){clearTimeout(rt)}),e(document,"mouseup",ut),e(v,"destroy",function(){a(document,"mouseup",ut)}),t(u,function(n){if(n){var t=n.separator?r("hr",null,null,b):r("div",{onmouseover:function(){o(this,d.menuItemHoverStyle)},onmouseout:function(){o(this,g)},onclick:function(t){t&&t.stopPropagation();k();n.onclick&&n.onclick.apply(v,arguments)},innerHTML:n.text||v.options.lang[n.textKey]},i({cursor:"pointer"},g),b);v.exportDivElements.push(t)}}),v.exportDivElements.push(b,y),v.exportMenuWidth=y.offsetWidth,v.exportMenuHeight=y.offsetHeight);u={display:"block"};f+v.exportMenuWidth>nt?u.right=nt-f-h-p+"px":u.left=f-p+"px";s+c+v.exportMenuHeight>tt&&l.alignOptions.verticalAlign!=="top"?u.bottom=tt-s-p+"px":u.top=s+c-p+"px";o(y,u);v.openMenu=!0},addButton:function(t){var e=this,a=e.renderer,r=u(e.options.navigation.buttonOptions,t),v=r.onclick,y=r.menuItems,p,f,w={stroke:r.symbolStroke,fill:r.symbolFill},h=r.symbolSize||12;if(e.btnCount||(e.btnCount=0),e.exportDivElements||(e.exportDivElements=[],e.exportSVGElements=[]),r.enabled!==!1){var o=r.theme,s=o.states,b=s&&s.hover,s=s&&s.select,l;delete o.states;v?l=function(n){n.stopPropagation();v.call(e,n)}:y&&(l=function(){e.contextMenu(f.menuClassName,y,f.translateX,f.translateY,f.width,f.height,f);f.setState(2)});r.text&&r.symbol?o.paddingLeft=n.pick(o.paddingLeft,25):r.text||i(o,{width:r.width,height:r.height,padding:0});f=a.button(r.text,0,0,l,o,b,s).attr({title:e.options.lang[r._titleKey],"stroke-linecap":"round"});f.menuClassName=t.menuClassName||"highcharts-menu-"+e.btnCount++;r.symbol&&(p=a.symbol(r.symbol,r.symbolX-h/2,r.symbolY-h/2,h,h).attr(i(w,{"stroke-width":r.symbolStrokeWidth||1,zIndex:1})).add(f));f.add().align(i(r,{width:f.width,x:n.pick(r.x,c)}),!0,"spacingBox");c+=(f.width+r.buttonSpacing)*(r.align==="right"?-1:1);e.exportSVGElements.push(f,p)}},destroyExport:function(n){for(var n=n.target,t,i=0;i<n.exportSVGElements.length;i++)(t=n.exportSVGElements[i])&&(t.onclick=t.ontouchstart=null,n.exportSVGElements[i]=t.destroy());for(i=0;i<n.exportDivElements.length;i++)t=n.exportDivElements[i],a(t,"mouseleave"),n.exportDivElements[i]=t.onmouseout=t.onmouseover=t.ontouchstart=t.onclick=null,s(t)}});k.menu=function(n,t,i,r){return["M",n,t+2.5,"L",n+i,t+2.5,"M",n,t+r/2+.5,"L",n+i,t+r/2+.5,"M",n,t+r-1.5,"L",n+i,t+r-1.5]};l.prototype.callbacks.push(function(n){var t,i=n.options.exporting,r=i.buttons;if(c=0,i.enabled!==!1){for(t in r)n.addButton(r[t]);e(n,"destroy",n.destroyExport)}})});var pubsubCache={},pubsubHistory={},pubsub={pub:function(n){var i,t;for(pubsubHistory[n]=arguments,i=[].slice.call(arguments,1),pubsubCache[n]||(pubsubCache[n]=[]),t=0;t<pubsubCache[n].length;t++)pubsubCache[n][t].apply(null,i)},sub:function(n,t){pubsubCache[n]?pubsubCache[n].push(t):pubsubCache[n]=[t]},subWithHistory:function(n,t){pubsub.sub(n,t);pubsubHistory[n]&&t.apply(null,[].slice.call(pubsubHistory[n],1))}},annualProfile=annualProfile||{};annualProfile.reorderTable=function(n){var t=$(n),f=t.closest("table"),r=$("tbody",f),e=t.attr("data-sort-id"),o=$("tr",r),i,u;o.sort(function(n,t){var h=$("td[data-sort-id="+e+"]",n),c=$("td[data-sort-id="+e+"]",t),u=h.attr("data-sort-value"),f=c.attr("data-sort-value");if(u&&f&&!isNaN(parseFloat(u))&&!isNaN(parseFloat(f)))return parseFloat(u)<parseFloat(f)?1:-1;var l=/[,\s\n%$m]/g,o=h.text(),s=c.text(),i=o.replace(l,""),r=s.replace(l,""),a=!isNaN(i)&&!isNaN(r);if(a){if(i=Number(i),r=Number(r),i<r)return 1;if(i>r)return-1}return o<s?1:o>s?-1:0});i=t.attr("data-sorted-asc");u=i!==undefined&&i!==!1&&i!=="false";$("th",f).removeAttr("data-sorted-asc");u?t.attr("data-sorted-asc",!1):t.attr("data-sorted-asc",!0);$.each(o,function(n,t){u?r.append(t):r.prepend(t)})};annualProfile.getFileDownloadName=function(n){var i="table-data",r=n.closest("section"),t;return r.length===1&&(t=$("h1",r),t.length===1&&t.text()&&(i=t.text().trim().replace(/\s/g,"_"))),i};annualProfile.SetUpDownloads=function(){$("body > article").on("click",'input[class="table-export"]',function(){var n=$(this),t=n.siblings("table").first(),u=n.attr("data-post-url"),i,r;t.length===1?(i=annualProfile.getFileDownloadName(n),r=t.table2CSV(),annualProfile.echoCsvStringAsDownload(r,u,i)):alert("We area sorry, something went wrong.  Please contact us for a copy of the data and so we can fix the issue for other users.")});annualProfile.echoCsvStringAsDownload=function(n,t,i){var r=$('<form method="post" action="'+t+'"><input type="hidden" name="csv" /><\/input><input type="hidden" name="fileName" value="'+i+'" /><\/input><\/form>').appendTo("body");$("input[name=csv]",r).val(n);r.submit()};var n=function(n,t){var i=$('<form method="post" action="'+t+'"><input type="hidden" name="svgFileContents" /><\/input><\/form>').appendTo("body");$("input",i).val(n);i.submit()};annualProfile.chartDataArrayToCsv=function(n){for(var t="",r,i=0;i<n.length;i++){for(r=0;r<n[i].length;r++)t=t+'"'+n[i][r]+'",';t=t.slice(0,t.length-1);t=t+"\n"}return t};$("body > article").on("click",'input[class="chart-export-image"]',function(t){var i=$(this),f=i.siblings("figure").find("svg"),r,u;if(!Modernizr.svg){alert("Unfortunately your browser doesn't support the features necessary to parse this interactive chart as an image.  We suggest using alt+print screen.");return}r=f[0].parentNode.innerHTML;t.stopPropagation();u=i.attr("data-post-url");n(r,u)})};jQuery.fn.table2CSV=function(){for(var n="",e=/[\n]/g,f=TableToDataArrayCustom(this),r,i,u,t=0;t<f.length;t++){for(r=f[t],i=0;i<r.length;i++)u=r[i],u&&(n=n+'"'+u.text.replace(e,"").replace(/[\s]{2,}/g,"")+'",');n=n.slice(0,n.length-1);n=n+"\n"}return n};annualProfile=annualProfile||{};annualProfile.getPageLevel=function(){var n={};return $("select[name]:not(section select)").each(function(){annualProfile.bindSelect(this,n)}),n};annualProfile.bindSelect=function(n,t){var u=$(n),i=u.attr("name"),r=u.val(),e,f;isNaN(r)||(r=parseInt(r));t[i]?t[i].push?t[i].push(r):(e=t[i],t[i]=[e,r]):t[i]=r;f=$("option:selected",u);f.length===1&&$.each(f[0].attributes,function(n,i){if(i.name.indexOf("data-")===0){var r=i.name.split("-")[1],u=i.value;t[r]=u}})};annualProfile.updateSection=function(n,t){var u=$('img[src$=".gif"]',n),i,r;if($("select[name]",n).each(function(){annualProfile.bindSelect(this,t)}),i=n.attr("data-url"),i){annualProfile.loadWholeSection(u,n,i,t);return}r=$("figure[data-json-url]",n);r.length>0&&annualProfile.loadCharts(r,u,t)};annualProfile.loadCharts=function(n,t,i){t.show();n.each(function(){annualProfile.charting.drawOrUpdate($(this),function(){t.hide()},i)})};annualProfile.loadWholeSection=function(n,t,i,r,u){n&&n.show();var f;r&&(f=$.param(r,!0));t.load(i,f,function(i,r,f){r=="error"?f&&f.status&&f.status===401?(t.parents("a").hide(),t.hide()):annualProfile.pageIsUnloading||t.html(annualProfile.settings.sectionErrorHtml):(pubsub.pub("SectionUpdated",t),t.effect("highlight",1e3));n&&n.hide();u&&setTimeout(u)})};annualProfile.setUpInterfaces=function(){$(".content-container").on("click",'section nav input[type="button"][value="Update"]',function(n){var t=$(this).closest("section"),i=annualProfile.getPageLevel();annualProfile.updateSection(t,i);n.stopPropagation()});$(".content-container > nav").on("click",'input[type="button"][value="Update"]',function(){var t=annualProfile.getPageLevel(),n;t.length!==0&&(n=$(this).siblings('img[src$=".gif"]'),n.show(),annualProfile.updateContentSectionsAndGraphs(t,function(){n.hide()},!0))})};annualProfile.setUpCompareYearInterfaces=function(){function n(n,t){var u=parseInt(n.val()),i,r;for($("option",t).each(function(){var n=parseInt($(this).val());(!i||n<i)&&(i=n)}),t.html(""),u<=i&&(u=i+1),r=i;r<u;r++)r<u&&t.append('<option value="'+r+'">'+r+"<\/option>")}$("[data-year]").each(function(n,t){var i=t.getAttribute("data-year");$("select[name=year]",t).each(function(n,t){$("option",t).each(function(n,r){var u=r.getAttribute("value");!isNaN(u)&&parseInt(u)<i&&t.removeChild(r)})})});$("body").on("change","select[name=year]",function(){var r=$(this),i=r.siblings("select[name=baseYear]");i.length===0&&(i=t(r));i.length===1&&n(r,i)});var t=function(n){var t=n.parent("td"),i,u,r;return t.length!=1?(i=n.siblings("select[name=baseYear]"),i.length===1)?i:[]:(u=t.index(),r=t.parent("tr").siblings("tr").children("td").eq(u).children("select[name=baseYear]"),r.length!=1)?[]:r}};pubsub.sub("SectionUpdated",function(n){var t=$("td.area, th.area",n),i=$("td.compareArea, th.compareArea",n),u,r;t.length===1&&i.length===1&&t.attr("colspan")===i.attr("colspan")&&(u=t.width()+i.width(),r=u/2,t.width(r),i.width(r))}),function(){annualProfile.linkedCharts=$("[data-linked-chart]");annualProfile.linkedCharts.length>0&&pubsub.subWithHistory("chart-updated",function(n,t){var i=n.attr("id");i&&$("[data-linked-chart="+i+"]").html(t.title)})}();annualProfile=annualProfile||{};annualProfile.$wrapper=$("body > article");annualProfile.$uiControlls=$("nav input, nav select",annualProfile.$wrapper);annualProfile.$uiControlls.attr("disabled","disabled");annualProfile.setUpSmartLinks=function(n){if($("#topics a, .site-map-group.sections a, #cssmenu a, .forecast-wrap > nav.bottom a, .forecast-wrap > nav.right a").each(function(){var n=$(this).attr("href");n==window.location.pathname&&$(this).addClass("current-link")}),n){var i=window.location.pathname,t=i.split("/")[n];t=t||"Home";function r(r){var u=[],f,e;if($("a",r).each(function(){var i=$(this),e=i.attr("href"),r=e.split("/")[n],o=i.attr("alias"),f;r=r||"Home";f=t===r||t===o;f&&(i.addClass("current-link"),u.push(i))}),u.length>1)for(f=0;f<u.length;f++)e=u[f],i!==e.attr("href")&&e.removeClass("current-link")}r("#sections");r(".site-map-group.top-level")}};annualProfile.updateContentSectionsAndGraphs=function(n,t,i){var e,r,f;e=i?"[data-url]:not([data-prevent-updates])":"[data-url]";var s=$(e).toArray(),h=$("figure[data-chart-type][data-json-url]").toArray(),u=s.concat(h),o=u.length;if(o===0){annualProfile.$uiControlls.removeAttr("disabled");pubsub.pub("ContentSectionsAndGraphsUpdated");t&&setTimeout(t);return}r=0;f=function(){r<o-1?(annualProfile.contentOrGraph(u[r],f,n),r=r+1):annualProfile.contentOrGraph(u[r],function(){t&&setTimeout(t);annualProfile.$uiControlls.removeAttr("disabled");pubsub.pub("ContentSectionsAndGraphsUpdated")},n)};f()};annualProfile.contentOrGraph=function(n,t,i){var r=$(n),u=r.attr("data-chart-type"),f=r.attr("data-url");typeof u!="undefined"&&u!==!1?annualProfile.charting.drawOrUpdate(r,t,i):typeof f!="undefined"&&f!==!1&&annualProfile.contentUpdate(r,t,i)};annualProfile.contentUpdate=function(n,t,i){var r=$(n),u=r.attr("data-url");u?annualProfile.loadWholeSection(null,r,u,i,t):t&&setTimeout(t)};annualProfile.publishPageUpdate=function(n){pubsub.pub("PageUpdated",n)},function(){var n=$(".info-header h1"),t=$.trim(n.text()).length;t<=26?n.css({fontSize:"45px"}):t>26&&t<=30?n.css({fontSize:"40px",bottom:"-3px"}):n.css({fontSize:"32px",bottom:"0"})}();InfometricsPortal=InfometricsPortal||{};InfometricsPortal.LoadDisplayCharts=function(){function t(n){for(var r="NULL",i,t=0;t<n.length;t++)i=n[t][0],i?r=i:n[t][0]=r;return n}function n(n,t,i){for(var e=[],o=i&&i<n[0].length,u,f,r=0;r<n.length;r++)u=[],f=n[r],u[0]=f[0],u[1]=f[t+1],o&&(u[2]=f[i]),e[r]=u;return e}$("figure[data-all-data]").each(function(){var f={},r=$(this),e=t(JSON.parse(r.attr("data-all-data"))),y=r.attr("data-is-split-series").toLowerCase()!=="true"&&r.attr("data-chart-type").indexOf("pie")===-1||e[0].length===2,o=$("<select />"),i=r.attr("data-anchor"),l=r.attr("data-forecast-start"),a,s,u,h,c,v;if(i=i?parseInt(i):null,a=i&&i===1?1:0,f.forecastStartAfter=l?parseInt(l):null,y)f.data=e;else{for(s=e[0].slice(1),u=0;u<s.length;u++)i&&u===i-1||(h=$('<option value="'+u+'">'+s[u]+"<\/option>"),u===0&&h.attr("selected","selected"),o.append(h));c=$("<div>Select series: <\/div>");c.append(o);c.insertBefore(r);v=n(e,a,i);f.data=v}annualProfile.charting.drawOrUpdate(r,null,f);o.on("change",function(){var t=$("option:selected",this),u=parseInt(t.val()),o=n(e,u,i);f.data=o;annualProfile.charting.drawOrUpdate(r,null,f)})})},function(){var t=$(".auto-resize-text"),i=$("body"),n;t.length>0&&(n=$('<span id="hidden-resizer" style="visibility: hidden; white-space:nowrap"/>'),i.append(n),t.each(function(){var i=$(this),t=parseInt(i.css("font-size")),u=t,e=parseInt(i.css("width"))*.92,o=i.text(),r,f;for(n.text(o).css("font-size",t).css("font-family",i.css("font-family"));t>12&&n.width()>e;)t=t-2,n.css("font-size",t);t<u&&(i.css("font-size",t),r=(u-t)/2,f=parseInt(i.css("height")),i.css("height",f-r).css("padding-top",r+parseInt(i.css("padding-top"))))}),n.remove())}();$(function(){InfometricsPortal.LoadDisplayCharts();annualProfile.updateContentSectionsAndGraphs();annualProfile.SetUpDownloads();annualProfile.setUpInterfaces();annualProfile.$wrapper.on("click","th[data-sort-id]",function(){annualProfile.reorderTable(this)});annualProfile.setUpCompareYearInterfaces();$("[title]").tooltip({tooltipClass:"custom-tooltip-styling"});$(window).bind("beforeunload",function(){annualProfile.pageIsUnloading=!0});Array.prototype.indexOf||(Array.prototype.indexOf=function(n,t){for(var i=t||0,r=this.length;i<r;i++)if(this[i]===n)return i;return-1})})