function getTooltip(n,t,i){var u=[];for(var r in n)n.hasOwnProperty(r)&&(typeof n[r]=="object"?u=u.concat(getTooltip(n[r],t,i)):r===t&&n[r]===i||r===t&&i===""?u.push(n):n[r]===i&&t===""&&u.lastIndexOf(n)===-1&&u.push(n));return u}function hideSelectorPopover(){$("[id^=popover]").popover("destroy")}function cleanupSeriesName(n){return n.substring(n.indexOf(":")+1)}function setErrorBarAndTooltip(n,t,i,r,u){var f=_.find(n.data,function(n){return n.name!=null});return f.stateName+" - "+f.stratifierName+" - "+cleanupSeriesName(t)+": "+i+" - Confidence Interval: "+(r==null||r==undefined?"Not Available":r)+" - "+(u==null||u==undefined?"Not Available":u)}function tester(){return"test"}function stripSearchTermEndQuotes(n){var t=n.length;return n.charAt(0)=='"'&&(n=n.substring(1,t--)),n.charAt(--t)=='"'&&(n=n.substring(0,t)),n}function getPriorityNeedTitleFilteredData(n,t){var u=t,f,i,r;return n.length>0&&(getSearchType()==1&&(t=t.filter(function(t){return t.PriorityNeed.toLowerCase().indexOf(n.toLowerCase())>=0})),getSearchType()==2?(i=n.match(/"[^"]*"|\S+/g).map(function(n){return n.slice(0,1)==='"'?n.slice(1,-1):n}),i.length>4&&(i=i.slice(0,4)),$.each(i,function(n,i){var r=stripSearchTermEndQuotes(i);t=t.filter(function(n){return n.PriorityNeed.toLowerCase().indexOf(r.toLowerCase())>=0})})):getSearchType()==3&&(f=[],i=n.match(/"[^"]*"|\S+/g).map(function(n){return n.slice(0,1)==='"'?n.slice(1,-1):n}),i.length>4&&(i=i.slice(0,4)),r=i.length,r==1?t=t.filter(function(n){return n.PriorityNeed.toLowerCase().indexOf(i[0].toLowerCase())>=0}):r==2?t=t.filter(function(n){return n.PriorityNeed.toLowerCase().indexOf(i[0].toLowerCase())>=0||n.PriorityNeed.toLowerCase().indexOf(i[1].toLowerCase())>=0}):r==3?t=t.filter(function(n){return n.PriorityNeed.toLowerCase().indexOf(i[0].toLowerCase())>=0||n.PriorityNeed.toLowerCase().indexOf(i[1].toLowerCase())>=0||n.PriorityNeed.toLowerCase().indexOf(i[2].toLowerCase())>=0}):r==4&&(t=t.filter(function(n){return n.PriorityNeed.toLowerCase().indexOf(i[0].toLowerCase())>=0||n.PriorityNeed.toLowerCase().indexOf(i[1].toLowerCase())>=0||n.PriorityNeed.toLowerCase().indexOf(i[2].toLowerCase())>=0||n.PriorityNeed.toLowerCase().indexOf(i[3].toLowerCase())>=0}))),u=t),u}function getTitleFilteredData(n,t){var u=t,f,i,r;return n!=undefined&&n!=null&&n.length>0&&(getSearchType()==1&&(t=t.filter(function(t){return t.MeasureTitle.toLowerCase().indexOf(n.toLowerCase())>=0})),getSearchType()==2?(i=n.match(/"[^"]*"|\S+/g).map(function(n){return n.slice(0,1)==='"'?n.slice(1,-1):n}),i.length>4&&(i=i.slice(0,4)),$.each(i,function(n,i){var r=stripSearchTermEndQuotes(i);t=t.filter(function(n){return n.MeasureTitle.toLowerCase().indexOf(r.toLowerCase())>=0})})):getSearchType()==3&&(f=[],i=n.match(/"[^"]*"|\S+/g).map(function(n){return n.slice(0,1)==='"'?n.slice(1,-1):n}),i.length>4&&(i=i.slice(0,4)),r=i.length,r==1?t=t.filter(function(n){return n.MeasureTitle.toLowerCase().indexOf(i[0].toLowerCase())>=0}):r==2?t=t.filter(function(n){return n.MeasureTitle.toLowerCase().indexOf(i[0].toLowerCase())>=0||n.MeasureTitle.toLowerCase().indexOf(i[1].toLowerCase())>=0}):r==3?t=t.filter(function(n){return n.MeasureTitle.toLowerCase().indexOf(i[0].toLowerCase())>=0||n.MeasureTitle.toLowerCase().indexOf(i[1].toLowerCase())>=0||n.MeasureTitle.toLowerCase().indexOf(i[2].toLowerCase())>=0}):r==4&&(t=t.filter(function(n){return n.MeasureTitle.toLowerCase().indexOf(i[0].toLowerCase())>=0||n.MeasureTitle.toLowerCase().indexOf(i[1].toLowerCase())>=0||n.MeasureTitle.toLowerCase().indexOf(i[2].toLowerCase())>=0||n.MeasureTitle.toLowerCase().indexOf(i[3].toLowerCase())>=0}))),u=t),u}function getForm5DataNotesPopover(n,t,i){var f=$('<span class="btn btn-primary " tabIndex="0" title="Data Notes" id="btnOpenNationalNotes">Data Notes<\/span>'),e=$.extend({},n),r=$('<span class="btn btn-primary " tabIndex="0" title="State Notes" id="btnOpenStateNotes">State Notes<\/span>'),u;if(t.toLowerCase()=="national"){r[0].className="btn btn-primary disabled";r[0].title="State Notes";u=getPopover(f,r,e);u.parent().off("click keyup","#btnOpenNationalNotes").on("click keyup","#btnOpenNationalNotes",function(){hideSelectorPopover();form5NationalOrStateNotes(!1,null,i)});u.parent().off("click keyup","#btnOpenStateNotes").on("click keyup","#btnOpenStateNotes",function(n){if($(n.currentTarget).hasClass("disabled"))return!1;hideSelectorPopover()});u.parent().on("click keyup","#btnPopoverClose",function(){hideSelectorPopover()});$(n.currentTarget).attr("title","Info")}else $.getJSON("/api/values/GetForm5StateNotes?state="+t,function(t){t.CallSuccess?(r[0].className="btn btn-primary",r[0].title="State Notes"):(r[0].className="btn btn-primary disabled",r[0].title="State notes are not available for this state");var u=getPopover(f,r,e);u.parent().off("click keyup","#btnOpenNationalNotes").on("click keyup","#btnOpenNationalNotes",function(){hideSelectorPopover();form5NationalOrStateNotes(!1,null,i)});u.parent().off("click keyup","#btnOpenStateNotes").on("click keyup","#btnOpenStateNotes",function(n){if($(n.currentTarget).hasClass("disabled"))return!1;hideSelectorPopover();form5NationalOrStateNotes(!0,t.stateNotes,i)});u.parent().on("click keyup","#btnPopoverClose",function(){hideSelectorPopover()});$(n.currentTarget).attr("title","Info")})}function getDetailSelectorPopOver(n,t,i,r,u,f){var o=$('<span class="btn btn-primary " tabIndex="0" title="Detail Sheet" id="btnOpenDetails">Detail Sheet<\/span>'),s=$.extend({},n),e=$('<span class="btn btn-primary " tabIndex="0" title="Data Note" id="btnOpenNotes">Data Note<\/span>');if(i==="npm")if(r==2)$.getJSON("/api/values/GetStateNotes?measureKey="+t+"&state="+u+"&domainId="+f,function(i){i.CallSuccess?(e[0].className="btn btn-primary",e[0].title="Data Note"):(e[0].className="btn btn-primary disabled",e[0].title="Data notes are not available for this measure");var h=getPopover(o,e,s);if(h.parent().hasClass("disabled"))return!1;h.parent().off("click keyup","#btnOpenDetails").on("click keyup","#btnOpenDetails",function(){hideSelectorPopover();npmDetailModel(t,"Detail",r,u)});h.parent().off("click keyup","#btnOpenNotes").on("click keyup","#btnOpenNotes",function(n){if($(n.currentTarget).hasClass("disabled"))return!1;hideSelectorPopover();npmDetailModel(t,"Note",r,u,f)});h.parent().on("click keyup","#btnPopoverClose",function(){hideSelectorPopover()});$(n.currentTarget).attr("title","Info")});else return t==="18"||t===18?(e[0].className="btn btn-primary disabled",e[0].title="Data notes are not available for this measure."):(e[0].className="btn btn-primary",e[0].title="Data Note"),getPopover(o,e,n);else if(i==="nom")return t==="12"?(e[0].className="btn btn-primary disabled",e[0].title="Data notes are not available for this measure."):(e[0].className="btn btn-primary",e[0].title="Data Note"),getPopover(o,e,n)}function getPopover(n,t,i){var r=$('<div class="center" ><\/div>'),u;return r.append(n),r.append("&nbsp;&nbsp;"),r.append(t),$(i.currentTarget).attr("title",""),$("[id^=popover]").popover("hide"),hideSelectorPopover(),u=$(i.currentTarget).popover({placement:"auto top",html:"true",trigger:"click",title:'<span class="text-info">Additional Info<\/span><button type="button" tabindex="0" title="Close" class="close" id="btnPopoverClose" aria-label="Close"><i class="fa fa-times-circle text-danger"><\/i><\/button>',content:r[0].outerHTML}).on("show.bs.popover",function(){u.attr("data-content",r[0].outerHTML)}),u.popover("show"),u}function showForm5DataNotes(n,t,i){getForm5DataNotesPopover(n,t,i)}function getform5MultiyearTooltip(n,t){return n.data.filter(function(n){return n.year==t})[0].toolTip}function getacceeAndLinkageTooltip(n,t,i){return t.name==="Linked to Vital Records Birth"?n+": Number of States that have linkage to Vital Records Birth: "+i:n+": Number of States with "+t.name+": "+i}function switchForm5NotesYear(){var t,n,i,r,u;for($("#Form5Notes").empty(),t=document.getElementsByName("Form5_Notes_switch"),n=0,i=t.length;n<i;n++)if(t[n].checked){r=form5StateNotes[t[n].value];u=$.parseHTML(r.toHtmlBreakFromNewLine());$("#Form5Notes").append(u);break}}function form5NationalOrStateNotes(n,t,i){var r;if($("#Form5Notes").empty(),$("#viewForm5DataModal").find("#tblHeaderForm5").html("Percentage Served by Title V"),$("#viewForm5DataModal .switch-field").hide(),r="",n)i&&$("#viewForm5DataModal .switch-field").show(),form5StateNotes=t,$("#viewForm5DataModal").find("#switch_"+appYear)[0].checked=!0,r=t[appYear];else if($("#viewForm5DataModal .switch-field").hide(),i)r='<table class="table table-bordered" style="width:920px;font-family:sans-serif"> <tbody> <tr> <td class="col-sm-2 bg-blue "><p><b>Data Notes <\/b><br ><br ><p>For definitions and examples by type of service, please see the<a target=\'_blank\' href=\'https://mchb.tvisdata.hrsa.gov/Glossary/Glossary#_Form_5__\'> Glossary<\/a>.<\/p><br ><p>Direct and Enabling Services Only (5A) note: Percentages were derived by dividing state-reported numbers by population denominators; Multi-Year 5A percentages are not provided at the state-level<\/p><br ><p>Direct, Enabling, and Public Health Services and Systems (5B) note: Numbers were derived by applying state-reported percentages to population denominators<\/p><br ><p>CSHCN 0 through 21 Years: National percentages exclude the jurisdictions in 2017 and 2018 due to lack of availability of denominator data for all jurisdictions<\/p><br ><b>Denominator Sources –<\/b> Data Year is the year preceding the reporting year (latest federally available at data entry) but States may provide their own denominators that reflect the reporting year<br ><br ><p>Pregnant Women: National Vital Statistics System – Resident Live Births (all states plus DC, GU, MP, PR, VI); US Census Bureau International Data Base for all other jurisdictions – Births<\/p><br ><p>Infants <1 Year: National Vital Statistics System – Live Births by Occurrence (all states plus DC, GU, MP, PR, VI); US Census Bureau International Data Base for all other jurisdictions – Population Estimates<\/p><br ><p>Children 1 through 21 Years: US Census Bureau Population Estimates; US Census Bureau International Data Base for Jurisdictions – Population Estimates<\/p><br ><p> CSHCN: For 2020 and later, NSCH CSHCN Prevalence Estimates 0-17 (2018-2019 used for 2020, 2019-2020 used for 2021, 2020-2021 used for 2022, 2021-2022 used for 2023) multiplied by US Census Bureau Population Estimates 0-21; MCH-JS CSHCN Prevalence Estimates 0-17 (2019 used for 2020 and for 2021 in GU, PR, VI; 2021 used for 2021,2022, and 2023 in AS, FM, MH, MP, PW; 2022 used for 2022 and 2023 in GU; 2023 used for 2022 and 2023 in PR, VI) multiplied by US Census Bureau International Data Base Population Estimates 0-21; Prior to 2020, National Survey of Children’s Health (NSCH) CSHCN Prevalence Estimates 1-17 (2016 used for 2017, 2016-2017 used for 2018, 2017-2018 used for 2019) multiplied by US Census Bureau Population Estimates 1-21; Maternal and Child Health Jurisdictional Survey (MCH-JS) CSHCN Prevalence Estimates 1-17 (2019 used for 2019; no previous data available) multiplied by US Census Bureau International Data Base Population Estimates 1-21<\/p><br ><p>Others (22+): US Census Bureau Population Estimates; US Census Bureau International Data Base for Jurisdictions – Population Estimates<\/p><br ><\/p><\/td><\/tr><\/table>';else r='<table class="table table-bordered" style="width:920px;font-family:sans-serif"> <tbody> <tr> <td class="col-sm-2 bg-blue "><p><b>Data Notes <\/b><br ><br ><p>For definitions and examples by type of service, please see the<a target=\'_blank\' href=\'https://mchb.tvisdata.hrsa.gov/Glossary/Glossary#_Form_5__\'> Glossary<\/a>.<\/p><br ><p>Direct and Enabling Services Only (5A) note: Percentages were derived by dividing state-reported numbers by population denominators<\/p><br ><p>Direct, Enabling, and Public Health Services and Systems (5B) note: Numbers were derived by applying state-reported percentages to population denominators<\/p><br ><b>Denominator Sources – 2022<\/b> (States may provide their own denominators that reflect 2023 data)<br ><br ><p>Pregnant Women: National Vital Statistics System – Resident Live Births (all states plus DC, GU, MP, PR, VI); US Census Bureau International Data Base for all other jurisdictions – Births<\/p><br ><p>Infants <1 Year: National Vital Statistics System – Live Births by Occurrence (all states plus DC, GU, MP, PR, VI); US Census Bureau International Data Base for all other jurisdictions – Population Estimates<\/p><br ><p>Children 1 through 21 Years: US Census Bureau Population Estimates; US Census Bureau International Data Base for Jurisdictions – Population Estimates<\/p><br ><p>CSHCN 0 through 21 Years: National Survey of Children’s Health CSHCN Prevalence Estimates 0-17 (2021-2022) multiplied by US Census Bureau Population Estimates 0-21; Maternal and Child Health Jurisdictional Survey CSHCN Prevalence Estimates 0-17 (2021 for AS, FM, MH, MP, PW; 2022 for GU; and 2023 for PR, VI) multiplied by US Census Bureau International Data Base Population Estimates 0-21<\/p><br ><p>Others (22+): US Census Bureau Population Estimates; US Census Bureau International Data Base for Jurisdictions – Population Estimates<\/p><br ><\/p><\/td><\/tr><\/table>';$("#viewForm5DataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){var n=$.parseHTML(r.toHtmlBreakFromNewLine());$("#Form5Notes").append(n);$("#viewForm5DataModal").modal("show")})}function showBooleanSearchTips(){$(".TvisDataModalData").empty();$(".TvisDataModal").find("#tblHeader").html("Search Help");var n="";n="<table class=\"table table-bordered\" style=\"width:920px;font-family:sans-serif\"> <tbody> <tr> <td class=\"col-sm-2 bg-blue \"><p><p class='center'> <b>Exact <\/b><br ><br ><\/p><p>This search type will generate results matching the entire text entered.<\/p><br ><p><b>Sample Search Text:<\/b> Maternal Mortality Rate<\/p><p><b>Results:<\/b> Generates results that include the text: Maternal Mortality Rate<\/p><br ><p><b>Note:<\/b> Please do not include single/double quotes unless the quotes are meant to be part of the search term.<\/p><br ><p class='center'><b>And<\/b><br ><br ><\/p><p>This search type will generate results that have all words or terms entered.<\/p><br ><p>A search term can include multiple words. This search type will allow you to enter up to four search terms. Search terms must be within double quotes, such as “Maternal Mortality”.<\/p><br ><p><b>Sample Search with multiple words:<\/b> screening children preventive<\/p><p><b>Results:<\/b> Generates results that include all three of these words<\/p><br/><p><b>Sample Search with a term and a search word:<\/b> “Infant Mortality” Morbidity<\/p><p><b>Results:<\/b> Generates results that include both the term, Infant Mortality, and the word, Morbidity<\/p><br ><p class='center'><b>Or<\/b><br ><br ><\/p><p>This search type will generate results that have any of the words or terms entered.<\/p><br ><p>A search term can include multiple words. This search will allow you to enter up to four search terms. Search terms must be within double quotes, such as “Maternal Mortality”.<\/p><br ><p><b>Sample Search with multiple words:<\/b> screening children preventive<\/p><p><b>Results:<\/b> Generates results that include any of the three words<\/p><br ><p><b>Sample Search with a term and a search word:<\/b> “Infant Mortality” Morbidity<\/p><p><b>Results:<\/b> Generates results that include either the term, Infant Mortality, or the word, Morbidity<\/p><br ><p><b>Sample Search with two search terms:<\/b> “prenatal care” “injury prevention”<\/p><p><b>Results:<\/b> Generates results that include either term<\/p><br ><\/p><\/td><\/tr><\/table>";$(".TvisDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){var t=$.parseHTML(n.toHtmlBreakFromNewLine());$(".TvisDataModalData").append(t);$(".TvisDataModal").modal("show")})}function showBooleanSearchTips(){$(".TvisDataModalData").empty();$(".TvisDataModal").find("#tblHeader").html("Search Help");var n="";n="<table class=\"table table-bordered\" style=\"width:920px;font-family:sans-serif\"> <tbody> <tr> <td class=\"col-sm-2 bg-blue \"><p><p class='center'> <b>Exact <\/b><br ><br ><\/p><p>This search type will generate results matching the entire text entered.<\/p><br ><p><b>Sample Search Text:<\/b> Maternal Mortality Rate<\/p><p><b>Results:<\/b> Generates results that include the text: Maternal Mortality Rate<\/p><br ><p><b>Note:<\/b> Please do not include single/double quotes unless the quotes are meant to be part of the search term.<\/p><br ><p class='center'><b>And<\/b><br ><br ><\/p><p>This search type will generate results that have all words or terms entered.<\/p><br ><p>A search term can include multiple words. This search type will allow you to enter up to four search terms. Search terms must be within double quotes, such as “Maternal Mortality”.<\/p><br ><p><b>Sample Search with multiple words:<\/b> screening children preventive<\/p><p><b>Results:<\/b> Generates results that include all three of these words<\/p><br/><p><b>Sample Search with a term and a search word:<\/b> “Infant Mortality” Morbidity<\/p><p><b>Results:<\/b> Generates results that include both the term, Infant Mortality, and the word, Morbidity<\/p><br ><p class='center'><b>Or<\/b><br ><br ><\/p><p>This search type will generate results that have any of the words or terms entered.<\/p><br ><p>A search term can include multiple words. This search will allow you to enter up to four search terms. Search terms must be within double quotes, such as “Maternal Mortality”.<\/p><br ><p><b>Sample Search with multiple words:<\/b> screening children preventive<\/p><p><b>Results:<\/b> Generates results that include any of the three words<\/p><br ><p><b>Sample Search with a term and a search word:<\/b> “Infant Mortality” Morbidity<\/p><p><b>Results:<\/b> Generates results that include either the term, Infant Mortality, or the word, Morbidity<\/p><br ><p><b>Sample Search with two search terms:<\/b> “prenatal care” “injury prevention”<\/p><p><b>Results:<\/b> Generates results that include either term<\/p><br ><\/p><\/td><\/tr><\/table>";$(".TvisDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){var t=$.parseHTML(n.toHtmlBreakFromNewLine());$(".TvisDataModalData").append(t);$(".TvisDataModal").modal("show")})}function multiLevelStackedchart_legendClick(n){n.preventDefault();let t=n.sender.options.series.filter(function(t){return t.name==n.text});$.each(t,function(n,t){t.visible&&t.visible!="0"?t.visible=!1:t.visible||t.visible=="1"||(t.visible=!0)});n.sender.redraw()}function spmDetailModel(n,t,i,r){var u,f;if($("#NPMData").empty(),u=n,t==="Note")$("#viewNPMDataModal").find("#tblHeader").html("SPM "+u.MeasureKey+" - "+u.MeasureTitle),$.getJSON("/api/values/GetPMStateNotes?MeasureId="+u.measureId+"&state="+i+"&measureType="+r,function(n){var r=0,t,i;dataNotes="";t="";n.result.forEach(function(n){if(n.DataNote!==null&&n.DataNote!==undefined){var i="";n.Subheader!=null&&n.Subheader!=undefined&&(i="<b>"+n.Year+" "+n.Subheader+"<\/b><br ><br >");t+=n.DataNote;dataNotes=dataNotes+"<p>"+i+n.DataNote+"<\/p><br >"}r++});i='<table class="table table-bordered" style="width:920px;font-family:sans-serif"> <tbody> <tr> <td class="col-sm-2 bg-blue "><p>'+dataNotes+"<\/p><\/td><\/tr><\/table>";$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){t!=null&&t!=""&&t.length>0&&($("#NPMData").append(i),$("#viewNPMDataModal").modal("show"))})});else{$("#viewNPMDataModal").find("#tblHeader").html("SPM "+u.MeasureKey+" - "+u.MeasureTitle);stateMeasuresDetail.find("#measureStatusRow").show();f="";f=u.isActive!=null&&u.isActive!=undefined&&u.isActive==!1?u.inactiveType==1?"Inactive - Completed":u.inactiveType==2?"Inactive - Replaced":u.inactiveType==3?"Inactive - "+u.inactiveOtherReason:"Inactive":"Active";stateMeasuresDetail.find("#measureStatus").html(f);stateMeasuresDetail.find("#ESMSubGroupRow").hide();stateMeasuresDetail.find("#ESMStrategyRow").hide();stateMeasuresDetail.find("#goal").html(u.Goal);stateMeasuresDetail.find("#goal").html(u.Goal);stateMeasuresDetail.find("#objectiveHeader").show();stateMeasuresDetail.find("#objective").show();u.Objective2020===""||u.Objective2020===null?stateMeasuresDetail.find("#objective").html("No Healthy People 2030 Objective is provided by the State."):stateMeasuresDetail.find("#objective").html(u.Objective2020.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#population").show();stateMeasuresDetail.find("#populationDomain").show();stateMeasuresDetail.find("#sources").html(u.DataSources.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#population").html(u.DomainName);stateMeasuresDetail.find("#significance").html(u.Significance.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#numerator").html(u.NumeratorDescription);stateMeasuresDetail.find("#denominator").html(u.DenominatorDescription);stateMeasuresDetail.find("#units").html(u.MeasureTypeText);stateMeasuresDetail.find("#text1").html(u.Units);$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){$("#NPMData").append(stateMeasuresDetail);$("#viewNPMDataModal").modal("show")})}}function somDetailModel(n,t,i,r){if($("#NPMData").empty(),t==="Note")$("#viewNPMDataModal").find("#tblHeader").html("SOM "+n.MeasureKey+" - "+n.MeasureTitle),$.getJSON("/api/values/GetPMStateNotes?MeasureId="+n.measureId+"&state="+i+"&measureType="+r,function(n){var r=0,t,i;dataNotes="";t="";n.result.forEach(function(n){if(n.DataNote!==null&&n.DataNote!==undefined){var i="";n.Subheader!=null&&n.Subheader!=undefined&&(i="<b>"+n.Year+" "+n.Subheader+"<\/b><br ><br >");t+=n.DataNote;dataNotes=dataNotes+"<p>"+i+n.DataNote+"<\/p><br >"}r++});i='<table class="table table-bordered" style="width:920px;font-family:sans-serif"> <tbody> <tr> <td class="col-sm-2 bg-blue "><p>'+dataNotes+"<\/p><\/td><\/tr><\/table>";$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){t!=null&&t!=""&&t.length>0&&($("#NPMData").append(i),$("#viewNPMDataModal").modal("show"))})});else{$("#viewNPMDataModal").find("#tblHeader").html("SOM "+n.MeasureKey+" - "+n.MeasureTitle);stateMeasuresDetail.find("#measureStatusRow").show();var u="";u=n.isActive!=null&&n.isActive!=undefined&&n.isActive==!1?n.inactiveType==1?"Inactive - Completed":n.inactiveType==2?"Inactive - Replaced":n.inactiveType==3?"Inactive - "+n.inactiveOtherReason:"Inactive":"Active";stateMeasuresDetail.find("#measureStatus").html(u);stateMeasuresDetail.find("#ESMSubGroupRow").hide();stateMeasuresDetail.find("#ESMStrategyRow").hide();stateMeasuresDetail.find("#goal").html(n.Goal);stateMeasuresDetail.find("#objectiveHeader").show();stateMeasuresDetail.find("#objective").show();n.Objective2020===""||n.Objective2020===null?stateMeasuresDetail.find("#objective").html("No Healthy People 2030 Objective is provided by the State."):stateMeasuresDetail.find("#objective").html(n.Objective2020.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#population").show();stateMeasuresDetail.find("#populationDomain").show();stateMeasuresDetail.find("#sources").html(n.DataSources.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#population").html(n.DomainName);stateMeasuresDetail.find("#significance").html(n.Significance.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#numerator").html(n.NumeratorDescription);stateMeasuresDetail.find("#denominator").html(n.DenominatorDescription);stateMeasuresDetail.find("#units").html(n.MeasureTypeText);stateMeasuresDetail.find("#text1").html(n.Units);$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){$("#NPMData").append(stateMeasuresDetail);$("#viewNPMDataModal").modal("show")})}}function breakSentence(n){for(var r="",u="",i=n.split(" "),t=0;t<i.length;t++)(u+i[t]).length>65?(r=r+" |"+i[t],u=i[t]):(r=r+" "+i[t],u=u+" "+i[t]);return r}function npmDetailModel(n,t,i,r,u){var f="",e,s,o;$("#NPMData").empty();t==="Note"?($.getJSON("/api/values/GetNpm?id="+n+"&isForNote=true",function(n){var t=n.result;$("#viewNPMDataModal").find("#tblHeader").html(t.MeasureTitle)}),i==2?$.getJSON("/api/values/GetStateNotes?measureKey="+n+"&state="+r+"&domainId="+u,function(n){var r=0,t,i;f="";t="";n.result.forEach(function(n){if(n.DataNote!==null&&n.DataNote!==undefined){var i="";n.Subheader!=null&&n.Subheader!=undefined&&(i="<b>"+n.Year+" "+n.Subheader+"<\/b><br ><br >");t+=n.DataNote;f=f+"<p>"+i+n.DataNote+"<\/p><br >"}r++});i='<table class="table table-bordered" style="width:920px;font-family:sans-serif"> <tbody> <tr> <td class="col-sm-2 bg-blue "><p>'+f+"<\/p><\/td><\/tr><\/table>";$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){t!=null&&t!=""&&t.length>0&&$("#NPMData").append(i)})}):(e="",s="",r=r==undefined?"":r,o=$.getJSON("/api/values/GetFadMeasureMappingsInfoForNPM?MeasureId="+n+"&state="+r+"&filterType="+i+"&domainId="+u,function(t){var e=0,r,u;f="";t.result.forEach(function(n){n.DataNotes!==null&&n.DataNotes!==undefined&&n.DataNotes!=""&&(f=f+"<p>"+n.DataNotes+"<\/p><br >");e++});f.length<=0&&(f=n===3?"<p>No Data<\/p>":"No Data");r="<b><p>Federal Data: Data Notes<\/b><\/p><br >";u='<table class="table table-bordered" style="width:920px;font-family:sans-serif"> <tbody> <tr> <td class="col-sm-2 bg-blue "><p>'+r+f+"<\/p><\/td><\/tr><\/table>";$("#NPMData").append(u);$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){i!=3&&$("#viewNPMDataModal").modal("show")})}),i==3&&$.when(o).done(function(){$.getJSON("/api/values/GetStateNotes?measureKey="+n+"&state="+r+"&domainId="+u,function(n){var r=0,t,i;f="";t="";n.result.forEach(function(n){if(n.DataNote!==null&&n.DataNote!==undefined){var i="";n.Subheader!=null&&n.Subheader!=undefined&&(i="<b>"+n.Year+" "+n.Subheader+"<\/b><br ><br />");t+=n.DataNote;f=f+"<p>"+i+n.DataNote+"<\/p><br >"}r++});i='<table class="table table-bordered" style="width:920px;font-family:sans-serif"> <tbody> <tr> <td class="col-sm-2 bg-blue "><p>'+f+"<\/p><\/td><\/tr><\/table>";t!=null&&t!=""&&t.length>0&&$("#NPMData").append(e+i);$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){$("#viewNPMDataModal").modal("show")})})}))):$.getJSON("/api/values/GetNpm?id="+n,function(n){npmDetail.find("#measureStatusRow").hide();var t=n.result;$("#viewNPMDataModal").find("#tblHeader").html(t.MeasureTitle);npmDetail.find("#ESMSubGroupRow").hide();npmDetail.find("#ESMStrategyRow").show();npmDetail.find("#esmStrategies").html('<p>For information about evidence-based strategies related to this measure, see<\/p><p><a href="https://www.mchevidence.org/" target="_blank">https://www.mchevidence.org/<\/a><\/p>');npmDetail.find("#goal").html(t.Goal);t.Objective2020===null||t.Objective2020===""?(npmDetail.find("#objectiveHeader").hide(),npmDetail.find("#objective").hide()):(npmDetail.find("#objectiveHeader").show(),npmDetail.find("#objective").show(),npmDetail.find("#objective").html(t.Objective2020==null?"":t.Objective2020.toHtmlBreakFromPipe()));npmDetail.find("#population").show();npmDetail.find("#populationDomain").show();npmDetail.find("#sources").html(t.DataSources);npmDetail.find("#measureDomainRow").show();npmDetail.find("#measureDomain").html(t.MeasureDomain);npmDetail.find("#population").html(t.DomainName);npmDetail.find("#significance").html(t.Significance.replace("http://https:","https:"));npmDetail.find("#numerator").html(t.NumeratorDescription);npmDetail.find("#denominator").html(t.DenominatorDescription);npmDetail.find("#units").html(t.Units);npmDetail.find("#text1").html(t.MeasureTypeText);$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){$("#NPMData").append(npmDetail);$("#viewNPMDataModal").modal("show")})})}function gettitle(n){return n=n.replace(" ","_"),n=n.replace("-","_"),n.replace(":","_")}function getNationalNPMFormattedData(n,t,i,r){var u=[];return n.forEach(function(n){var e=n.Year,o="",f;e.indexOf("_")>0&&(e=e.substr(e.indexOf("_")+1,4),o=n.Year);e=new Date(parseInt(e),0,1);f=n.Name;t==="4"||t==="5"?(f=f.substr(0,f.indexOf("("))+f.substr(f.indexOf(")")+1,f.length),f=f.replace("PM-","")):(f=f.replace(/\(.*?\)/,""),f.indexOf("(PM")>0&&(f=f.substr(0,f.indexOf("(PM"))));t===3&&(f=n.Name);r==!1&&(f="National - "+f);i===3?f.indexOf("ADOLESCENT")<0&&u.push({name:f,value:n.Value,year:new Date(e.getFullYear(),1,1),low:n.Low,high:n.High,text:o}):i===4?f.indexOf("CHILD")<0&&u.push({name:f,value:n.Value,year:new Date(e.getFullYear(),1,1),low:n.Low,high:n.High,text:o}):u.push({name:f,value:n.Value,year:new Date(e.getFullYear(),1,1),low:n.Low,high:n.High,text:o})}),FilterFor17or18Years(17,u)}function FilterFor17or18Years(n,t){var i=Math.max.apply(Math,t.map(function(n){return n.fullYear})),f=Math.min.apply(Math,t.map(function(n){return n.fullYear})),r=n-1,u;return i-f>r&&(u=i-r,t=t.filter(function(n){return n.fullYear>=u})),t}function getLastPartOfTheYear(n){return n.indexOf("_")>0&&(n=n.substr(n.indexOf("_")+1,4),t=e.Year),n=new Date(parseInt(n),0,1),n.getFullYear()}function getStateNPMFormattedData(n,t,i){var r=[];return n.forEach(function(n){var f=n.Year,e="",u;f.indexOf("_")>0&&(f=f.substr(f.indexOf("_")+1,4),e=n.Year);f=new Date(parseInt(f),0,1);measureName=n.Name;u=n.Name;t==="4"||t==="5"?u=u.replace("PM-",""):u.indexOf("(PM")>0&&(u=u.substr(0,u.indexOf("(PM")));u.indexOf("YRBSS")>=0&&(u=u.replace("(YRBSS)",""));u.indexOf("NSCH")>=0&&(u=u.replace("(NSCH)",""));u.indexOf("NNSCH")>=0&&(u=u.replace("(NNSCH)",""));u.indexOf("BRFSS")>=0&&(u=u.replace("(BRFSS)",""));u.indexOf("NVSS")>=0&&(u=u.replace("(NVSS)",""));u.indexOf("NIS")>=0&&(u=u.replace("(NIS)",""));u.indexOf("PRAMS")>=0&&(u=u.replace("(PRAMS)",""));u.indexOf("SID")>=0&&(u=u.replace("(SID)",""));u.indexOf("NS-")>=0&&(u=u.replace("(NS)",""));u.indexOf("MCH-JS")>=0&&(u=u.replace("(MCH-JS)",""));i===3?u.indexOf("ADOLESCENT")<0&&r.push({name:u,value:n.Value,year:new Date(f.getFullYear(),1,1),text:e,low:n.Low,high:n.High,fullYear:f.getFullYear()}):i===4?u.indexOf("CHILD")<0&&r.push({name:u,value:n.Value,year:new Date(f.getFullYear(),1,1),text:e,low:n.Low,high:n.High,fullYear:f.getFullYear()}):r.push({name:u,value:n.Value,year:new Date(f.getFullYear(),1,1),text:e,low:n.Low,high:n.High,fullYear:f.getFullYear()})}),FilterFor17or18Years(18,r)}function viewOldNpmSpmDetailSheet(n,t){var i=n;$("#viewOldNPMDataModal").find("#oldNpmtblHeader").html(t);npmDetail.find("#ESMSubGroupRow").hide();npmDetail.find("#goal").html(i.Goal);npmDetail.find("#objectiveHeader").show();npmDetail.find("#objective").show();npmDetail.find("#objective").html(i.Objective2020===null?"":i.Objective2020.toHtmlBreakFromPipe());npmDetail.find("#sources").html(i.DataSources);npmDetail.find("#population").hide();npmDetail.find("#measureDomainRow").hide();npmDetail.find("#populationDomain").hide();npmDetail.find("#significance").html(i.Significance);npmDetail.find("#definition").html(i.MeasureDefinitionText);npmDetail.find("#numerator").html(i.NumeratorDescription);npmDetail.find("#denominator").html(i.DenominatorDescription);npmDetail.find("#units").html(i.Units);npmDetail.find("#text1").html(i.MeasureTypeText);$("#viewOldNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){$("#oldNPMDetailTable").append(npmDetail);$("#viewOldNPMDataModal").modal("show")})}function viewNomDetailSheet(n,t,i,r){var u,f;if($("#NPMData").empty(),u=n,$("#viewNPMDataModal").find("#tblHeader").html(t),i==="Note")f="",$.getJSON("/api/values/GetFadMeasureMappingsInfoForNoms?MeasureId="+u.MeasureId+"&state="+r,function(n){var i=0,t;n.result.forEach(function(n){n.DataNotes!==null&&n.DataNotes!==undefined&&(f=f+"<p>"+n.DataNotes+"<\/p><br >");i++});f.length<=0&&(f=u.MeasureId===12?"<p>No Data<\/p>":u.MeasureId===13?"<p>No Data<\/p>":"No Data");t='<table class="table table-bordered " style="width:920px;font-family:sans-serif"> <tbody> <tr> <td class="col-sm-2 bg-blue "><p>'+f+"<\/p><\/td><\/tr><\/table>";$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){$("#NPMData").append(t);$("#viewNPMDataModal").modal("show")})});else{npmDetail.find("#goal").html(u.Goal);npmDetail.find("#ESMSubGroupRow").hide();npmDetail.find("#ESMStrategyRow").hide();npmDetail.find("#measureDomainRow").show();u.Objective2020===null||u.Objective2020===""?(npmDetail.find("#objectiveHeader").hide(),npmDetail.find("#objective").hide()):(npmDetail.find("#objectiveHeader").show(),npmDetail.find("#objective").show(),npmDetail.find("#objective").html(u.Objective2020==null?"":u.Objective2020.toHtmlBreakFromPipe()));npmDetail.find("#sources").html(u.DataSources);npmDetail.find("#population").hide();npmDetail.find("#populationDomain").hide();npmDetail.find("#significance").html(u.Significance);npmDetail.find("#definition").html(u.MeasureDefinitionText);npmDetail.find("#numerator").html(u.NumeratorDescription);npmDetail.find("#denominator").html(u.DenominatorDescription);npmDetail.find("#units").html(u.Units);npmDetail.find("#text1").html(u.MeasureTypeText);$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){$("#NPMData").append(npmDetail);$("#viewNPMDataModal").modal("show")})}}function drawChartModal(n,t,r,u,f,e,o){var s,h,c,l,a;(t===null||t===undefined)&&(t=n);s=0;(t.isNom||t.isEsm||t.zoomFlag)&&$("#modalChartZoomBtn").hide();f!=!0?($("#modalChartErrorBarsBtn").hide(),$("#modalNoteTotal").hide(),$("#modalNoteStratifier").hide()):(e?($("#modalNoteStratifier").show(),$("#modalNoteTotal").hide()):($("#modalNoteStratifier").hide(),$("#modalNoteTotal").show()),$("#modalNote").show());n.categoryAxis.title.text==="National Performance Measures"?$("#modalNpmDistributionFootNote").show():$("#modalNpmDistributionFootNote").hide();var v=t.valueAxis.max,y=t.valueAxis.min,p=t.valueAxis.majorUnit;t.valueAxis.majorGridlines=n.valueAxis.majorGridlines=!0;t.categoryAxis.majorGridlines=n.categoryAxis.majorGridlines=!0;n.seriesClick=function(n){n.preventDefault()};n.seriesHover=function(n){n.sender.element[0].style.cursor="default"};$("#modalChart").kendoChart(n);modalChart=$("#modalChart").getKendoChart();o&&modalChart.bind("legendItemClick",multiLevelStackedchart_legendClick);r!=null&&r!=undefined&&r==!1?(h="watermarkSPMZoom",$('<div  class="'+h+'">Inactive - See Detail Sheet<\/div>').prependTo(modalChart.element[0]),$(modalChart.element[0]).children("svg")[0].style.opacity=1,$("#modalChartDownloadBtn").hide()):$("#modalChartDownloadBtn").show();modalChart.options.categoryAxis=n.categoryAxis;$("#viewChartModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){var t=$("#viewChartModal > .modal-dialog ");if(n.seriesDefaults.type==="funnel"){t.removeClass("modal-lg");$("#viewChartModal").modal().off("hidden.bs.modal").on("hidden.bs.modal",function(){t.addClass("modal-lg")})}else t.hasClass("modal-lg")||t.addClass("modal-lg");$("#modalChart").data("kendoChart").redraw()});if(c=$("#Zoom-switch").data("kendoMobileSwitch"),c.check(!1),!t.isNom)$("#modalChartZoomBtn").off("click").on("click",function(){var e,t,r,u,f;if($(this).find(".btn").toggleClass("active"),$(this).find(".btn-success").length>0&&$(this).find(".btn").toggleClass("btn-success"),$(this).find(".btn").toggleClass("btn-default"),s===0){for(e=n.title.text+".png",t=[],i=0;i<n.series.length;i++)for(j=0;j<n.series[i].data.length;j++)t.push(n.series[i].data[j].value);r=Math.min.apply(Math,t);u=Math.max.apply(Math,t);n.valueAxis.max=Math.ceil(u)+5;n.valueAxis.min=Math.floor(r)-5;n.valueAxis.majorUnit=10;f=Math.ceil((n.valueAxis.max-n.valueAxis.min)/n.valueAxis.majorUnit);n.valueAxis.max=n.valueAxis.min+f*n.valueAxis.majorUnit;s=1}else n.valueAxis.max=v,n.valueAxis.min=y,n.valueAxis.majorUnit=p,s=0;$("#modalChart").kendoChart(n);$("#modalChart").data("kendoChart").redraw()});l=$("#Errorbar-switch").data("kendoMobileSwitch");l.check(!1);$("#modalChartErrorBarsBtn").off("click").on("click",function(){$(this).find(".btn").toggleClass("active");$(this).find(".btn-success").length>0&&$(this).find(".btn").toggleClass("btn-success");$(this).find(".btn").toggleClass("btn-default");n.series.forEach(function(n){n.errorBars.visible=n.errorBars.visible===!1?!0:!1});$("#modalChart").kendoChart(n);$("#modalChart").data("kendoChart").redraw();modalChart=$("#modalChart").getKendoChart()});a=$("#Labels-switch").data("kendoMobileSwitch");a.check(!0);$("#modalLabelsBtn").off("click").on("click",function(){if($(this).find(".btn").toggleClass("active"),$(this).find(".btn-success").length>0&&$(this).find(".btn").toggleClass("btn-success"),$(this).find(".btn").toggleClass("btn-default"),n.series.forEach(function(n){n.labels.visible=n.labels.visible===!1?!0:!1}),$("#modalChart").kendoChart(n),$("#modalChart").data("kendoChart").redraw(),modalChart=$("#modalChart").getKendoChart(),r!=null&&r!=undefined&&r==!1)$(modalChart.element[0]).children(".watermarkSPMZoom").length<=0&&$('<div  class="watermarkSPMZoom">Inactive - See Detail Sheet<\/div>').prependTo(modalChart.element[0]),$(modalChart.element[0]).children("svg")[0].style.opacity=1});$("#modalChartDownloadBtn").off("click").on("click",function(){modalChart=$("#modalChart").getKendoChart();var t=n.title.text.substr(0,256)+".png";u!=null&&u!=undefined&&u.length>1&&(t=u+".png");modalChart.exportImage().done(function(n){kendo.saveAs({dataURI:n,fileName:t})})})}function drawChartModalStack(n,t,i){var u,r;(t===null||t===undefined)&&(t=n);u=0;(t.isNom||t.isEsm||t.zoomFlag)&&$("#modalChartZoomBtn").hide();var f=t.valueAxis.max,e=t.valueAxis.min,o=t.valueAxis.majorUnit;t.valueAxis.majorGridlines=n.valueAxis.majorGridlines=!0;t.categoryAxis.majorGridlines=n.categoryAxis.majorGridlines=!0;$("#modalChart").kendoChart(n);modalChart=$("#modalChart").getKendoChart();$("#viewChartModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){var t=$("#viewChartModal > .modal-dialog ");if(n.seriesDefaults.type==="funnel"){t.removeClass("modal-lg");$("#viewChartModal").modal().off("hidden.bs.modal").on("hidden.bs.modal",function(){t.addClass("modal-lg")})}else t.hasClass("modal-lg")||t.addClass("modal-lg");$("#modalChart").data("kendoChart").redraw();modalChart=$("#modalChart").getKendoChart()});$("#modalChartDownloadBtn").off("click").on("click",function(){modalChart=$("#modalChart").getKendoChart();modalChart.exportImage().done(function(n){kendo.saveAs({dataURI:n,fileName:i.downloadFileName})})});r=$("#Labels-switch").data("kendoMobileSwitch");r.check(!0);$("#modalLabelsBtn").off("click").on("click",function(){$(this).find(".btn").toggleClass("active");$(this).find(".btn-success").length>0&&$(this).find(".btn").toggleClass("btn-success");$(this).find(".btn").toggleClass("btn-default");n.series.forEach(function(n){n.labels.visible=n.labels.visible===!1?!0:!1});$("#modalChart").kendoChart(n);$("#modalChart").data("kendoChart").redraw()})}function viewChartDatagrid(n,t,i,r,u){var f=n.toHtmlBreakFromPipe();viewDataDiv.find(".gridHeader").html(f);viewDataDiv.find(".grid").kendoGrid({dataSource:t,columns:[{title:"Category",field:"categoryTitle",headerAttributes:{style:"text-align:center;"}},{title:i,field:"value",format:r,attributes:{style:"text-align:right;"},headerAttributes:{style:"text-align:center;"}}],scrollable:!1,excel:{fileName:u===undefined||u==""||u==null?n+".xlsx":u+".xlsx"}});viewDataDiv.find("#footnote2").hide();viewDataDiv.find("#footnote").hide();viewDataDiv.find("#footnote1").hide();t.forEach(function(n){n.categoryTitle==="Others*"&&viewDataDiv.find("#footnote").show();n.categoryTitle==="Hospital Charges*"&&viewDataDiv.find("#footnote1").show();n.categoryTitle==="Children 1 through 21 Years^"&&viewDataDiv.find("#footnote2").show()});viewDataDiv.find("#viewDataDivDownloadBtn").off("click").on("click",function(){var n=viewDataDiv.find(".grid").data("kendoGrid");n.saveAsExcel()});viewDataDiv.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewDataDiv.find("th").addClass("white");viewDataDiv.modal("show");viewDataDiv.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewDataDiv.find(".grid");n.data("kendoGrid").destroy();n.empty()})}function getNomLineChartDatagrid(n,t){function r(n){var t=n.sender.wrapper,i=n.sender.table;t.toggleClass("no-scrollbar",!0)}viewLineDataDivTable.find(".grid").empty();viewLineDataDivTable.find(".grid").data=[];viewLineDataDivTable.find(".grid").width="600px";var i=createMeasureTableArray(n,t);return viewLineDataDivTable.find(".grid").kendoGrid({dataSource:{data:i},columns:columnsConfig,sortable:!1,dataBound:r,scrollable:!0}),viewLineDataDivTable.find("table").addClass("table").addClass("table-striped").addClass("table-primary"),viewLineDataDivTable.find("a").addClass("white"),viewLineDataDivTable[0].outerHTML}function viewNomLineChartDatagrid(n){function r(n){var t=n.sender.wrapper,i=n.sender.table;t.toggleClass("no-scrollbar",!0)}var i=n.chartTitle.toHtmlBreakFromPipe();viewLineDataDivNPM.find(".gridHeader").html(i);viewLineDataDivNPM.find(".grid").data=[];viewLineDataDivNPM.find(".grid").width="600px";var t=createMeasureTableArray(n.tableData,"NOM");viewLineDataDivNPM.find(".grid").kendoGrid({excelExport:function(n){for(var i,t,u=n.workbook.sheets[0],r=1;r<u.rows.length;r++)for(i=u.rows[r],t=1;t<i.cells.length;t++)i.cells[t].value!==undefined&&i.cells[t].value!==null&&i.cells[t].value.indexOf("<sup>")>=0&&(i.cells[t].value=i.cells[t].value.substr(0,i.cells[t].value.indexOf("<sup>")))},dataSource:{data:t},columns:columnsConfig,sortable:{mode:"single",allowUnsort:!0},dataBound:r,scrollable:!0,excel:{fileName:n.excelFileName===undefined||n.excelFileName==""||n.excelFileName==null?n.headerTitle+".xlsx":n.excelFileName+".xlsx"}});viewLineDataDivNPM.find("#viewLineDataDivDownloadBtn").off("click").on("click",function(){var n=viewLineDataDivNPM.find(".grid").data("kendoGrid"),t=$(".grid").data("kendoGrid");n.saveAsExcel()});n.ShowSecondaryMessage?(viewLineDataDivNPM.find("#footnote1").show(),viewLineDataDivNPM.find("#footnote1Text").text(n.SecondaryMessage)):viewLineDataDivNPM.find("#footnote1").hide();viewLineDataDivNPM.find("#footnote3").hide();viewLineDataDivNPM.find("#footnote4").hide();t.forEach(function(t){for(var i in t)t[i]!=null&&t[i].length>0&&(t[i].indexOf("<sup><i class='fa fa-flash text-primary'")>=0&&(viewLineDataDivNPM.find("#footnote3span").text(n.interpretWithCautionText),viewLineDataDivNPM.find("#footnote3").show()),t[i].indexOf("<sup><i class='fa fa-flag text-warning'")>=0&&(viewLineDataDivNPM.find("#footnote4span").text(n.dataNotReportableText),viewLineDataDivNPM.find("#footnote4").show()))});viewLineDataDivNPM.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewLineDataDivNPM.find("a").addClass("white");viewLineDataDivNPM.modal("show");viewLineDataDivNPM.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewLineDataDivNPM.find(".grid");n.data("kendoGrid").destroy();n.empty()})}function viewEsmLineChartDatagrid(n,t,i){function f(n){var t=n.sender.wrapper,i=n.sender.table;t.toggleClass("no-scrollbar",!0)}var r;viewLineDataDivNPM.find("#footnote1").hide();viewLineDataDivNPM.find("#footnote3").hide();viewLineDataDivNPM.find("#footnote4").hide();r=n.toHtmlBreakFromPipe();viewLineDataDivNPM.find(".gridHeader").html(r);viewLineDataDivNPM.find(".grid").data=[];viewLineDataDivNPM.find(".grid").width="600px";var u=createMeasureTableArray(t);viewLineDataDivNPM.find(".grid").kendoGrid({dataSource:{data:u},columns:columnsConfig,sortable:{mode:"single",allowUnsort:!0},dataBound:f,scrollable:!0,excel:{fileName:i===undefined||i==""||i==null?n+".xlsx":i+".xlsx"}});viewLineDataDivNPM.find("#viewLineDataDivDownloadBtn").off("click").on("click",function(){var n=viewLineDataDivNPM.find(".grid").data("kendoGrid"),t=$(".grid").data("kendoGrid");n.saveAsExcel()});viewLineDataDivNPM.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewLineDataDivNPM.find("a").addClass("white");viewLineDataDivNPM.modal("show");viewLineDataDivNPM.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewLineDataDivNPM.find(".grid");n.data("kendoGrid").destroy();n.empty()})}function viewLineChartDatagrid(n,t,i,r,u){function l(n){var t=n.sender.wrapper,i=n.sender.table;t.toggleClass("no-scrollbar",!0)}var y=n.indexOf("NPM"),s,f,o,h,c,a,e,p,w,v;if(viewLineDataDivNPM.find("#footnote3").hide(),viewLineDataDivNPM.find("#footnote4").hide(),s=n.indexOf("SPM"),y<0&&s<0&&n.indexOf("SOM")<0){e=n.toHtmlBreakFromPipe();f=[];o=[];t.forEach(function(n){f.push(n.name);o.push(n.year)});f=f.unique();o=o.unique();h=[];c=[];t.forEach(function(n){n.name==="Federal"||n.name===f[0]?h.push({Federal:n.value,year:n.year}):c.push({NonFederal:n.value,year:n.year})});a=h.map(function(n){var t;return $.each(c,function(i,r){if(r.year===n.year)return t=$.extend({},n,r),!1;t=n}),t});viewLineDataDiv.find(".gridHeader").html(e);viewLineDataDiv.find(".grid").data=[];viewLineDataDivNPM.find(".grid").width="620px";viewLineDataDiv.find(".grid").kendoGrid({dataSource:a,sortable:{mode:"single",allowUnsort:!0},columns:[{title:"Year",field:"year",headerAttributes:{style:"text-align:center;"}},{title:f[0],field:"Federal",attributes:{style:"text-align:right;"},format:"{0:C0}",headerAttributes:{style:"text-align:center;"}},{title:f[1],field:"NonFederal",attributes:{style:"text-align:right;"},format:"{0:C0}",headerAttributes:{style:"text-align:center;"}}],dataBound:l,scrollable:!0,excel:{fileName:i===undefined||i===""||i===null?n+".xlsx":i+".xlsx"}});viewLineDataDiv.find("#viewLineDataDivDownloadBtn").off("click").on("click",function(){var n=viewLineDataDiv.find(".grid").data("kendoGrid");n.saveAsExcel()});viewLineDataDiv.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewLineDataDiv.find("a").addClass("white");viewLineDataDiv.modal("show");viewLineDataDiv.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewLineDataDiv.find(".grid");n.data("kendoGrid").destroy();n.empty()})}else{e=n;e=e.toHtmlBreakFromPipe();viewLineDataDivNPM.find(".gridHeader").html(e);viewLineDataDivNPM.find(".grid").data=[];viewLineDataDivNPM.find(".grid").width="620px";p=!0;w=[];v=s>=0||n.indexOf("SOM")>=0?createMeasureTableArray(t,"SPM"):createMeasureTableArray(t);viewLineDataDivNPM.find(".grid").kendoGrid({dataSource:{data:v},columns:columnsConfig,sortable:{mode:"single",allowUnsort:!0},dataBound:l,scrollable:!0,excel:{fileName:i===undefined||i==""||i==null?n+".xlsx":i+".xlsx"}});viewLineDataDivNPM.find("#viewLineDataDivDownloadBtn").off("click").on("click",function(){var n=viewLineDataDivNPM.find(".grid").data("kendoGrid"),t=$(".grid").data("kendoGrid");n.saveAsExcel()});r?(viewLineDataDivNPM.find("#footnote1").show(),viewLineDataDivNPM.find("#footnote1Text").text(u)):viewLineDataDivNPM.find("#footnote1").hide();viewLineDataDivNPM.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewLineDataDivNPM.find("a").addClass("white");viewLineDataDivNPM.modal("show");viewLineDataDivNPM.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewLineDataDivNPM.find(".grid");n.data("kendoGrid").destroy();n.empty()})}}function viewMultiYearColumnGroupChartDatagrid(n,t,i,r,u){function e(n){var t=n.sender.wrapper,i=n.sender.table;t.toggleClass("no-scrollbar",!0)}(u===null||u===undefined)&&(u="Value");var f=n.toHtmlBreakFromPipe();viewDataDiv.find(".gridHeader").html(f);viewDataDiv.find(".grid").data=[];viewDataDiv.find(".grid").width="600px";viewDataDiv.find(".grid").kendoGrid({dataSource:{data:t},columns:columnsConfig,sortable:{mode:"single",allowUnsort:!0},dataBound:e,scrollable:!0,excel:{fileName:r===undefined||r===""||r===null?n+".xlsx":r+".xlsx"}});viewDataDiv.find("#footnote").hide();viewDataDiv.find("#footnote1").hide();viewDataDiv.find("#footnote2").hide();t.forEach(function(n){n.DataSource==="Others*"&&viewDataDiv.find("#footnote").show();n.DataSource==="Hospital Charges*"&&viewDataDiv.find("#footnote1").show();n.DataSource==="Children 1 through 21 Years^"&&viewDataDiv.find("#footnote2").show()});viewDataDiv.find("#viewDataDivDownloadBtn").off("click").on("click",function(){var n=viewDataDiv.find(".grid").data("kendoGrid");n.saveAsExcel()});viewDataDiv.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewDataDiv.find("a").addClass("white");viewDataDiv.modal("show");viewDataDiv.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewDataDiv.find(".grid");n.data("kendoGrid").destroy();n.empty()})}function viewColumngroupChartDatagrid(n,t,i,r,u){var f,e;(u===null||u===undefined)&&(u="Value");f=n.toHtmlBreakFromPipe();viewDataDiv.find(".gridHeader").html(f);e=new kendo.data.DataSource({data:t});viewDataDiv.find(".grid").kendoGrid({dataSource:e,columns:[{title:"Category",field:"name",sort:"asc",headerAttributes:{style:"text-align:center;"}},{title:u,field:"value",format:i,attributes:{style:"text-align:right;"},headerAttributes:{style:"text-align:center;"}}],scrollable:!1,excel:{fileName:r===undefined||r==""||r==null?n+".xlsx":r+".xlsx"}});viewDataDiv.find("#footnote").hide();viewDataDiv.find("#footnote1").hide();viewDataDiv.find("#footnote2").hide();t.forEach(function(n){n.name==="Others*"&&viewDataDiv.find("#footnote").show()});viewDataDiv.find("#viewDataDivDownloadBtn").off("click").on("click",function(){var n=viewDataDiv.find(".grid").data("kendoGrid");n.saveAsExcel()});viewDataDiv.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewLineDataDiv.find("th").addClass("white");viewDataDiv.modal("show");viewDataDiv.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewDataDiv.find(".grid");n.data("kendoGrid").destroy();n.empty()})}function viewColumnChartDatagrid(n,t,i,r,u,f,e,o,s){var c=n.toHtmlBreakFromPipe(),h;viewBigDataDiv.find(".gridHeader").html(c);h=new kendo.data.DataSource({data:t});viewBigDataDiv.find(".grid").empty();viewBigDataDiv.find(".grid").kendoGrid({excelExport:function(n){for(var i,t,u=n.workbook.sheets[0],r=0;r<u.rows.length;r++)for(i=u.rows[r],t=2;t<i.cells.length;t++)r==0&&(i.cells[t].value=i.cells[t].value.replace(/<br>/g," "),i.cells[t].value=i.cells[t].value.replace(/- /g,"-"))},dataSource:h,columns:i,scrollable:!1,excel:{fileName:u===undefined||u==""||u==null?n+".xlsx":u+".xlsx"}});viewDataDiv.find("#footnote").hide();viewDataDiv.find("#footnote1").hide();viewDataDiv.find("#footnote2").hide();viewBigDataDiv.find("#footnote3").hide();viewBigDataDiv.find("#footnote4").hide();t.forEach(function(n){n.name==="Others*"&&viewDataDiv.find("#footnote").show();for(var t in n)n[t].length>0&&(n[t].indexOf('<sup><i class="fa fa-flash text-primary"')>=0&&(viewBigDataDiv.find("#footnote3").show(),viewBigDataDiv.find("#footnote3span").text(i[0].interpretWithCautionText)),n[t].indexOf('<sup><i class="fa fa-flag text-warning"')>=0&&(viewBigDataDiv.find("#footnote4").show(),viewBigDataDiv.find("#footnote4span").text(i[0].dataNotReportableText)))});viewBigDataDiv.find("#viewDataDivDownloadBtn").off("click").on("click",function(){var n,t;r!==undefined&&r.length>0?(n=$.extend(!0,{},viewBigDataDiv.find(".grid").data("kendoGrid")),n.dataSource=new kendo.data.DataSource({data:r}),n.saveAsExcel()):(t=viewBigDataDiv.find(".grid").data("kendoGrid"),t.saveAsExcel())});viewBigDataDiv.find("#footnote1").hide();e&&(viewBigDataDiv.find("#footnote1").show(),o?(viewBigDataDiv.find("#footnote2Conatiner").show(),viewBigDataDiv.find("#footnote2").text(s)):viewBigDataDiv.find("#footnote2Conatiner").hide());viewBigDataDiv.find("table").addClass("table").addClass("table-striped").addClass("table-primary");f||setTimeout(function(){var n=viewBigDataDiv.find(".grid").data("kendoGrid");n.dataSource.read();var t="#f9f9f9",i="#E6EBF6",r=n.dataSource.data();$.each(r,function(n,r){(r.MeasureKeyDisplay=="NPM 7"||r.MeasureKeyDisplay=="NPM 13"||r.MeasureShortName.indexOf("NPM 7")>=0||r.MeasureShortName.indexOf("NPM 13")>=0)&&$('tr[data-uid="'+r.uid+'"] ').css("background-color",t);(r.MeasureKeyDisplay=="NPM 8"||r.MeasureKeyDisplay=="NPM 14"||r.MeasureShortName.indexOf("NPM 8")>=0||r.MeasureShortName.indexOf("NPM 14")>=0)&&$('tr[data-uid="'+r.uid+'"] ').css("background-color",i)})},300);viewBigDataDiv.modal("show");viewBigDataDiv.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewBigDataDiv.find(".grid");n.data("kendoGrid").destroy();n.empty()})}function getForm5Value(n,t,i,r){var f="",e="{0:N1}",u=_.find(r,function(n){return n.year===i});u.field5aCount=u.field5aCount==null?"":u.field5aCount;u.field5a=u.field5a==null?"":u.field5a;u.field5bCount=u.field5bCount==null?"":u.field5bCount;u.field5b=u.field5b==null?"":u.field5b;switch(n){case t+"<br />Form 5a Count <br />Direct and Enabling Services Only":f=kendo.format(e,u.field5aCount).toString().replace(".0","");break;case t+"<br />Form 5a % (Calculated) <br />Direct and Enabling Services Only":f=kendo.format(e,u.field5a).toString();break;case t+"<br />Form 5b Count (Calculated) <br />Direct, Enabling, and Public Health Services and Systems":f=kendo.format(e,u.field5bCount).toString().replace(".0","");break;case t+"<br />Form 5b % <br />Direct, Enabling, and Public Health Services and Systems":f=kendo.format(e,u.field5b).toString()}return f}function viewForm5LineChartDatagrid(n,t,i,r){for(var v,y=n.toHtmlBreakFromPipe(),e=[],f=[],o=2017;o<2017+t.length/2;o++){var p=t.filter(function(n){return n.year==o&&n.name=="Direct and Enabling Services Only"}),w=t.filter(function(n){return n.year==o&&n.name!="Direct and Enabling Services Only"}),s=p[0],l=w[0],b=s.year,k=s.value==null?null:+s.value,d=l.value,g=s.field5aProvided,nt=l.feild5BCalculated;f.push({year:b,field5aCount:g,field5a:k,field5bCount:nt,field5b:d})}var tt=_.keys(_.countBy(f,function(n){return n.year})),h=_.sortBy(tt,function(n){return n}),c=[],u=[],it=f.filter(function(n){return n.field5a!=null}).length,a=f.filter(function(n){return n.field5bCount!=null}).length;r.toLowerCase()=="national"?(t[0].domainName.indexOf("CSHCN")>=0&&(t[0].domainName+="<sup>+*<\/sup>"),u.push(t[0].domainName+"<br />Form 5a Count <br />Direct and Enabling Services Only"),a>0&&u.push(t[0].domainName+"<br />Form 5a % (Calculated) <br />Direct and Enabling Services Only"),a>0&&u.push(t[0].domainName+"<br />Form 5b Count (Calculated) <br />Direct, Enabling, and Public Health Services and Systems"),u.push(t[0].domainName+"<br />Form 5b % <br />Direct, Enabling, and Public Health Services and Systems")):(t[0].domainName.indexOf("CSHCN")>=0&&(t[0].domainName+="<sup>*<\/sup>"),u.push(t[0].domainName+"<br />Form 5b % <br />Direct, Enabling, and Public Health Services and Systems"));$.each(u,function(n,t){var i=h.reduce(function(n,t){return n["w"+t]=null,n},{Source:t});c.push(i)});$.each(c,function(n,i){$.each(h,function(n,u){i["w"+u]=getForm5Value(i.Source,t[0].domainName,u,f,r)})});e=[];e.push({field:"Source",title:"Source",headerAttributes:{style:"text-align:center;width:180px;color:white"},width:"180px",encoded:!1});$.each(h,function(n,t){e.push({field:"w"+t,title:t.toString(),headerAttributes:{style:"text-align:center;"},encoded:!1,width:104+(t.toString().length-4)*5+"px",attributes:{style:"text-align:right;text-overflow:initial;"}})});viewBigDataDivForm5.find(".gridHeader").html(y);v=new kendo.data.DataSource({data:c});viewBigDataDivForm5.find(".grid").kendoGrid({excelExport:function(n){for(var t,i,u=n.workbook.sheets[0],f=new RegExp("<br />","g"),r=1;r<u.rows.length;r++)for(t=u.rows[r],t.cells[0].wrap=!0,t.cells[0].vAlign="top",t.cells[0].value=t.cells[0].value!=null&&t.cells[0].value!=undefined?t.cells[0].value.replace(f," "):t.cells[0].value,i=0;i<t.cells.length;i++)i>0&&(t.cells[i].hAlign="right"),t.cells[i].value=t.cells[i].value.toString().replace("<sup>+<\/sup>","").replace("*","").replace("^","").replace(/,/g,"")},dataSource:v,columns:e,scrollable:!1,sortable:!1,excel:{fileName:i===undefined||i==""||i==null?n+".xlsx":i+".xlsx"}});viewBigDataDivForm5.find("#footnote").hide();viewBigDataDivForm5.find("#footnote1").hide();viewBigDataDivForm5.find("#footnote2").hide();viewBigDataDivForm5.find("#footnote5a").hide();viewBigDataDivForm5.find("#footnote5aNationalCSHCN").hide();viewBigDataDivForm5.find("#form5aStatesRequiredToReportNote").hide();viewBigDataDivForm5.find("#footnote5CSHCN").hide();t[0].domainName.indexOf("CSHCN")>=0&&(viewBigDataDivForm5.find("#footnote5CSHCN").show(),viewBigDataDivForm5.find("#footnote2").show());r.toLowerCase()==="national"&&t[0].domainName.indexOf("CSHCN")>=0&&(viewBigDataDivForm5.find("#footnote2").show(),viewBigDataDivForm5.find("#footnote5aNationalCSHCN").show(),viewBigDataDivForm5.find("#footnote5CSHCN").show());viewBigDataDivForm5.find("#viewDataDivDownloadBtn").off("click").on("click",function(){var n=viewBigDataDivForm5.find(".grid").data("kendoGrid");n.saveAsExcel()});viewBigDataDivForm5.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewBigDataDivForm5.modal("show");viewBigDataDivForm5.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewBigDataDivForm5.find(".grid");n.data("kendoGrid").destroy();n.empty()})}function viewColumnStackChartDatagrid(n,t,i){var u=n.toHtmlBreakFromPipe(),r;viewBigDataDivForm5.find(".gridHeader").html(u);r=new kendo.data.DataSource({data:t});viewBigDataDivForm5.find(".grid").kendoGrid({dataSource:r,columns:[{title:"Source",field:"Source",encoded:!1,width:"150",headerAttributes:{width:"150","class":"form5ViewDataTable"}},{title:"Direct and Enabling Services Only ",headerAttributes:{"class":"form5ViewDataTable"},width:"360",columns:[{title:"Form 5a Count",field:"field5aProvided",attributes:{style:"text-align:right;"},format:"{0:N0}",width:"140",headerAttributes:{width:"140","class":"form5ViewDataTable"},template:'#= kendo.format("{0:N0}", field5aProvided) #'},{title:"Form 5a % (Calculated)",field:"field5a",width:"220",attributes:{style:"text-align:right;"},headerAttributes:{width:"220","class":"form5ViewDataTable"},template:"#= field5a #"}]},{title:"Direct, Enabling, and Public Health Services and Systems ",headerAttributes:{"class":"form5ViewDataTable"},columns:[{field:"feild5BCalculated",title:"Form 5b Count (Calculated)",attributes:{style:"text-align:right;"},format:"{0:N0}",width:"170",headerAttributes:{width:"170","class":"form5ViewDataTable"},template:'#= kendo.format("{0:N0}", feild5BCalculated) #'},{title:"Form 5b %",field:"provided5bPercent",attributes:{style:"text-align:right;"},width:"110",format:"{0:N1}",headerAttributes:{width:"110","class":"form5ViewDataTable"}}]}],scrollable:!1,excelExport:function(n){for(var i,t,u=n.workbook.sheets[0],r=1;r<u.rows.length;r++)for(i=u.rows[r],t=0;t<i.cells.length;t++)i.cells[t].value=i.cells[t].value.toString().replace("<sup>+<\/sup>","").replace("*","").replace("^","").replace(/,/g,"").replace("<br>"," ").replace(/<br>/g," ")},excel:{fileName:i===undefined||i==""||i==null?n+".xlsx":i+".xlsx"}});viewBigDataDivForm5.find(".modal-dialog").css("width",960);viewBigDataDivForm5.find("#footnote").hide();viewBigDataDivForm5.find("#footnote1").hide();viewBigDataDivForm5.find("#footnote2").hide();viewBigDataDivForm5.find("#footnote5aNationalCSHCN").hide();viewBigDataDivForm5.find("#footnote5CSHCN").hide();t.forEach(function(n){n.Source==="Others*"&&(viewBigDataDivForm5.find("#footnote2").show(),viewBigDataDivForm5.find("#form5aStatesRequiredToReportNote").show());viewBigDataDivForm5.find("#footnote5a").show()});viewBigDataDivForm5.find("#viewDataDivDownloadBtn").off("click").on("click",function(){var n=viewBigDataDivForm5.find(".grid").data("kendoGrid");n.saveAsExcel()});viewBigDataDivForm5.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewBigDataDivForm5.modal("show");viewBigDataDivForm5.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewBigDataDivForm5.find(".grid");n.data("kendoGrid").destroy();n.empty()})}function viewFunnelChartDatagrid(n,t,i){var u=n.toHtmlBreakFromPipe(),r;viewDataDiv.find(".gridHeader").html(u);r=new kendo.data.DataSource({data:t});viewDataDiv.find(".grid").kendoGrid({dataSource:r,columns:[{title:"Category",field:"name",sort:"asc",headerAttributes:{style:"text-align:center;"}},{title:"Value",field:"value",attributes:{style:"text-align:right;"},format:"{0:C0}",headerAttributes:{style:"text-align:center;"}}],scrollable:!1,excel:{fileName:i===undefined||i===""||i==null?n+".xlsx":i+".xlsx"}});viewDataDiv.find("#footnote").hide();viewDataDiv.find("#footnote1").hide();viewDataDiv.find("#footnote2").hide();t.forEach(function(n){n.name==="Others*"&&viewDataDiv.find("#footnote").show()});viewDataDiv.find("#viewDataDivDownloadBtn").off("click").on("click",function(){var n=viewDataDiv.find(".grid").data("kendoGrid");n.saveAsExcel()});viewDataDiv.find("table").addClass("table").addClass("table-striped").addClass("table-primary");viewDataDiv.modal("show");viewDataDiv.off("hidden.bs.modal").on("hidden.bs.modal",function(){var n=viewDataDiv.find(".grid");n.data("kendoGrid").destroy();n.empty()})}function createBreak(n){n.replace(/\\n/g,"<br />")}function getUrlVars(){for(var t=[],n,r=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;i<r.length;i++)n=r[i].split("="),t.push(n[0]),t[n[0]]=n[1];return t}function getValueAtIndex(n){var t=window.location.href;return t.split("/")[n]}function labelDisplay(n){return n==="Children 1 through 21 Years"||n==="CSHCN"?n==="Children 1 through 21 Years"?"Children \n 1 through 21 Years":n:""}function abbrNum(n,t,i){var u,r,f;for(t=Math.pow(10,t),u=["K","M","B","T"],r=u.length-1;r>=0;r--)if(f=Math.pow(10,(r+1)*3),f<=n){n=Math.round(n*t/f)/t;n===1e3&&r<u.length-1&&(n=1,r++);n+=u[r];break}return i===1?"$"+n:n}function getPopulationData(n,t,i,r){reportingYear=n-2;appYear=n;fedexpendedData=[];fedBudgetedData=[];nonfedExpendedData=[];nonfedBudgetedData=[];individualServedData1=[];individualServedData2=[];var u=$.getJSON("/api/values/GetFinancialFundingByIndividualsServedFederalBarData?year="+n+"&id="+t+"&isBudgeted=false",[],function(n){n.result.columnChartData.forEach(function(n){fedexpendedData.push({name:n.Name,value:n.Value,year:n.Year})})}),f=$.getJSON("/api/values/GetFinancialFundingByIndividualsServedFederalBarData?year="+n+"&id="+t+"&isBudgeted=true",[],function(n){n.result.columnChartData.forEach(function(n){fedBudgetedData.push({name:n.Name,value:n.Value,year:n.Year})})}),e=$.getJSON("/api/values/GetFinancialFundingByIndividualsServedNonFederalBarData?year="+n+"&id="+t+"&isBudgeted=false",[],function(n){n.result.columnChartData.forEach(function(n){nonfedExpendedData.push({name:n.Name,value:n.Value,year:n.Year})})}),o=$.getJSON("/api/values/GetFinancialFundingByIndividualsServedNonFederalBarData?year="+n+"&id="+t+"&isBudgeted=true",[],function(n){n.result.columnChartData.forEach(function(n){nonfedBudgetedData.push({name:n.Name,value:n.Value,year:n.Year})})});$.when(f,o).then(function(){$.when(u,e).then(function(){displayChart(i,t,r)})})}function getPopomainNameFromDescription(n){var t="";switch(n){case"Women/Maternal Health":t="Pregnant Women";break;case"Perinatal/Infant Health":t="Infants < 1 Year";break;case"Child Health":t="Children 1 through 21 Years";break;case"Adolescent Health":t="Children 1 through 21 Years";break;case"Children with Special Health Care Needs":t="CSHCN";break;case"Cross-Cutting/Systems Building":t="CSHCN"}return t}function displayChart(n,t,i){Budgeted=getDomainData(fedBudgetedData,n,"1Federal: - ");Budgeted=Budgeted.concat(getDomainData(nonfedBudgetedData,n,"2Non-Federal: - "));Expended=getDomainData(fedexpendedData,n,"1Federal: - ");Expended=Expended.concat(getDomainData(nonfedExpendedData,n,"2Non-Federal: - "));t==="00"&&(t="National");n=getPopomainNameFromDescription(populationDomain);var r=!1;pbChart1.change(Expended,i,0,n,r);pbChart2.change(Budgeted,i,0,n,r);piechart2.change(getPieChart(fedBudgetedData,nonfedBudgetedData,populationDomain),i,0,n,r);piechart1.change(getPieChart(fedexpendedData,nonfedExpendedData,populationDomain),i,0,n,r)}function getPieChart2(n){var t=[],i=["#d3d3d3","#bdbdbd","#a8a8a8","#939393","#7e7e7e"];return n.forEach(function(n,r){var u="#F25022";switch(populationDomain){case"Women/Maternal Health":n.Category.indexOf("Pregnant Women")>=0?t.push({categoryTitle:n.CategoryTitle,category:n.Category,value:n.Value,Year:n.Year,explode:!0,color:u}):t.push({categoryTitle:n.CategoryTitle,category:n.Category,value:n.Value,Year:n.Year,color:i[r++]});break;case"Perinatal/Infant Health":n.Category.indexOf("Infants < 1 Year")>=0?t.push({categoryTitle:n.CategoryTitle,category:n.Category,value:n.Value,Year:n.Year,explode:!0,color:u}):t.push({categoryTitle:n.CategoryTitle,category:n.Category,value:n.Value,Year:n.Year,color:i[r++]});break;case"Children with Special Health Care Needs":n.Category.indexOf("CSHCN")>=0?t.push({categoryTitle:n.CategoryTitle,category:n.Category,value:n.Value,Year:n.Year,explode:!0,color:u}):t.push({categoryTitle:n.CategoryTitle,category:n.Category,value:n.Value,Year:n.Year,color:i[r++]});break;case"Cross-Cutting/Systems Building":n.Category.indexOf("Others")>=0?t.push({categoryTitle:n.CategoryTitle+"*",category:n.Category+"*",value:n.Value,Year:n.Year,explode:!0,color:u}):t.push({categoryTitle:n.CategoryTitle+"*",category:n.Category+"*",value:n.Value,Year:n.Year,color:i[r++]});break;case"Child Health":n.Category.indexOf("Children 1 through 21 Years")>=0?t.push({categoryTitle:n.CategoryTitle+"^",category:n.Category+"^",value:n.Value,Year:n.Year,explode:!0,color:u}):t.push({categoryTitle:n.CategoryTitle,category:n.Category,value:n.Value,Year:n.Year,color:i[r++]});break;case"Adolescent Health":n.Category.indexOf("Children 1 through 21 Years")>=0?t.push({categoryTitle:n.CategoryTitle+"^",category:n.Category+"^",value:n.Value,Year:n.Year,explode:!0,color:u}):t.push({categoryTitle:n.CategoryTitle,category:n.Category,value:n.Value,Year:n.Year,color:i[r++]})}}),t}function getPieChart(n,t,i){var r=[],u=["#d3d3d3","#bdbdbd","#a8a8a8","#939393","#7e7e7e"];return n.forEach(function(n,f){t.forEach(function(t){var e="#F25022";n.name.indexOf("Pregnant Women")>0&&t.name.indexOf("Pregnant Women")>0&&(value=n.value+t.value,i==="Women/Maternal Health"?r.push({categoryTitle:"Pregnant Women",category:"Pregnant Women",value:value,year:n.year,explode:!0,color:e}):r.push({categoryTitle:"Pregnant Women",category:"Pregnant Women",value:value,year:n.year,color:u[f++]}));n.name.indexOf("Infants < 1 Year")>0&&t.name.indexOf("Infants < 1 Year")>0&&(value=n.value+t.value,i==="Perinatal/Infant Health"?r.push({categoryTitle:"Infants < 1 Year",category:"Infants < 1 Year",value:value,year:n.year,explode:!0,color:e}):r.push({categoryTitle:"Infants < 1 Year",category:"Infants < 1 Year",value:value,year:n.year,color:u[f++]}));n.name.indexOf("CSHCN")>0&&t.name.indexOf("CSHCN")>0&&(value=n.value+t.value,i==="Children with Special Health Care Needs"?r.push({categoryTitle:"CSHCN",category:"CSHCN",value:value,year:n.year,explode:!0,color:e}):r.push({categoryTitle:"CSHCN",category:"CSHCN",value:value,year:n.year,color:u[f++]}));n.name.indexOf("Others")>0&&t.name.indexOf("Others")>0&&(value=n.value+t.value,i==="Cross-Cutting/Systems Building"?r.push({categoryTitle:"Others*",category:"Others*",value:value,year:n.year,explode:!0,color:e}):r.push({categoryTitle:"Others*",category:"Others*",value:value,year:n.year,color:u[f++]}));n.name.indexOf("Children 1 through 21 Years")>0&&t.name.indexOf("Children 1 through 21 Years")>0&&(value=n.value+t.value,i==="Adolescent Health"||i==="Child Health"?r.push({categoryTitle:"Children 1 through 21 Years^",category:"Children 1 through 21 Years^",value:value,year:n.year,explode:!0,color:e}):r.push({categoryTitle:"Children 1 through 21 Years",category:"Children 1 through 21 Years",value:value,year:n.year,color:u[f++]}))})}),r}function getDomainData(n,t,i){var r=[];return n.forEach(function(n){switch(t){case"Women/Maternal Health":n.name.indexOf("Pregnant Women")>0&&r.push({name:i+kendo.toString(n.value,"C0"),value:n.value,year:n.year});break;case"Perinatal/Infant Health":n.name.indexOf("Infants < 1 Year")>0&&r.push({name:i+kendo.toString(n.value,"C0"),value:n.value,year:n.year});break;case"Children with Special Health Care Needs":n.name.indexOf("CSHCN")>0&&r.push({name:i+kendo.toString(n.value,"C0"),value:n.value,year:n.year});break;case"Child Health":n.name.indexOf("Children 1 through 21 Years")>0&&r.push({name:i+kendo.toString(n.value,"C0"),value:n.value,year:n.year});break;case"Adolescent Health":n.name.indexOf("Children 1 through 21 Years")>0&&r.push({name:i+kendo.toString(n.value,"C0"),value:n.value,year:n.year});break;case"Cross-Cutting/Systems Building":n.name.indexOf("Others")>0&&r.push({name:i+kendo.toString(n.value,"C0"),value:n.value,year:n.year})}}),r}function generateLink(n,t){var i=document.createElement("a");return i.download=n,i.href=t,i}function triggerDownload(n){var i=document.createEvent("Event"),t;i.initEvent("submit",!1,!0);t=document.createElement("a");t.setAttribute("download","measureDistributionMap.svg");t.setAttribute("href",n);t.dispatchEvent(i)}function changeLegendMarker(n){var e=n.options.labels.color,i=n.createVisual(),r=i.bbox().size,o=new kendo.geometry.Rect([0,0],[r.width+30,r.height]),t=new kendo.drawing.Layout(o,{spacing:5,alignItems:"center"}),u=n.active?"☑":"☐",f;return n.active==undefined&&(u=n.options.labels.color===n.sender.options.legend.inactiveItems.labels.color?"☐":"☑"),f=new kendo.drawing.Text(u,[0,0],{fill:{color:e},font:"14px sans-serif"}),t.append(f,i),t.reflow(),t}function downloadMapImage(n,t,i,r){var u=$(n),e=document.getElementById("canvas").getContext("2d",{preserveDrawingBuffer:!0});e.clearRect(0,0,u[0].width,u[0].height);d3.selectAll(".legend").style("font-family","open_sansregular, Arial, Helvetica, sans-serif");var h=$(t).find("svg"),o=(new XMLSerializer).serializeToString(h[0]),c=window.URL||window.webkitURL||window,f=new Image,l=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),s="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(o);f.src=s;f.onload=function(){e.drawImage(f,0,0);var n=!1;try{u[0].toDataURL("image/png")}catch(t){n=!0;$(i).hide()}n?window.navigator.msSaveBlob(l,r+".svg"):(c.revokeObjectURL(s),$(i).show(),downloadMap(i,r),$(i).hide())}}function downloadMap(n,t){kendo.drawing.drawDOM($(n)).then(function(n){return n.transform(kendo.geometry.transform().translate(1024,786).scale(1,1)),kendo.drawing.exportImage(n)}).done(function(n){kendo.saveAs({dataURI:n,fileName:t+".png"})})}var nullListEsm=[{name:"",value:"",text:"2025"}],states=$("#stateData").data("state"),mchDataCapacityStates=$("#mchDataCapacityStateData").data("state"),somStates=$("#somData").data("state"),spmStates=$("#spmData").data("state"),domainStates=$("#domainStateData").data("state"),years=$("#reportingYearData").data("state"),yearsWithSeparator=$("#applicationYearDataWithSeparator").data("state"),applicationYears=$("#applicationYearData").data("state"),populationDomainList=$("#populationDomainData").data("state"),allNPM=$("#allPerformanceMeasures").data("state"),npmDetail=$(' <table class="table table-bordered" style="width:920px;font-family:sans-serif"><tbody><tr style="display: none;" id="measureStatusRow"><td class="col-sm-2 bg-gray">Measure Status<\/td> <td class="col-sm-10 bg-blue" id="measureStatus"><\/td> <\/tr><tr style="display: none;" id="ESMSubGroupRow"><td class="col-sm-2 bg-gray">ESM Subgroup(s):<\/td> <td class="col-sm-10 bg-blue" id="ESMSubGroup"><\/td> <\/tr><tr><td class="col-sm-2 bg-gray">Goal<\/td> <td class="col-sm-10 bg-blue" id="goal"><\/td> <\/tr><tr><td class="col-sm-2 bg-gray">Definition<\/td><td class="col-sm-6"> <p id="definition"><\/p><table class="table table-bordered"><tbody><tr><td class="bg-gray">Unit Type<\/td><td id="text1" class="bg-blue"><\/td><\/tr><tr><td class="bg-gray">Unit Number<\/td> <td id="units" class=""><\/td><\/tr><tr><td class="bg-gray">Numerator<\/td><td id="numerator" class=""><\/td><\/tr><tr><td class="bg-gray">Denominator<\/td><td id="denominator" class="bg-blue"><\/td><\/tr><\/tbody><\/table><\/td><\/tr><tr style="display: none;" id="ESMStrategyRow"><td class="col-sm-2 bg-gray">Evidence-Based Strategies<\/td><td class="col-sm-6" id="esmStrategies"><\/td><\/tr><tr><td id="objectiveHeader" class="col-sm-2 bg-gray">Healthy People 2030 Objective<\/td><td class="col-sm-6 bg-blue" style="color: black;" id="objective"><\/td><\/tr><tr><td class="col-sm-2 bg-gray">Data Sources<\/td><td class="col-sm-6" id="sources"><\/td><\/tr><tr style="display: none;" id="measureDomainRow"><td class="col-sm-2 bg-gray">Measure Domain<\/td><td class="col-sm-6" id="measureDomain"><\/td><\/tr><tr><td id="populationDomain" class="col-sm-2 bg-gray">MCH Population Domain<\/td><td class="col-sm-6 bg-blue" id="population"><\/td><\/tr><tr><td class="col-sm-2 bg-gray">Significance<\/td><td class="col-sm-6" id="significance" style="word-break:break-all;width:500px;"><\/td><\/tr><\/tbody><\/table>'),stateMeasuresDetail=$(' <table class="table table-bordered" style="width:920px;font-family:sans-serif"><tbody><tr style="display: none;" id="measureStatusRow"><td class="col-sm-2 bg-gray">Measure Status<\/td> <td class="col-sm-10 bg-blue" id="measureStatus"><\/td> <\/tr><tr style="display: none;" id="ESMSubGroupRow"><td class="col-sm-2 bg-gray">ESM Subgroup(s):<\/td> <td class="col-sm-10 bg-blue" id="ESMSubGroup"><\/td> <\/tr><tr><td class="col-sm-2 bg-gray">Goal<\/td> <td class="col-sm-10 bg-blue" id="goal"><\/td> <\/tr><tr><td class="col-sm-2 bg-gray">Definition<\/td><td class="col-sm-6"> <p id="definition"><\/p><table class="table table-bordered"><tbody><tr><td class="bg-gray">Unit Type<\/td><td id="text1" class="bg-blue"><\/td><\/tr><tr><td class="bg-gray">Unit Number<\/td> <td id="units" class=""><\/td><\/tr><tr><td class="bg-gray">Numerator<\/td><td id="numerator" class=""><\/td><\/tr><tr><td class="bg-gray">Denominator<\/td><td id="denominator" class="bg-blue"><\/td><\/tr><\/tbody><\/table><\/td><\/tr><tr style="display: none;" id="ESMStrategyRow"><td class="col-sm-2 bg-gray">Evidence-based/informed strategy<\/td><td class="col-sm-6" id="esmStrategy"><\/td><\/tr><tr><td id="objectiveHeader" class="col-sm-2 bg-gray">Healthy People 2030 Objective<\/td><td class="col-sm-6 bg-blue" style="color: black;" id="objective"><\/td><\/tr><tr><td class="col-sm-2 bg-gray">Data Sources and Data Issues<\/td><td class="col-sm-6" id="sources"><\/td><\/tr><tr><td id="populationDomain" class="col-sm-2 bg-gray">MCH Population Domain<\/td><td class="col-sm-6 bg-blue" id="population"><\/td><\/tr><tr><td class="col-sm-2 bg-gray">Significance<\/td><td class="col-sm-6" id="significance"><\/td><\/tr><\/tbody><\/table>'),viewDataDiv=$('<div class="modal fade" id="viewDataModal" tabindex="0" role="dialog" aria-labelledby="viewDataModalLabel"><div class="modal-dialog" style="width:700px"><div class="modal-content"><div class="modal-header"><div><div type="button" class="close floatingButton" data-dismiss="modal" aria-label="Close"><i class="fa fa-times-circle text-danger"><\/i><\/div><\/div><h4 id="viewDataModalLabel" class="gridHeader center">Header<\/h4><\/div><div class="modal-body" aria-activedescendant><div class="grid table-responsive bg-primary" style="font-family:sans-serif"><\/div><div class="text-info" id="footnote2" style="font-family:sans-serif"><br /><small>^States are required to report data on Children (ages 1 through 21 years) as one of the three legislatively defined MCH populations. These data are used for reporting purposes for both the Child and Adolescent Health Population Domains.<\/small><br /><\/div><div class="text-info" id="footnote" style="font-family:sans-serif"><br /><small>*Others – Women and men, over age 21.<\/small><br /><\/div><div class="text-info" id="footnote1" style="font-family:sans-serif"><br /><small>*Includes Inpatient and Outpatient Services.<br />^Does not include Orthodontic Services.<\/small><br /><\/div><\/div><div class="modal-footer"><div class="center"><span id="viewDataDivDownloadBtn" class="btn btn-success" title="Export to Excel">&nbsp;Export to Excel<\/span><\/div><\/div><\/div><\/div><\/div>'),viewBigDataDiv=$('<div class="modal fade" id="viewDataModal" tabindex="0" role="dialog" aria-labelledby="viewDataModalLabel"><div class="modal-dialog" style="width:920px"><div class="modal-content"><div class="modal-header"><div><div type="button" class="close floatingButton" data-dismiss="modal" aria-label="Close"><i class="fa fa-times-circle text-danger"><\/i><\/div><\/div><br/><h4 id="viewDataModalLabel" class="gridHeader center">Header<\/h4><\/div><div class="modal-body"><div class="grid table-responsive bg-primary" style="font-family:sans-serif"><\/div><div class="text-info" id="footnote1" style="font-family:sans-serif;padding-left:5px; "><br /><small><i class="fa fa-circle" style="vertical-align: middle;font-size:5px;color:#31708f;padding-right:18px;"><\/i>Missing data points for sub-categories indicate data are not reportable due to insufficient sample size.<br /><span id="footnote2Conatiner"><br /><i class="fa fa-circle" style="font-size:5px;vertical-align:top;margin-top:4px;padding-right:8px;"><\/i><span id="footnote2" style="position:absolute;"><\/span><\/span><br/><\/div><div class="text-info" id="footnote3" style="font-family:sans-serif"><i class="fa fa-flash text-primary" style="vertical-align: middle;padding-right:17px;padding-left:3px;"><\/i><span id="footnote3span"><\/span><br /><\/div><div class="text-info" id="footnote4" style="font-family:sans-serif"><br /><i class="fa fa-flag text-warning" style="vertical-align: middle;padding-right:12px;padding-left:2px;"><\/i><span id="footnote4span"><\/span><br /><\/div><\/div><div class="modal-footer"><div class="center"><span id="viewDataDivDownloadBtn" class="btn btn-success" title="Export to Excel"> Export to Excel<\/span> <\/div><\/div><\/div> <\/div><\/div>'),viewBigDataDivForm5=$('<div class="modal fade" id="viewDataModal" tabindex="0" role="dialog" aria-labelledby="viewDataModalLabel"><div class="modal-dialog" style="width:960px"><div class="modal-content"><div class="modal-header"><div><div type="button" class="close floatingButton" data-dismiss="modal" aria-label="Close"><i class="fa fa-times-circle text-danger"><\/i><\/div><\/div><h4 id="viewDataModalLabel" class="gridHeader center">Header<\/h4><\/div><div class="modal-body"><div class="grid table-responsive bg-primary" style="font-family:sans-serif"><\/div><div class="text-info" id="footnote2" style="font-family:sans-serif"><div id="form5aStatesRequiredToReportNote"><br /><small >^States are required to report data on Children (ages 1 through 21 years) as one of the three legislatively defined MCH populations. These data are used for reporting purposes for both the Child and Adolescent Health Population Domains.<\/small><br /><\/div><div class="text-info" id="footnote5aNationalCSHCN" style="font-family:sans-serif" hidden><br /><small><sup>+<\/sup>Excludes jurisdictions for 2017 and 2018 due to lack of availability of denominators for all jurisdictions. <\/small><br /><\/div><div class="text-info" id="footnote5CSHCN" style="font-family:sans-serif" hidden><br /><small><sup>*<\/sup>Prior to 2020, CSHCN were defined as a subset of all children 1-21. Beginning in 2020, CSHCN are defined as a subset of all infants and children 0-21. <\/small><br /><br /><\/div><div class="text-info" id="footnote5a" style="font-family:sans-serif" hidden><br /><small>*Others – Women and men, over age 21.<\/small><br /><br /><\/div><\/div><div class="modal-footer"><div class="center"><span id="viewDataDivDownloadBtn" class="btn btn-success" title="Export to Excel"> Export to Excel<\/span> <\/div><\/div><\/div> <\/div><\/div>'),viewLineDataDiv=$('<div class="modal fade" id="viewLineDataModal" tabindex="0" role="dialog" aria-labelledby="viewDataModalLabel"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><div><button type="button" class="close floatingButton" data-dismiss="modal" aria-label="Close"><i class="fa fa-times-circle text-danger"><\/i><\/button><\/div><h4 id="viewDataModalLabel" class="gridHeader center">Header<\/h4><\/div><div class="modal-body"><div id="gridanchor" class="grid table-responsive bg-primary" style="font-family:sans-serif"><\/div><\/div><div class="modal-footer"><div class="center"><span id="viewLineDataDivDownloadBtn" class="btn btn-success" title="Export to Excel"> Export to Excel<\/span><\/div><\/div><\/div><\/div><\/div>'),viewLineDataDivNPM=$(' <div class="modal fade" id="viewLineDataModal" tabindex="-1" role="dialog" aria-labelledby="viewDataModalLabel"><div class="modal-dialog" style="width:920px"><div class="modal-content"><div class="modal-header"><div><button type="button" class="close floatingButton" data-dismiss="modal" aria-label="Close"><i class="fa fa-times-circle text-danger"><\/i><\/button><\/div><h4 id="viewDataModalLabel" class="gridHeader center">Header<\/h4><\/div><div class="modal-body"><div id="gridanchor" class="grid table-responsive bg-primary" style="font-family:sans-serif"><\/div><br /><div class="text-info" id="footnote1" style="font-family:sans-serif"><small><i class="fa fa-circle" style="font-size:5px;vertical-align:top;margin-top:4px;padding-right:8px;"><\/i><span id="footnote1Text" style="position:absolute;"><\/span><\/small><br /><\/div><div class="text-info" id="footnote3" style="font-family:sans-serif"><i class="fa fa-flash text-primary" style="vertical-align: middle;padding-right:17px;padding-left:3px;"><\/i><span id="footnote3span"><\/span><br /><\/div><div class="text-info" id="footnote4" style="font-family:sans-serif"><br /><i class="fa fa-flag text-warning" style="vertical-align: middle;padding-right:12px;padding-left:2px;"><\/i><span id="footnote4span"><\/span><br /><\/div><\/div><div class="modal-footer"><div class="center"><span id="viewLineDataDivDownloadBtn" class="btn btn-success" title="Export to Excel"> Export to Excel<\/span><\/div><\/div><\/div><\/div><\/div>'),viewLineDataDivTable=$(' <div  id="viewLineDataTable" tabindex="0" role="dialog" aria-labelledby="viewLineDataTableLabel"><div id="gridanchor" class="grid table-responsive bg-primary" style="font-family:sans-serif"><\/div>'),modalChart,googleColors=["#01A4EF","#FFB901","#7FBA00","#F25022","#DE884F","#cd4ca4","#1D968A","#4F22F1","#eec8cf","#FEE900"],googleMapColors=["#A5CCE9","#68A0CD","#A29BD7","#756DBB","#8FBC8F","#6B8E23","#3CB371","#DBA258","#DEB887","#E9967A"],pyramidColorsDirSer=["#01A4EF","#7FBA00","#F25022"],stateindividualgoogleColors=["#3366cc","#dc3912","#ff9900","#109618","#990099","#dd4477","#66aa00","#b82e2e","#316395","#994499","#22aa99","#aaaa11","#6633cc","#e67300","#8b0707","#651067","#329262","#5574a6","#3b3eac","#2211ca","#fb71b4","#37fb06","#508f9f","#501f9b","#f83fb6","#c25c4b","#c25c4b","#eac016","#3eabda","#f4c181","#a9947c","#83c426","#697966","#15454a","#c68103","#a549ef","#bb90c4","#0f4a52","#80e6b1","#7e935e","#eef736","#984242","#774635","#c82cf3","#d956a3","#7a30e3","#2cabca","#8647a5","#6e2004","#977435","#d1bea9","#e28e81","#e2564c","#424f37","#51651d","#36037d","#635708","#4f406d","#1ab106","#104ab4"],form5StateNotes,drawArrowMarker,offset,duration,kendoTableMeasureObject,DataAccessPageSelector;getSearchType=function(){return $("#switch_exact")[0].checked===!0?parseInt($("#switch_exact")[0].value):$("#switch_and")[0].checked===!0?parseInt($("#switch_and")[0].value):$("#switch_or")[0].checked===!0?parseInt($("#switch_or")[0].value):void 0};var esmDetailModel=function(n,t,i,r,u){var f,e;if(hideSelectorPopover(),f=u.split("|")[0],$("#NPMData").empty(),$("#viewNPMDataModal").find("#tblHeader").html(f),t==="Note")$.getJSON("/api/values/GetPMStateNotes?MeasureId="+n.measureId+"&state="+i+"&measureType="+r,function(n){var r=0,t,i;dataNotes="";t="";n.result.forEach(function(n){if(n.DataNote!==null&&n.DataNote!==undefined){var i="";n.Subheader!=null&&n.Subheader!=undefined&&(i="<b>"+n.Year+" "+n.Subheader+"<\/b><br ><br >");t+=n.DataNote;dataNotes=dataNotes+"<p>"+i+n.DataNote+"<\/p><br >"}r++});i='<table class="table table-bordered" style="width:920px;font-family:sans-serif"> <tbody> <tr> <td class="col-sm-2 bg-blue "><p>'+dataNotes+"<\/p><\/td><\/tr><\/table>";$("#viewNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){t!=null&&t!=""&&t.length>0&&($("#NPMData").append(i),$("#viewNPMDataModal").modal("show"))})});else{$("#viewOldNPMDataModal").find("#oldNpmtblHeader").html(f);stateMeasuresDetail.find("#measureStatusRow").show();n.SubGroupNames!=null&&n.SubGroupNames!=undefined&&n.SubGroupNames.length>0?(stateMeasuresDetail.find("#ESMSubGroupRow").show(),stateMeasuresDetail.find("#ESMSubGroup").html(n.SubGroupNames)):stateMeasuresDetail.find("#ESMSubGroupRow").hide();e="";e=n.IsActive!=null&&n.IsActive!=undefined&&n.IsActive==!1?n.InactiveType==1?"Inactive - Completed":n.InactiveType==2?"Inactive - Replaced":n.InactiveType==3?"Inactive - "+n.InactiveOtherReason:"Inactive":"Active";stateMeasuresDetail.find("#measureStatus").html(e);n.ESMStrategy!==null&&n.ESMStrategy!==""?(stateMeasuresDetail.find("#ESMStrategyRow").show(),stateMeasuresDetail.find("#esmStrategy").html(n.ESMStrategy.toHtmlBreakFromNewLine())):stateMeasuresDetail.find("#ESMStrategyRow").hide();stateMeasuresDetail.find("#goal").html(n.Goal);stateMeasuresDetail.find("#objectiveHeader").hide();stateMeasuresDetail.find("#objective").hide();stateMeasuresDetail.find("#sources").html(n.DataSource.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#population").hide();stateMeasuresDetail.find("#populationDomain").hide();stateMeasuresDetail.find("#significance").html(n.Significance.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#definition").hide();stateMeasuresDetail.find("#numerator").html(n.Numerator.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#denominator").html(n.Denominator.toHtmlBreakFromNewLine());stateMeasuresDetail.find("#units").html(n.UnitNumber);stateMeasuresDetail.find("#text1").html(n.UnitType);$("#viewOldNPMDataModal").modal().off("shown.bs.modal").on("shown.bs.modal",function(){$("#oldNPMDetailTable").append(stateMeasuresDetail);$("#viewOldNPMDataModal").modal("show")})}},showNomDetailPopup=function(n,t,i,r){hideSelectorPopover();popover=getDetailSelectorPopOver(n,t.MeasureId,"nom");popover.parent().off("click keyup","#btnOpenDetails").on("click keyup","#btnOpenDetails",function(){hideSelectorPopover();viewNomDetailSheet(t,i,"Detail",r)});popover.parent().off("click keyup","#btnOpenNotes").on("click keyup","#btnOpenNotes",function(n){if($(n.currentTarget).hasClass("disabled"))return!1;hideSelectorPopover();viewNomDetailSheet(t,i,"Note",r)});popover.parent().on("click keyup","#btnPopoverClose",function(){hideSelectorPopover()});$(n.currentTarget).attr("title","Info")},showNpmDetailPopup=function(n,t,i,r,u){if(hideSelectorPopover(),i==2)popover=getDetailSelectorPopOver(n,t,"npm",i,r,u);else{if(popover=getDetailSelectorPopOver(n,t,"npm",i,r,u),popover.parent().hasClass("disabled"))return!1;popover.parent().off("click keyup","#btnOpenDetails").on("click keyup","#btnOpenDetails",function(){hideSelectorPopover();npmDetailModel(t,"Detail",i,r)});popover.parent().off("click keyup","#btnOpenNotes").on("click keyup","#btnOpenNotes",function(n){if($(n.currentTarget).hasClass("disabled"))return!1;hideSelectorPopover();npmDetailModel(t,"Note",i,r,u)});popover.parent().on("click keyup","#btnPopoverClose",function(){hideSelectorPopover()});$(n.currentTarget).attr("title","Info")}},getFormattedTitle=function(n){for(var i="",r=67,t;n.length>r;)t=n.substring(0,r).lastIndexOf(" "),i+=n.substring(0,t)+"\n",n=n.substring(t);return i+n},showpmDetailPopup=function(n,t,i,r,u){hideSelectorPopover();t=t;var e=$('<span class="btn btn-primary " tabIndex="0" title="Detail Sheet" id="btnOpenDetails">Detail Sheet<\/span>'),o=$.extend({},n),f=$('<span class="btn btn-primary " tabIndex="0" title="Data Note" id="btnOpenNotes">Data Note<\/span>');$.getJSON("/api/values/GetPMStateNotes?MeasureId="+t.measureId+"&state="+i+"&measureType="+r,function(s){s.CallSuccess?(f[0].className="btn btn-primary",f[0].title="Data Note"):(f[0].className="btn btn-primary disabled",f[0].title="Data notes are not available for this measure");var h=getPopover(e,f,o);if(h.parent().hasClass("disabled"))return!1;h.parent().off("click keyup","#btnOpenDetails").on("click keyup","#btnOpenDetails",function(){hideSelectorPopover();r=="SPM"?spmDetailModel(t,"Detail",i,r):r=="SOM"?somDetailModel(t,"Detail",i,r):r=="ESM"&&esmDetailModel(t,"Detail",i,r,u)});h.parent().off("click keyup","#btnOpenNotes").on("click keyup","#btnOpenNotes",function(n){if($(n.currentTarget).hasClass("disabled"))return!1;hideSelectorPopover();r=="SPM"?spmDetailModel(t,"Note",i,r):r=="SOM"?somDetailModel(t,"Note",i,r):r=="ESM"&&esmDetailModel(t,"Note",i,r,u)});h.parent().on("click keyup","#btnPopoverClose",function(){hideSelectorPopover()});$(n.currentTarget).attr("title","Info")})};form5StateNotes="";drawArrowMarker=function(n,t,i){var f,a;if(t!=null&&t.data!=null){var e=n.getAxis("value"),v=n.getAxis("category"),r=v.slot(3),h=e.range(),c=e.slot(h.min,h.max),u=e.slot(t.data[3].field5a+t.data[3].field5B),o=u.origin.y+(c.bottomRight().y-u.origin.y)/2,l=new kendo.drawing.Group({tooltip:{shared:!0,content:"CSHCN is a sub category of Children Served",autoHide:!1,position:"right"}}),s=0;i&&(s=4);u.origin.y=u.origin.y+5;f=c.bottomRight().y-5;a=new kendo.drawing.Path({tooltip:{content:"CSHCN is a sub category of Children Served",visible:!0},stroke:{color:"#5B9BD5",width:2}}).moveTo(r.origin.x+22+s,u.origin.y).lineTo(r.origin.x+8,u.origin.y).curveTo([r.origin.x-5,u.origin.y],[r.origin.x-5,u.origin.y+10],[r.origin.x-5,u.origin.y+10]).lineTo(r.origin.x-5,o-4).lineTo(r.origin.x-20,o).lineTo(r.origin.x-5,o+4).lineTo(r.origin.x-5,f-10).curveTo([r.origin.x-5,f],[r.origin.x+5,f],[r.origin.x+5,f]).lineTo(r.origin.x+22+s,f);l.append(a);n.surface.draw(l)}};$(function(){$("#breadcrumbstatesddl").kendoDropDownList({theme:"bootstrap",dataSource:states,optionLabel:"Select a State ...",dataTextField:"DisplayName",dataValueField:"StateAbbrev",animation:{close:{effects:"fadeOut zoom:out",duration:300},open:{effects:"fadeIn zoom:in",duration:300}}}).on("change",function(){});var n=$("#breadcrumbstatesddl").data("kendoDropDownList")});String.prototype.toSpaceFromPipe=function(){return this.replace(/\|/g," ")};String.prototype.toLineBreakFromPipe=function(){return this.replace(/\|/g,"\n")};String.prototype.toHtmlBreakFromPipe=function(){return this.replace(/\|/g,"<br />")};String.prototype.toHtmlBreakFromNewLine=function(){return this.replace(/[\n\r]/g,"<br />")};Array.prototype.sortBy=function(n){if(this.slice!=null)return this.slice(0).sort(function(t,i){return t[n]>i[n]?1:t[n]<i[n]?-1:0})};Array.prototype.contains=function(n){for(var t=0;t<this.length;t++)if(this[t]===n)return!0;return!1};Array.prototype.unique=function(){for(var t=[],n=0;n<this.length;n++)t.contains(this[n])||t.push(this[n]);return t};offset=220;duration=500;jQuery(window).scroll(function(){jQuery(this).scrollTop()>offset?(jQuery(".back-to-top").fadeIn(duration),$("#dropDown div").each(function(){$(this).removeClass("col-sm-3").removeClass("col-sm-2").removeClass("col-sm-4").removeClass("col-sm-6").removeClass("col-sm-8").removeClass("col-sm-offset-8").removeClass("col-sm-offset-6").removeClass("col-sm-1").removeClass("col-sm-offset-4").removeClass("col-sm-offset-5").removeClass("col-sm-offset-2")}),$("#dropDown").addClass("topdropdown"),$("#dropDown div").each(function(){$(this).hasClass("col-size-2")?$(this).addClass("col-sm-2"):"";$(this).hasClass("col-size-3")?$(this).addClass("col-sm-3"):"";$(this).hasClass("col-size-4")?$(this).addClass("col-sm-4"):"";$(this).hasClass("col-size-6")?$(this).addClass("col-sm-6"):"";$(this).hasClass("col-size-8")?$(this).addClass("col-sm-8"):"";$(this).hasClass("col-size-1")?$(this).addClass("col-sm-1"):"";$(this).hasClass("offset1")?$(this).addClass("col-sm-offset-1"):"";$(this).hasClass("offset2")?$(this).addClass("col-sm-offset-2"):"";$(this).hasClass("offset3")?$(this).addClass("col-sm-offset-3"):"";$(this).hasClass("offset4")?$(this).addClass("col-sm-offset-4"):""})):(jQuery(".back-to-top").fadeOut(duration),$("#dropDown").removeClass("topdropdown").removeClass("col-sm-offset-2"),$("#dropDown div").each(function(){$(this).hasClass("offset2")?$(this).removeClass("col-sm-offset-2"):"";$(this).hasClass("offset1")?$(this).removeClass("col-sm-offset-1"):"";$(this).hasClass("offset3")?$(this).removeClass("col-sm-offset-3"):"";$(this).hasClass("offset4")?$(this).removeClass("col-sm-offset-4"):"";$(this).hasClass("col-size-2")?$(this).addClass("col-sm-2"):"";$(this).hasClass("col-size-1")?$(this).addClass("col-sm-1"):"";$(this).hasClass("col-size-3")?$(this).addClass("col-sm-3"):"";$(this).hasClass("col-size-4")?$(this).addClass("col-sm-4"):"";$(this).hasClass("col-size-6")?$(this).addClass("col-sm-6"):"";$(this).hasClass("col-size-8")?$(this).addClass("col-sm-8"):"";$(this).hasClass("col-off-8")?$(this).addClass("col-sm-offset-8"):"";$(this).hasClass("col-off-6")?$(this).addClass("col-sm-offset-6"):"";$(this).hasClass("col-off-4")?$(this).addClass("col-sm-offset-4"):"";$(this).hasClass("col-off-5")?$(this).addClass("col-sm-offset-5"):"";$(this).hasClass("col-off-2")?$(this).addClass("col-sm-offset-2"):""}))});$(".back-to-top").click(function(n){return n.preventDefault(),$("html, body").animate({scrollTop:0},duration),!1});$(function(){$(".more-icon").on("mouseover",function(){$(this).removeClass("text-primary").addClass("text-success").on("mouseout",function(){$(this).removeClass("text-success").addClass("text-primary")})})});var fedexpendedData=[],fedBudgetedData=[],nonfedExpendedData=[],nonfedBudgetedData=[],individualServedData1=[],individualServedData2=[],individualServedData1Total=0;var getLineChartLegendLabelText=function(n){return n.indexOf("z1:")!==-1||n.indexOf("z2:")!==-1||n.indexOf("y1:")!==-1||n.indexOf("y2:")!==-1?n.substring(3):n.charAt(0)==="z"||n.charAt(0)==="y"?n.substring(1):n},getCIValue=function(n,t){return"- Confidence Interval: "+(n==null||n==undefined?"Not Available":n)+" - "+(t==null||t==undefined?"Not Available":t)},columnsConfig=[];createMeasureTableArray=function(n,t){var i=[],f,e;n.forEach(function(n){n.text!==undefined&&n.text.length>0?i.push({name:n.name,value:n.value,year:n.text}):t==="SPM"?i.push({name:n.name,value:n.value,year:n.year.toString()}):i.push({name:n.name,value:n.value,year:n.year.getFullYear().toString()})});n=i;var o=_.keys(_.countBy(n,function(n){return n.year})),r=_.sortBy(o,function(n){return n}),s=_.sortBy(n,"name"),h=_.keys(_.countBy(s,function(n){return getLineChartLegendLabelText(n.name)})),u=[];return columnsConfig=[],columnsConfig.push({field:"DataSource",title:"Source",headerAttributes:{style:"text-align:center;width:180px;"},width:"180px"}),f=r.length,e=10,f>0&&(e=(70/f).toFixed(0)),$.each(r,function(n,t){columnsConfig.push({field:"w"+t.replace(/\//g,"_").replace(/-/g,"_"),title:t.toString(),headerAttributes:{style:"text-align:center;"},format:"{0:N1}",encoded:!1,width:104+(t.toString().length-4)*5+"px",attributes:{style:"text-align:right;text-overflow:initial;"}})}),$.each(h,function(n,t){var i=r.reduce(function(n,t){return n["w"+t.replace(/\//g,"_").replace(/-/g,"_")]=null,n},{DataSource:t});u.push(i)}),$.each(n,function(n,t){var i=_.find(u,function(n){return n.DataSource===getLineChartLegendLabelText(t.name)});i["w"+t.year.replace(/\//g,"_").replace(/-/g,"_")]=t.value}),u};pivotTable=function(n,t){var i=[],f,e;n.forEach(function(n){n.text!==undefined&&n.text.length>0?i.push({name:n.name,value:n.value,year:n.text}):i.push({name:n.name,value:n.value,year:n.year.getFullYear().toString()})});n=i;var o=_.keys(_.countBy(n,function(n){return n.year})),r=_.sortBy(o,function(n){return n}),s=_.keys(_.countBy(n,function(n){return n.name})),u=[];return columnsConfig=[],columnsConfig.push({field:"DataSource",title:"Source",headerAttributes:{style:"text-align:center;width:180px;"},width:"80px"}),f=r.length,e=10,f>0&&(e=(70/f).toFixed(0)),$.each(r,function(n,i){columnsConfig.push({field:"w"+i.replace(/\//g,"_").replace(/-/g,"_"),title:i.toString(),headerAttributes:{style:"text-align:center;"},format:t,encoded:!1,width:i.toString().length*34+"px",attributes:{style:"text-align:right;"}})}),$.each(s,function(n,t){var i=r.reduce(function(n,t){return n["w"+t.replace(/\//g,"_").replace(/-/g,"_")]=null,n},{DataSource:t});u.push(i)}),$.each(n,function(n,t){var i=_.find(u,function(n){return n.DataSource===t.name});i["w"+t.year.replace(/\//g,"_").replace(/-/g,"_")]=t.value}),u};kendoTableMeasureObject=function(n,t){var i=this;i.DataSource=t[0].name;$.each(n,function(n,t){i[t]=null})};DataAccessPageSelector=[{text:"Access and Linkage by Data Source",value:1},{text:"Data Sources Accessed and Linked to Vital Records Birth",value:2}];$("#dataAccessPageSelector").kendoDropDownList({theme:"bootstrap",dataSource:DataAccessPageSelector,dataTextField:"text",dataValueField:"value",animation:{close:{effects:"fadeOut zoom:out",duration:300},open:{effects:"fadeIn zoom:in",duration:300}},popup:{appendTo:$("#dataAccessPageSelector").parent()}}).on("change",function(){document.location.href=this.value===1?"/DataAccessLinkage/ByDataSource":"/DataAccessLinkage/ByNumber"})