function GetChartSVG(){var t=null,n;return $.snl.ir.vars.isIE8?$("#lineItemChart").highcharts().getSVG():($("#lineItemChart svg")[0]!=null&&(svgElement=$("#lineItemChart svg")[0],n=$("
",{"class":"SVGDiv"}),n.append($(svgElement).clone()).html(),t=n.html(),$("SVGDiv").remove()),t)}var _urlAsReportedBase=$.snl.ir.models.api.urlTemplate.replace("{Controller}","AsReported"),_urlAsReportedData=_urlAsReportedBase.replace("{Action}","AsReportedData"),_urlChartData=_urlAsReportedBase.replace("{Action}","ChartData"),exportChartPDF;$.snl.ir.models.api.asReported={},$.snl.ir.models.asReported={},$.snl.ir.models.api.asReported.getAsReportedData=function(n,t){$.post(_urlAsReportedData,n).done(function(n){$.snl.ir.models.asReported.asReportedData=n,t()}).fail(function(){}).always(function(){})},$.snl.ir.models.api.asReported.getChartData=function(n,t){$.post(_urlChartData,n).done(function(n){$.snl.ir.models.asReported.chartData=$.parseJSON(n.Content).Chart,t()}).fail(function(){}).always(function(){})},$.snl.ir.controls.chart=function(n){function rt(n){var h=n.loadStockScript?n.loadStockScript:!1,r=$.snl.ir.GetConfiguration("Chart.xml",n.configUrlQueryArgs).Chart;$.preferCulture(g),chartDiv=n.chartDiv,t=n.chartConfig,l=n.chartType,i=n.data,e=n.xAxisType?n.xAxisType:e,w=n.height,b=n.width,o=n.xAxisTypeFormat,k=n.pointStart,d=n.pointInterval,u=n.events,nt=n.frequency,s=n.stacking==0?null:s,c=n.marginRight==0?null:c,$.each(i.Series,function(n,t){data=[],$.each(t.Values,function(n,r){var u={};if(t.IsDrillDown)data[n]=[r.Key,r.Value];else{if(n==0&&r.Value==0?u.y=null:(u.key=r.Key,u.y=r.Value,u.name=r.Name),i.EnableDrillDown&&(u.drilldown=r.Drilldown,u.name=r.Name),r.TransparentColumn){var f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t.Color.trim()),e=f?parseInt(f[1],16):0,o=f?parseInt(f[2],16):0,s=f?parseInt(f[3],16):0;u.color="rgba("+e+","+o+","+s+",0.30)"}data.push(u)}}),p=Math.max(p,data.length),it.push(t.Name);var r={name:t.Name,id:t.Id,data:data,color:t.Color,showInLegend:t.ShowInLegend,type:t.Type,yAxis:t.YAxisIndex,marker:{enabled:!0,lineColor:null}};t.IsDrillDown?v.push(r):a.push(r)}),$.each(i.YAxis,function(t,i){y.push({title:{text:i.Title,style:{fontWeight:"normal",backgroundColor:"#fff"}},labels:{format:n.pointValueFormat?n.pointValueFormat:"{value:,.2f}",formatter:function(){return $.format(this.value,"n2")}},opposite:i.IsOpposite,showEmpty:!1})}),h?$.when($.getScript($.snl.ir.vars.siteURL+"Scripts/Highstock/js/highstock.js").fail(f)).done(function(){$.when($.getScript($.snl.ir.vars.siteURL+"Scripts/Highstock/js/modules/drilldown.js").fail(f),$.getScript($.snl.ir.vars.siteURL+"Scripts/Highstock/js/modules/exporting.js").fail(f)).then(function(){tt(r)},f)}):tt(r)}function f(n,t,i){$.snl.ir.Log(i)}function tt(n){var f=Highcharts.setOptions({});$(chartDiv).highcharts({lang:{drillUpText:"◁"},credits:{text:"S&P Global Market Intelligence",href:"http://www.spglobal.com/marketintelligence",enabled:n.DisableCredits&&n.DisableCredits.toLowerCase()=="true"?!1:!0},drilldown:{drillUpButton:{relativeTo:"spacingBox",position:{y:2,x:3}}},chart:{type:l,height:w,width:b,marginRight:c,backgroundColor:n.BackgroundColor?n.BackgroundColor:i.BackgroundColor,borderColor:n.BorderColor?n.BorderColor:null,borderRadius:n.BorderRadius?n.BorderRadius:null,events:{load:function(){this.credits.element.onclick=function(){window.open("http://www.spglobal.com/marketintelligence","_blank")},r.chart=this,u&&u.loadCallBack&&u.loadCallBack()},drilldown:function(){r.chart.xAxis[0].options.tickInterval=i.XAxis.DrilldownTickInterval,h=!0},drillup:function(){r.chart.xAxis[0].options.tickInterval=i.XAxis.TickInterval,h=!1}}},subtitle:{text:n.SubTitle?n.SubTitle:null},title:{text:n.Title?n.Title:i.Title},tooltip:{enabled:n.DisableTooltip&&n.DisableTooltip.toLowerCase()=="true"?!1:!0,borderColor:n.TooltipBorderColor?n.TooltipBorderColor:t&&t.toolTip&&t.toolTip.borderColor?t.toolTip.borderColor:null,backgroundColor:n.TooltipBackgroundColor?n.TooltipBackgroundColor:null,borderRadius:n.TooltipBorderRadius?n.TooltipBorderRadius:null,useHTML:n.UseHTML?n.UseHTML:t&&t.toolTip&&t.toolTip.useHTML?t.toolTip.useHTML:!1,style:n.TooltipStyle?n.TooltipStyle:t&&t.toolTip&&t.toolTip.style?t.toolTip.style:f.tooltip.style,formatter:function(){var r,e,u,f;return e=i.XAxis.Categories?this.point.key:this.point.name,f=t&&t.toolTip&&t.toolTip.pointValueDecimalPlaces?t.toolTip.pointValueDecimalPlaces():this.point.y.toString().indexOf(".")>0?2:0,u=$.format(this.point.y,"n"+f),u=u.indexOf("-")==0?''+(g.toLowerCase()=="en-us"?"("+u.replace("-","")+")":u)+"<\/span>":u,r=n.TooltipHeader,r+=n.TooltipBody,r=r.replace("{pointValueFormatted}",u),r=r.replace("{pointName}",e),r=r.replace("{this.series.name}",this.series.name),r=r.replace("{this.point.name}",this.point.name),r=r.replace("{this.point.y}",this.point.y)}},xAxis:{type:e,title:{text:i.XAxis.Title,style:{fontWeight:"normal"}},tickInterval:i.XAxis.TickInterval>0?i.XAxis.TickInterval:nt=="yearly"?31536e6:null,labels:{format:o?"{value:"+o+"}":""},categories:i.XAxis.Categories?i.XAxis.Categories:null},yAxis:y,plotOptions:{area:{turboThreshold:0},column:{stacking:s},series:{dataLabels:{enabled:!1,color:"#FFFFFF"},pointStart:k,pointInterval:d,shadow:!1}},legend:{align:n.LegendAlign?n.LegendAlign:null,layout:n.LegendLayout?n.LegendLayout:null,verticalAlign:"bottom",borderColor:"#CCC",shadow:!1,enabled:n.DisableLegend&&n.DisableLegend.toLowerCase()=="true"?!1:!0,title:{text:n.LegendTitle?n.LegendTitle:null,style:{color:n.LegendTextColor?n.LegendTextColor:null}}},series:a,drilldown:{series:v},navigation:{buttonOptions:{enabled:!1}}})}var r=this,ut,ft,l,i,t,u,a=[],v=[],it=[],y=[],p=0,et,e="category",w,b,o,k,d,s="normal",h=!1,c=35,g=window.snl.ir.globalVars.currentPageViewModel.BaseViewModel.CurrentCulture,nt="daily";r.exportChart=function(n,t){var i=r.chart;r.chart.exportChart(n,t),r.chart=i},r.getSVG=function(){var n=r.chart,t=r.chart.getSVG();return r.chart=n,t},r.getIsDrillDown=function(){return h},rt(n)};var popup,url,spanID,tries=1,nsloaded=!1,popupNotReady=!1,chartWrapper=null,isMobileViewLastLineItemClick,asreportlen=$("#irwTabsContent .AsReporttab"),fixirwAsReportPanelTab=$("#irwAsReportPanelTab"),fixAsReportShow=$(".tab-pane.AsReporttab table thead tr.AsReportHide"),fixAsReportHide=$(".tab-pane.AsReporttab.active table thead tr.AsReportHide"),posTab=fixirwAsReportPanelTab.offset(),WscrollTop=$(window).scrollTop(),defaultFixTop=0,fixAsReportHeight=parseInt($(fixAsReportHide).outerHeight());$(".tab-pane.AsReporttab").css({"margin-bottom":fixAsReportHeight+"px"}),$(".irwResponsiveTable").footable({tFormat:"AsReports"}).bind("footable_already_initialized footable_breakpoint",function(){var t=$(".breakpoint").length==1;t!=isMobileViewLastLineItemClick&&hideActiveRow()});var getAsReportedData=function(n){var t=$("input[name='contentPanelHidden']").val();$.snl.ir.models.api.asReported.getAsReportedData(n,populateAsReportedDataFunc(t))},populateAsReportedDataFunc=function(n){return function(){var t=$.snl.ir.models.asReported.asReportedData;$("#"+n).html(t),$("#"+n+" .irwResponsiveTable").footable({tFormat:"AsReports"}),setupChartLinks(n),fresize()}},submitForm=function(){var n=$("#asReportedForm").serialize();getAsReportedData(n),fresize()},ShowLocation=function(n,t){spanID=t;try{popupNotReady=!popup||popup.closed||popup&&popup.document.location.toString().indexOf("id="+n)==-1}catch(r){popupNotReady=!0}if(popupNotReady){var i=$("input[name='controllerName']").val();url=$("input[name='oldUrlHidden']").val()+"?KeyFile="+n+"&Page="+i,popup=window.open(url+"#SNL_"+spanID,"popup","scrollbars=yes,resizable=yes,status=yes"),popup.opener||(popup.opener=this.window),setTimeout("CheckWindowStatus()",250)}else SetStyle()},CheckWindowStatus=function(){try{if(popup&&!popup.closed&&popup.document!=null&&popup.document!="undefined")if(popup&&!popup.closed&&popup.document.readyState&&navigator.appName!="Netscape"){if(popup.document.readyState=="complete"){SetStyle(),tries=1;return}if(tries<200)tries++,setTimeout("CheckWindowStatus()",250);else return}else if(popup&&!popup.closed){if(popup.addEventListener("load",NSLoaded,!1),popup.addEventListener("unload",NSUnloaded,!1),nsloaded==!0){SetStyle(),tries=1;return}if(tries<200)tries++,setTimeout("CheckWindowStatus()",250);else return}}catch(n){return}},NSLoaded=function(){nsloaded=!0;return},NSUnloaded=function(){nsloaded=!1;return},SetStyle=function(){if(popup&&!popup.closed){popup.focus();var n=url+"#SNL_"+spanID;popup.document.location!=n&&(popup.document.location=n),popup.document.styleSheets.length>0&&popup.document.styleSheets[0]!=null&&popup.document.styleSheets[0]!="undefined"&&(popup.document.styleSheets[0].rules?(popup.document.styleSheets[0].addRule(".SNL_"+spanID,"background: yellow"),(popup.document.layers||popup.document.all)&&popup.scrollBy(0,-100)):popup.document.styleSheets[0].cssRules&&(popup.document.styleSheets[0].insertRule(".SNL_"+spanID+" { background: yellow }",0),popup.scrollBy(0,-100)))}},setupChartLinks=function(n){var t,i,u,r;n=n?"#"+n+" ":"",$(n+"a.irwShowChart").length>0&&(t=$._data($(n+"tr.hover").filter(":not(.header)")[0],"events"),i=t?$.grep(t.click,function(n){return n.handler==lineItemRowClick}):[],$(n+"a.irwShowChart").length>0&&(n==""||$(n.trim()).is(":visible"))&&(!t||i.length==0)&&(r=0,$(n+"tr.hover").filter(":not(.header)").each(function(n,t){$(t).click(lineItemRowClick)})))},lineItemRowClick=function(n){if(isMobileViewLastLineItemClick=$(".breakpoint").length==1,n.target==$(this).find("a.irwShowChart")[0]||isMobileViewLastLineItemClick){var f,e=$(this),o,i,c,t,r,s,u,h;tableReset(),n.target==$(this).find("a.irwShowChart")[0]&&isMobileViewLastLineItemClick&&(f=$(this),$(f).trigger("footable_toggle_row")),o=e.attr("rel").split("_"),i=o[0],s=$(this).closest("tr.hover").next().attr("class"),t=s=="irwChart"?$(this).closest("tr.hover").next("tr.irwChart"):$(this).closest("tr.hover").next().next("tr.irwChart"),h=hideActiveRow(),i!=h&&(isMobileViewLastLineItemClick?(r=$(this).closest("tr.hover").next("tr.footable-row-detail"),mobileChart(r,i),r.find(".irwPopUpChartToolkit").slideDown(),u=r.find(".irwChartMob")):(setupLineItemChart(t.find(".irwChart"),i),t.find(".text-primary.irwChartLoder.irwloadchart").addClass("open").fadeIn(),t.fadeToggle(),t.find(".irwChart").slideToggle(),t.find(".irwPopUpChartToolkit").slideToggle(),u=t.find(".irwChart")),u.find("#lineItemChart").length==1&&$("span.text-primary.irwChartLoder.irwloadchart.open").removeClass("irwloadchart").fadeOut(),e.attr("rel",i+"_1"))}},hideActiveRow=function(){var n,t,i;return n=$("tr").filter("[rel*='_1']"),n.length==1&&(t=n.next(),isMobileViewLastLineItemClick&&n.hasClass("footable-detail-show")?$(n).trigger("footable_toggle_row"):(t.slideUp(),t.find(".irwChart").slideUp(),t.find(".irwPopUpChartToolkit").fadeOut(),t.find(".irwChartLoder").removeClass("open").addClass("irwloadchart").fadeOut()),i=n.attr("rel").split("_")[0],n.attr("rel",i+"_0")),i},setupLineItemChart=function(n,t){n.find("#lineItemChart").length!=1&&($("input[name='keyItemHidden']").val(t),$("input[name='keyTableForItemHidden']").val($("#irwTabsEvent li.active a").attr("rel")),submitFormChart(n))},mobileChart=function(n,t){tableReset(),setupLineItemChart(n.find(".irwChartMob"),t)},fresize=function(){var n=$(".irwResponsiveTable").footable({tFormat:"AsReports"});n.trigger("footable_resize"),n.trigger("footable_force_resize"),tableReset()},tableReset=function(){$(".irwResponsiveTable").footable({tFormat:"AsReports"}).bind("footable_row_expanded",function(n){$(".irwResponsiveTable tbody tr.footable-detail-show").not(n.row).each(function(){$(".irwResponsiveTable").data("footable").toggleDetail(this)}),$(".irwChartMob").parent("div").prev().css("display","none")}),$(".irwResponsiveTable").footable({tFormat:"AsReports"}).bind("footable_already_initialized footable_breakpoint"),$(".irwResponsiveTable").footable({tFormat:"AsReports"}).bind("footable_resized",function(){$(".irwGraphAsReport").parent("div").prev().css("display","none")})},reSetAsReportWidth=function(){fixAsReportHide=$(".tab-pane.AsReporttab.active table thead tr.AsReportHide"),$('.navbar[role="navigation"]').length>0&&(defaultFixTop=parseInt($(".navbar.navbar-default").height())),$(fixAsReportHide).find("th").each(function(n){$(this).css("width",$(this).outerWidth()+"px"),$(".irwAsReportSubTable table colgroup col:nth-child("+(n+1)+")").css("width",$(this).outerWidth()+"px")}),WscrollTop=$(window).scrollTop()+defaultFixTop,fixAsReportHide=$(".tab-pane.AsReporttab.active table thead tr.AsReportHide"),WscrollTop>posTab.top&&$(fixirwAsReportPanelTab.css("position")=="static")?($(fixirwAsReportPanelTab).css({width:$(fixirwAsReportPanelTab).width()+"px",top:defaultFixTop+"px"}).addClass("fix-irwAsreportTab"),$(fixAsReportHide).addClass("fix-irwAsreportyear").css({top:$(fixirwAsReportPanelTab).outerHeight()+defaultFixTop+"px"})):($(fixirwAsReportPanelTab).removeAttr("style").removeClass("fix-irwAsreportTab"),$(fixAsReportHide).removeClass("fix-irwAsreportyear"),$(fixAsReportShow).removeClass("fix-irwAsreportyear"))},submitFormChart=function(n){var t=$("#asReportedForm").serialize();getChartdData(t,n)},populateChartDataFunc=function(n){return function(){var t=$.snl.ir.models.asReported.chartData;$("#lineItemChart").appendTo(n),setChartWidth(),$("#lineItemChart").css("display","block"),bindChart()}},getChartdData=function(n,t){$.snl.ir.models.api.asReported.getChartData(n,populateChartDataFunc(t))},bindChart=function(n,t){var i=$.snl.ir.models.asReported.chartData,r,u=[],f;chartWrapper==null?(r=i.Series[0].Color,i.Series[0].Color=i.Series[0].Color,f={chartDiv:$("#lineItemChart"),loadStockScript:!0,chartType:t?t:"column",data:i,chartConfig:{toolTip:{borderColor:r}},pointValueFormat:i.Series[0].Values[0].Value!=undefined?i.Series[0].Values[0].Value.toString().indexOf(".")>0?"{value:,.2f}":"{value:,.0f}":"{value:,.0f}",events:{loadCallBack:n}},chartWrapper=new $.snl.ir.controls.chart(f)):($.each(i.Series[0].Values,function(n,t){u.push(t.Value)}),chartWrapper.chart.setTitle({text:i.Title},{text:null},!1),chartWrapper.chart.yAxis[0].update({title:{text:i.YAxis[0].Title}},!1),chartWrapper.chart.series[0].name=i.Series[0].Name,chartWrapper.chart.series[0].setData(u,!1),chartWrapper.chart.redraw()),window.snl.ir.globalVars.currentPageViewModel.Chart=i,$("span.text-primary.irwChartLoder.irwloadchart.open").removeClass("irwloadchart").fadeOut()},toggleChartTypePanel=function(n){var t=$(n).find("div.charttype");t.is(":visible")?$(n).find("div.charttype").hide():$(n).find("div.charttype").show()},toggleChartType=function(n){var t=$(n).attr("value");chartWrapper.chart.series[0].update({type:t}),$(".graph_radio").removeClass("graph_but_active"),$(".graph_radio[value='"+t+"']").addClass("graph_but_active")},printChart=function(){chartWrapper.chart.container.style.display="block",setTimeout(function(){chartWrapper.chart.print()},1e3)};window.snl.ir.globalVars.exportCallback=function(n){n.Chart!=null&&(n.Chart.SVG=GetChartSVG())},exportChartPDF=function(){var t;t=$("#irwTabsEvent li.active a").text().replace(" ","_")+"_Chart",t+="_"+$("tr.irwChart:visible").prev().find("td:first a").text().replace(/\s/g,"_"),t=t.replace(",","_"),t=t.replace("-","_"),t=t.replace("'",""),window.snl.ir.globalVars.useHighStockServer.toLowerCase()=="true"?chartWrapper.exportChart({type:"application/pdf",filename:t},null):exportView("pdf",!0,"ChartData",t)};var setChartWidth=function(){$("#lineItemChart").width($("#irwTabsContent").width()-65)},updateAsReportedChartLink=function(n){var t=$("#asReportChart").attr("href"),i;t!=""&&t!=undefined&&(i=t.substring(0,t.indexOf("?keyTable=")),i=i+"?keyTable="+n,$("#asReportChart").attr("href",i))},loadPrintView=function(n){var t,i,r;t=$("#irwTabsEvent li.active a").attr("rel"),i=$(n).closest("tr").prev().attr("rel").split("_")[0],r=$(n).closest(".PopUpChartToolkit").find(".graph_but_active").attr("value"),window.open($.snl.ir.vars.controllerURL+"/Chart"+$.snl.ir.vars.urlSuffix+"?keyTable="+t+"&keyItem="+i+"&chartType="+r,"_blank")},loadChartPrintView=function(){var n=document.body.childNodes;$("body").css("background","none"),$.each(n,function(n,t){t.nodeType===1&&(t.style.display="none")}),$.snl.ir.models.asReported.chartData=$.parseJSON($("#chartModelHidden").val()),$(".irwChart").appendTo($("body")),setChartPrintWidth(),bindChart(printChart,$("#chartTypeHidden").val())},setChartPrintWidth=function(){$("#lineItemChart").width($(".irwChart").width()-65)},pageLoadFinancialStatements=function(){if($("#irwAsReport").length==1){$("body, html").animate({scrollTop:0},"slow"),$(".tab-pane.AsReporttab").css({"margin-bottom":fixAsReportHeight+"px"}),$(document).delegate(".irwAsReportDropDown a","click",function(){var t=$(this).text();$("#irwAsReportDropDownName").text(t)}),$("#irwTabsdropdown a").click(function(n){var r;n.preventDefault(),$(this).tab("show"),$(".irwAsReportDropDown li.active, #irwTabsEvent li").removeAttr("class"),$(this).closest("li").addClass("active");var u=$(this).closest("li").index()+1,t=$("#irwTabsEvent li:nth-child("+u+")"),f=t.find("a")[0].href.split("#")[1],i=t.find("a")[0].rel;t.addClass("active"),fresize(),loadTab(f,i),updateAsReportedChartLink(i),r=window.snl.ir.globalVars.currentPageViewModel,r.KeyTable=i}),$("#irwTabsEvent li a").click(function(){reSetAsReportWidth()}),setupChartLinks(),$(window).resize(function(){$(asreportlen).length>0&&(posTab=fixirwAsReportPanelTab.offset(),reSetAsReportWidth()),setChartWidth()}),$("#irwTabsEvent li:not(.active) a").each(function(){var n=$(this).attr("href").replace("#",""),t=$(this).attr("rel");loadTab(n,t)});var t=window.snl.ir.globalVars.currentPageViewModel,n=$("#irwTabsEvent li.active a").attr("rel");t.KeyTable=n,updateAsReportedChartLink(n)}},loadTab=function(n,t){$("#"+n).html().trim().length==0?($("input[name='contentPanelHidden']").val(n),$("input[name='keyTableHidden']").val(t),submitForm()):setupChartLinks(n)},pageLoadChartPrintView=function(){$("#irwAsReportChart").length==1&&($(window).resize(function(){setChartPrintWidth()}),loadChartPrintView())},model=window.snl.ir.globalVars.currentPageViewModel;model.BaseViewModel.IsPrintMode&&(window.onload=function(){var n=-1;n=model.BaseViewModel!=null?model.BaseViewModel.TabIndex:model.TabIndex,n>=0&&$("#irwTabsEvent a:eq("+n+")").click()}),$(document).ready(function(){model.BaseViewModel.IsPrintMode||(pageLoadFinancialStatements(),pageLoadChartPrintView()),$("#irwTabsEvent a").click(function(n){var f=n.target.href.split("#")[1],t=n.target.rel,r,i,u;$("#irwAsReportPanelTab").length>0&&($(".irwAsReportDropDown li").removeAttr("class"),r=$(this).closest("li").index()+1,i=$(".irwAsReportDropDown li:nth-child("+r+")"),i.addClass("active"),$("#irwAsReportDropDownName").text(i.text()),fresize()),loadTab(f,t),updateAsReportedChartLink(t),u=window.snl.ir.globalVars.currentPageViewModel,u.KeyTable=t}),window.snl.ir.globalVars.currentPageViewModel.DisplayExcelDownloadLink==!1&&($("#excel_toolkit").css("display","none"),$("#exceldesc_toolkit").css("display","none"))}),$(window).scroll(function(){$(asreportlen).length>0&&reSetAsReportWidth()})