function initPrintForm(){function n(n){var t=[],u=$(".print-filter input:checked"),i,r,f;if(u.each(function(n,i){t.push($(i).val())}),i=u.length,i===0){alert("Please select at least 1 item to print");return}return r=$(".print-filter input").length,i===r?t=["all-.","toc-."]:i!==r-1||$("#tocCheck").prop("checked")||(t=["all-."]),printViewFilter.ViewType="Print",printViewFilter.PrintType=n,printViewFilter.ProvIds=t.join(","),n==="html"?sw.postForm(printViewUrl,printViewFilter,"_blank"):(f=sw.getLoadingCover("loadingCover",sw.isXs()?"body":"#Main"),f.show(),sw.ajax({type:"POST",url:printViewUrl,data:printViewFilter,cache:!1,success:function(n){isFileDownloadProcessed(n)}})),!0}var t={onSelectAllClick:function(){$(".print-filter input").prop("checked",!0)},onClearAllClick:function(){$(".print-filter input").prop("checked",!1)},onPrintToHtmlClick:function(){return n("html")},onPrintToPdfClick:function(){return n("pdf")},onPrintToWordClick:function(){return n("word")}};ko.applyBindings(t,$(".print-form").get(0));$(':checkbox[id^="PartID_"]').click(function(){var n=$(this).attr("id").replace("PartID_","");checkAll(n);GetContent()});$(':checkbox[id^="PartID2_"]').click(function(){var n=$(this).attr("id").replace("PartID2_","");checkAll2(n);GetContent()});$(':checkbox[id^="PartID_"]:checked').each(function(){$(this).trigger("click").trigger("click")});$(":checkbox.childID").click(function(){uncheckPart2($(this).attr("data-id2"));uncheckPart($(this).attr("data-id"));GetContent()});$(".displayText").click(function(){var n=$(this).hasClass("displayText")?$(this).attr("data-id"):$(this).parent().attr("data-id");return showProvision(n),!1});$(".displayText2").click(function(){var n=$(this).hasClass("displayText2")?$(this).attr("data-id"):$(this).parent().attr("data-id");return showProvision2(n),!1})}function initPrintView(){$(document).on("click",".legis-download",function(){var n=$(this),t;return printViewFilter.PrintType=n.attr("data-PrintType"),printViewFilter.ProvIds=n.attr("data-ProvIds")+".",printViewFilter.ProvIds==="all-."&&(printViewFilter.ProvIds+=",toc-."),t=sw.getLoadingCover("loadingCover",sw.isXs()?"body":"#Main"),t.show(),sw.ajax({type:"POST",url:printViewUrl,data:printViewFilter,cache:!1,success:function(n){isFileDownloadProcessed(n)}}),!1})}function isFileDownloadProcessed(n){var t=sw.getLoadingCover("loadingCover",sw.isXs()?"body":"#Main");t.show();sw.ajax({type:"POST",url:sw.getRootPath()+"FileDownload/IsProcessed",data:{fileDownloadTaskSysId:n},cache:!1,success:function(i){i==="1"?(t.hide(),sw.postForm(sw.getRootPath()+"FileDownload/DownloadFile",{fileDownloadTaskSysId:n},"")):i==="0"&&setTimeout(function(){isFileDownloadProcessed(n)},2e3)}})}function showProvision(n){for(var i=getElementsByClassName("showText_"+n),r=$(".displayText[data-id='"+n+"']").get(0),t=0;t<i.length;t++)i[t].style.display=="block"?(i[t].style.display="none",r.innerHTML="<span class='fa fa-caret-right'><\/span>"):(i[t].style.display="block",r.innerHTML="<span class='fa fa-caret-down'><\/span>")}function showProvision2(n){for(var i=getElementsByClassName("showText2_"+n),r=$(".displayText2[data-id='"+n+"']").get(0),t=0;t<i.length;t++)i[t].style.display=="block"?(i[t].style.display="none",r.innerHTML="<span class='fa fa-caret-right'><\/span>"):(i[t].style.display="block",r.innerHTML="<span class='fa fa-caret-down'><\/span>")}function getElementsByClassName(n){var i,r,t,u;for(i=document.all?document.all:document.getElementsByTagName("*"),r=[],t=0,u=i.length;t<u;t++)i[t].classList.contains(n)&&(r[r.length]=i[t]);return r}function ckcount(){var n=document.getElementsByName("item"),r=document.getElementById("limitId").checked,t=0;for(i=0;i<n.length;i++)n[i].checked==!0&&t++;sessionStorage.ckcount=t}function setId(){var t=document.getElementById("limitId").checked,n=document.getElementById("headId").checked;n==!0&&(sessionStorage.title=document.getElementById("titleId").value,sessionStorage.chapter=document.getElementById("chapId").value);sessionStorage.limitId=t;sessionStorage.headId=n}function checkAll(n){var r=document.getElementById("PartID_"+n),i=$(".childID[data-id='"+n+"']").get(),t;if(r.checked==!0)for(t=0;t<i.length;t++)i[t].checked=!0;else for(t=0;t<i.length;t++)i[t].checked=!1}function checkAll2(n){var r=document.getElementById("PartID2_"+n),i=$(".childID[data-id2='"+n+"']").get(),t;if(r.checked==!0)for(t=0;t<i.length;t++)i[t].checked=!0;else for(t=0;t<i.length;t++)i[t].checked=!1}function uncheckPart(n){var r=document.getElementById("PartID_"+n),t,u,i;if(r!==null)for(t=$(".childID[data-id='"+n+"']").get(),u=0,i=0;i<t.length;i++)t[i].checked==!1?r.checked=!1:(u++,u==t.length&&(r.checked=!0))}function uncheckPart2(n){var r=document.getElementById("PartID2_"+n),t,u,i;if(r!==null)for(t=$(".childID[data-id2='"+n+"']").get(),u=0,i=0;i<t.length;i++)t[i].checked==!1?r.checked=!1:(u++,u==t.length&&(r.checked=!0))}function check(){var n=document.getElementsByName("item"),t=document.getElementsByName("partItem"),r=document.getElementById("limitId"),u=document.getElementById("headId");for(u.checked==!1&&(u.checked=!0),r.checked==!1&&(r.checked=!0),i=0;i<n.length;i++)n[i].checked=!0;for(i=0;i<t.length;i++)t[i].checked=!0;setId()}function uncheck(){var n=document.getElementsByName("item"),t=document.getElementsByName("partItem"),r=document.getElementById("limitId"),u=document.getElementById("headId");for(u.checked==!0&&(u.checked=!1),r.checked==!0&&(r.checked=!1),i=0;i<n.length;i++)n[i].checked=!1;for(i=0;i<t.length;i++)t[i].checked=!1;setId()}function checkboxes(){var n=document.getElementsByName("item").length;document.getElementById("totalcnt").value=n}function validation(){var t,i,n;for(totalcount=0,t=document.getElementsByTagName("input"),i=0,n=0;n<t.length;n++)t[n].type=="checkbox"&&t[n].checked==!0&&totalcount++,t[n].type=="checkbox"&&i++;document.getElementById("totcount").value=totalcount;setId();checkboxCt()}function checkboxCt(){var t=document.getElementsByName("item"),r=document.getElementsByName("partItem"),n=0,u=t.length+r.length;for(i=0;i<t.length;i++)t[i].checked==!0&&n++;for(i=0;i<r.length;i++)r[i].checked==!0&&n++;sessionStorage.val=n;sessionStorage.flag=u!=n?0:-1}function CheckItems(){var r=document.getElementById("ckItem").value,t=r.replace("[","").replace("]","").split(","),n=document.getElementsByName("item");for(i=0;i<n.length;i++)for(j=0;j<t.length;j++)if(n[i].value==t[j].replace(/^\s+|\s+$/g,"")){n[i].checked=!0;break}}function GetContent(){document.getElementById("message").style.visibility="hidden"}var resizePanels,initPrintForm;(function(n,t,i,r){var c=function(n,t){return parseInt(n,10)+parseInt(t,10)},l=function(t){for(var f,o,e=[],r=0;r<t.length;r++){var s=t[r],u=n(s).attr("href"),i=n(u.substring(u.indexOf("#")));i.length>0&&(f=Math.floor(i.offset().top),o=f+Math.floor(i.outerHeight()),e.push({element:i,hash:u,top:f,bottom:o}))}return e},a=function(t,i){for(var u,r=0;r<t.length;r++)if(u=n(t[r]),u.attr("href")===i)return u},s=function(t,i,r){for(var f,u=0;u<t.length;u++)f=n(t[u]),f.attr("href")!==r&&f.removeClass(i.activeClass)},f="",e,u,o,h={init:function(h){var v={namespace:"scrollspy",activeClass:"active",animate:!1,duration:1e3,offset:0,container:t,replaceState:!1};return h=n.extend({},v,h),o=h.offset,this.each(function(){var y=this,b=n(h.container),v,w,p;for(u=n(y).find("a.nav-link"),v=0;v<u.length;v++){w=u[v];n(w).on("click",function(i){var f=n(this).attr("href"),u=n(f),r;u.length>0&&(r=c(u.offset().top,o),h.animate?n("html, body").animate({scrollTop:r},h.duration):t.scrollTo(0,r),i.preventDefault())})}s(u,h);e=l(u);p=function(){for(var l,i,v={top:c(n(this).scrollTop(),Math.abs(o)),left:n(this).scrollLeft()},t,p,w=0;w<e.length;w++){if(l=e[w],v.top<l.top)break;p=l}if(p!==r){if(i=p.hash,t=a(u,i),t&&(h.replaceState&&history.replaceState({},"","/"+i),s(u,h,""),t.addClass(h.activeClass),t.parent().hasClass("nav-pills")?t.parent().prev().addClass(h.activeClass):t.next().children(":first").addClass(h.activeClass),h.onChange&&f!==i)){h.onChange(l.element,n(y),v);f=i}if(!t&&f!=="exit"&&h.onExit){h.onExit(n(y),v);s(u,h);f="exit";h.replaceState&&history.replaceState({},"","/")}}};b.bind("scroll."+h.namespace,function(){p()});n(i).ready(function(){p()})})},refresh:function(t){o=t;e=l(n(this).find("a.nav-link"))}};n.fn.swscrollspy=function(n){if(h[n])return h[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n!="object"&&n)console&&console.log("Method "+n+" does not exist on jQuery.swscrollspy");else return h.init.apply(this,arguments)}})(jQuery,window,document,undefined);$(function(){function ti(t){if(viewMode===4){var i=$("#fragview").outerWidth()-130;t=f(t,i/8);t&&($("#searchWithinProvTab").addClass("active").show().find("a").text(t),n.SectionTitle1(f(t,l)),n.SectionTitle2(f(t,o)))}}function ii(n){printViewFilter.ViewType="Print";printViewFilter.PrintType=n.attr("data-PrintType");printViewFilter.ProvIds=n.attr("data-ProvIds")+".";printViewFilter.ProvIds==="all-."&&(printViewFilter.ProvIds+=",toc-.");var t=sw.getLoadingCover("loadingCover",sw.isXs()?"body":"#Main");t.show();sw.ajax({type:"POST",url:printViewUrl,data:printViewFilter,cache:!1,success:function(n){isFileDownloadProcessed(n)}})}function k(){var n,i,t;if(!w&&!p){if(n=$("div.dms:first"),n.length===0){resizePanels();$("#loadingIndicator").hide();return}$("#loadingIndicator").show();i=n.attr("data-field");t=n.attr("data-term");i==="seriesId"&&(lazyLoadFilter.SeriesId=t,fragments&&(lazyLoadFilter.FragSysId=fragments[t].Item1,lazyLoadFilter._=fragments[t].Item2),dt.insertBefore(n),p=1,sw.ajax({type:"GET",url:lazyLoadContentUrl,data:lazyLoadFilter,cache:!0,success:function(t,i,r){var u=r.getResponseHeader("XmlTag");switch(u){case"derivations":$(".derTbl").append(t);n.remove();break;case"toBeTabled":$(".toBeTabled").append(t);n.remove();break;default:n.replaceWith(t)}kt===0&&d(window.location.hash);$("#ToggleAnnotate").length>0&&($("#ToggleAnnotate").prop("checked")?$(".amendNote").show():$(".amendNote").hide());fi();p=0;dt.remove();resizePanels();sw.isTouchDevice||disableScrollTracking!=="0"||k()}}))}}function ai(){st={};$("#toc a").each(function(n,t){var i=$(t).attr("href");i.indexOf("#")===0&&(st[i]=1)})}function vi(n){if(!n)return 0;for(var t in st)if(t===n)return 1;return 0}function d(n){var t,r,i;return vi(n)&&(n=n.replace(".",""),t=$(it(n)),t.length===0&&(t=$('a[name="'+it(n.substr(1))+'"]')),t.length>0)?(r=t.offset(),r&&(i=r.top,sw.isXs()||sw.isSm()?i-=160:n.indexOf("pr")>-1&&(i-=20),$(window).scrollTop(i),$(window).trigger("scroll")),kt=1,isScrolled=1,!0):!1}function fi(){$("#tocNav").swscrollspy("refresh")}function f(n,t){var i=n;return i.length<=t?i:(i=i.substr(0,t-4),i+"...")}function ei(n,t){var i=t.offset().top,f=i+t.height(),r=n.offset(),u=r?r.top:0,e=u+30;return e<=f&&u>=i}function yt(){if(sw.isMobile()){$("#nav").height($("#topLeftPanel").outerHeight()+$("#mobileToolbar").outerHeight());return}if(ut=$("#sidebar").width()-20,i=u.height(),disableScrollTracking==="1")t=i-ft-s-40,a=t-$("#topLeftPanel").outerHeight()-$("#tocTitle").outerHeight()-$("#tocButton").outerHeight();else{if($("#nav").hasClass("affix-top"))t=i-$("#breadcrumb").outerHeight()-s-(ct.offset().top<i?70:45);else{var n=$("#fs").outerHeight();t=n>i?i-20:n-50;u.scrollTop()+t>ct.offset().top&&(t=i-ci-30)}a=t-$("#topLeftPanel").outerHeight()-$("#tocTitle").outerHeight()-$("#tocButton").outerHeight()}$("#tocNav").width(ut-2).animate({height:a},{queue:!0,duration:0});$("#nav").width(ut).animate({height:t},{queue:!0,duration:0});$("#DesktopToolbar").width($("#fragview").outerWidth())}function oi(){o=Math.floor($("#topLeftPanel").outerWidth()/8.2);l=o}function g(){var t=window.innerHeight?window.innerHeight:$(window).outerHeight(),i,r;(n.Show.MobileTimeline()||n.Show.Toc())&&$("#nav").css({height:t+"px"}).addClass("mobile-expanded");i=$("#sidebar").width();$("#nav").width(i);n.Show.Toc()&&$("#tocNav").height(t-89).width(i);n.Show.MobileTimeline()&&(r=221,$("#mobileDocTimeline").height(t-r),$("#mobileProvTimeline").height(t-r))}function v(){n.Show.Sidebar(!0);n.Show.TopLeftPanel(!0);n.Show.Toc(!1);n.Show.MobileTimeline(!1);n.Show.MobileToolbar(!0);var t=177;$("#nav").hasClass("affix-top")&&(t+=10);$("#nav").width($("#sidebar").width()).height(t);$("body").attr("data-offset","200")}function pt(){n.Show.MobileToolbar(!1);n.Show.MobileTimeline(!1);n.Show.Toc(!0);n.Show.TopLeftPanel(!0);$("#topSection").show();$("html,body").removeClass("mobile-modal-open");$("body").attr("data-offset","100")}function si(){if(sw.isXs())$("#printModal .modal-dialog").css({margin:"0",width:$(window).width()+"px",height:$(window).height()+"px"}),$("#printModal .print-filter").css("height",$(window).height()-179+"px");else{$("#printModal .print-filter").css({height:$(window).height()-260+"px"});var n=$(window).width();n>=1200?n=1024:n-=200;$("#printModal .modal-dialog").css({margin:"",width:n+"px"})}}function wt(n){n?e.expandProvTimelineOnce||(setTimeout(function(){$("#mobileProvTimeline").scrollTop((provTimelineLen-provTimelineIdx)*60-20)},100),e.expandProvTimelineOnce=1):e.expandDocTimelineOnce||(setTimeout(function(){$("#mobileDocTimeline").scrollTop((timelineItems.length-docTimelineIdx)*60-50)},100),e.expandDocTimelineOnce=1)}function nt(n){n?e.expandProvTimelineOnce||(setTimeout(function(){$("#provTimeline").scrollLeft(provTimelineIdx*140)},100),e.expandProvTimelineOnce=1):e.expandDocTimelineOnce||(setTimeout(function(){$("#docTimeline").scrollLeft(docTimelineIdx*140)},100),e.expandDocTimelineOnce=1)}function tt(n){$(n+" a.timeline-popover .status").each(function(){var t=$(this),r="hover",i;n.indexOf("#mobile")>-1&&(r="manual",t.click(function(){var i=$(this),t;return i.data("showPopover")===1?!0:($(n+" a.timeline-popover .status").each(function(){$(this).data("showPopover",0);var n=bootstrap.Popover.getInstance(this);n&&n.hide()}),i.data("showPopover",1),t=bootstrap.Popover.getInstance(this),t&&t.show(),!1)}));i={trigger:r,title:t.parent().attr("title"),content:t.parent().attr("data-date")};i.offset=n.indexOf("#mobile")>-1?[-50,10]:[0,-100];new bootstrap.Popover(this,i)})}function bt(n,t){var r=currViewUrl,o=r.indexOf("#"),i,f,u;o>-1&&(r=r.substr(0,o));i=$.getQueryParameters();i[n]=t;f="";i.ViewType&&i.ViewType!==null&&(f=i.ViewType);f.toLowerCase()==="within"&&(delete i.ViewType,i.Phrase&&delete i.Phrase);var s=r.indexOf("?"),e=s>-1?r.substr(0,s):r,h=0;for(u in i)typeof i[u]!="undefined"&&(e+=h===0?"?":"&",e+=u+"="+i[u],h+=1);return e}function it(n){return n}function yi(){if(sw.isMobile()){$("#nav").height($("#topLeftPanel").outerHeight()+$("#mobileToolbar").outerHeight());return}var n=$(window).scrollTop();t=n>s+ft?i-gt:i-s-ft-gt;a=t-$("#topLeftPanel").outerHeight()-$("#tocTitle").outerHeight()-$("#tocButton").outerHeight();$("#nav").css({height:t+"px",position:"fixed",bottom:"20px"});$("#toc").css({height:a+"px"})}var n,li,ri,ui,b,vt,p;sw.isMobile=function(){return sw.isXs()||sw.isSm()};validStartDate=parseServerDate(validStartDate);var rt=-30,y=0,kt=0,p=0,dt=$('<div class="ajax-loading">&nbsp;<\/div>'),w=0,l,o,a,ut,s=$("#siteHeader").height()+$("#topSection").height()+$("#mastHeadRow").height(),ft=$("#breadcrumb").outerHeight(),pi=s+143,u=$(window),i=u.height(),et=u.width(),t=i-s-10,t=500,gt=30,ot=0,ni=$.getQueryParameters(),e={},h,st={},c="",ht=sw.isMobile(),hi=54,ct=$(".footer"),ci=ct.outerHeight(!0),r=$("#tocNav"),lt=0,at="";oi();initAddToCollection();sw.popover("#compareVersions","#compareVersionsPopover","bottom","");sw.popover(".pager-bottom .page-size","#pageSizePopover","bottom","search-within",0);sw.popover(".pager-bottom .page-index","#pageIndexPopover","bottom","search-within",0);$(document).on("click","a",function(){var n=$(this),t;return n.hasClass("non-ajax")?!0:n.parents("#searchWithinList").length===0&&n.parents(".popover.search-within").length===0?!0:(t=n.hasClass("prov")?"prov":"list",History.pushState({state:n.attr("href"),getPartialView:t,provTitle:n.text()},document.title,n.attr("href")),!1)});$("#searchWithinListTab, searchWithinListTab a").click(function(){return $("#searchWithinListTab").addClass("active"),$("#searchWithinProvTab").removeClass("active"),$("#searchWithinList").show(),$("#legisContent").hide(),!1});$("#searchWithinProvTab, searchWithinProvTab a").click(function(){return $("#searchWithinListTab").removeClass("active"),$("#searchWithinProvTab").addClass("active"),$("#searchWithinList").hide(),$("#legisContent").show(),!1});History.Adapter.bind(window,"statechange",function(){var t=History.getState(),r,i;t.data.getPartialView&&(r=sw.getLoadingCover("loadingCover","#main"),r.show(),i=t.url,i+=i.indexOf("?")>-1?"&":"?",i+="getPartialView="+t.data.getPartialView,$("#legisContent").hide(),$(".pager-bottom .page-size, .pager-bottom .page-index").popover("hide"),sw.ajax({method:"POST",url:i,success:function(i){t.data.getPartialView==="list"?($("#searchWithinTabs").show(),$("#searchWithinListTab").show().addClass("active"),$("#searchWithinProvTab").removeClass("active"),$("#legis").length>0&&$("#legisContent").html(""),$("#tocNav").html(i.Toc),$("#searchWithinList").html(i.SearchResult).show(),sw.popover(".pager-bottom .page-size","#pageSizePopover","bottom","search-within",0),sw.popover(".pager-bottom .page-index","#pageIndexPopover","bottom","search-within",0)):($("#searchWithinTabs").show().show(),$("#searchWithinListTab").removeClass("active"),ti(t.data.provTitle),$("#searchWithinList").hide(),$("#legisContent").html(i.Content).show(),$("#provTimeline").html(i.DesktopTimeline),$("#mobileProvTimeline").html(i.MobileTimeline),$("#wholeDoc").show(),exitSearchUrl=i.ExitSearchUrl,isProvisionView=1,n.ShowDesktopProvTimeline(),window.scrollTo(0,0),lazyLoadFilter=i.LazyLoadFilter,k());r.hide()}}))});$("#searchPhrase").focus();n={Show:{Sidebar:ko.observable(showSideBar),TopLeftPanel:ko.observable(!0),MobileToolbar:ko.observable(!0),Legis:ko.observable(!0),Toc:ko.observable($(".device-md").is(":visible")||$(".device-lg").is(":visible")),Timeline:ko.observable($(".device-md").is(":visible")||$(".device-lg").is(":visible")),ActDetails:ko.observable(!0),DesktopTimeline:ko.observable(!1),MobileTimeline:ko.observable(!1),DesktopDocTimeline:ko.observable(isProvisionView===0),DesktopProvTimeline:ko.observable(isProvisionView===1),MobileDocTimeline:ko.observable(isProvisionView===0),MobileProvTimeline:ko.observable(isProvisionView===1),SearchWithin:ko.observable(viewMode===4)},LegisTitle:ko.observable(legisTitle),LegisTitle1:ko.observable(""),SectionTitle:ko.observable(""),SectionTitle1:ko.observable(""),SectionTitle2:ko.observable(f(provTitle,o)),HideSearchWithin:function(){return(n.Show.SearchWithin(0),!$("#searchWithinListTab").is(":visible"))?($("#searchWithinTabs").hide(),!1):(window.location=window.location.href.substr(0,window.location.href.indexOf("&ViewType=Within")),!1)},ShowSearchWithin:function(){return n.Show.SearchWithin(1),n.Show.DesktopTimeline(0),$("#searchPhrase,#searchPhraseMobile").focus(),!1},SearchWithinPhrase:ko.observable(searchWithinPhrase),SubmitSearchWithin:function(t){var u=$(t),i=n.SearchWithinPhrase(),r;return i=i.replaceAll("<","lt;"),i=i.replaceAll(">","gt;"),r=u.attr("action"),r+="&Phrase="+encodeURIComponent(i),viewMode=4,History.pushState({state:r,getPartialView:"list"},document.title,r),document.body.scrollTop=document.documentElement.scrollTop=0,$("#searchPhraseMobile").blur(),!1},ShowDesktopDocTimeline:function(){return n.Show.DesktopDocTimeline(!0),n.Show.DesktopProvTimeline(!1),nt(0),!1},ShowDesktopProvTimeline:function(){return isProvisionView?(n.Show.DesktopDocTimeline(!1),n.Show.DesktopProvTimeline(!0),nt(1),!1):(sw.bsAlert("Provision Timeline","The Provision timeline is only available when a single provision is being viewed.<br /><br />To view a single provision, select the checkbox next to the provision in the Table of Contents panel and click on 'Get Provisions'."),!1)},ShowMobileDocTimeline:function(){return n.Show.MobileDocTimeline(!0),n.Show.MobileProvTimeline(!1),wt(0),!1},ShowMobileProvTimeline:function(){return isProvisionView?(n.Show.MobileDocTimeline(!1),n.Show.MobileProvTimeline(!0),wt(1),!1):(sw.bsAlert("Provision Timeline","The Provision timeline is only available when a single provision is being viewed.<br /><br />To view a single provision, select the checkbox next to the provision in the Table of Contents panel and click on 'Get Provisions'."),!1)},ToggleDesktopTimeline:function(){var i,t;n.Show.DesktopTimeline(!n.Show.DesktopTimeline());i=n.Show.DesktopTimeline()?"On":"Off";n.Show.SearchWithin(0);t=bt("Timeline",i)+window.location.hash;History.pushState({state:t},document.title,t);nt(isProvisionView)},ShowMobileToc:function(){n.Show.Sidebar(!0);n.Show.Toc(!0);n.Show.TopLeftPanel(!1);n.Show.MobileToolbar(!1);$("#topSection").hide();h=$(window).scrollTop();var t=$("#tocNav .nav .active");c=t.length>1?$(t.get(1)).attr("href"):t.attr("href");$("html,body").addClass("mobile-modal-open");setTimeout(function(){if(c&&($("#tocNav .nav .active").removeClass("active"),t=$('#tocNav .nav li a[href="'+it(c)+'"').addClass("active"),c="",!ei(t,r))){var n=t.offset(),i=n?n.top:0,u=r.offset().top;r.scrollTop(r.scrollTop()+(i-u)-50)}},100);g()},HideMobileToc:function(){v();$("html,body").removeClass("mobile-modal-open");$(window).scrollTop(h);$("#topSection").show();$("#nav").removeClass("mobile-expanded").width($("#sidebar").width())},ShowMobileTimeline:function(){n.Show.Sidebar(!0);n.Show.Toc(!1);n.Show.MobileTimeline(!0);n.Show.TopLeftPanel(!1);n.Show.MobileToolbar(!1);wt(isProvisionView);$("#topSection").hide();h=$(window).scrollTop();$("html,body").addClass("mobile-modal-open");g()},HideMobileTimeline:function(){v();$("html,body").removeClass("mobile-modal-open");$(window).scrollTop(h);$("#topSection").show();$("#nav").removeClass("mobile-expanded").width($("#sidebar").width())},ToggleActDetails:function(){return n.Show.ActDetails(!n.Show.ActDetails()),!1},ToggleSidebar:function(){var t=$("#toc ul.nav .active"),r,i;return t.length===0&&(t=$("#toc .active")),r=t.first(),i=r.attr("href"),$(".body-content").hasClass("toc-hidden")?$(".body-content").removeClass("toc-hidden"):$(".body-content").addClass("toc-hidden"),n.Show.Toc(!0),n.Show.Sidebar(!n.Show.Sidebar()),resizePanels(),$("#DesktopToolbar").css("width",$("#fragview").outerWidth()+"px"),setTimeout(function(){var n=$(i);if(n.length>0){var t=$(i).offset(),r=$("#DesktopToolbar").outerHeight(),u=t.top-r-30;$(window).scrollTop(u);fi()}},100),!1},GoToTop:function(){return window.location.hash=window.location.hash==="#top"?"top2":"top",!1},OnClearProvisions:function(){return $(".toc input").prop("checked",!1),!1},OnGetProvisions:function(){var t=[],i=$(".toc input:checked"),r,n,u;if(i.each(function(n,i){t.push($(i).val())}),r=i.length,r===0){alert("Please select at least 1 provision");return}return n=t.join(","),n.length<1700?(u=bt("ProvIds",n)+(t.length===1?"#"+n:""),window.location=u):(currViewFilter.ProvIds=n,sw.postForm(currViewUrl,currViewFilter,"")),!1},OnPrintClick:function(n,t){h=$(window).scrollTop();$("#printModal").on("shown.bs.modal",function(){si()});return y?$("#printModal").modal("show"):$("#printModal .modal-body").load(t.currentTarget.href+"&partial=1",function(){$("#printModal").modal("show");y=1;initPrintForm()}),!1}};$(document).on("click",".legis-download",function(){var n=$(this);return y?ii(n):$("#printModal .modal-body").load($("#printLink").attr("href")+"&partial=1",function(){y=1;initPrintForm();ii(n)}),!1});ti(provTitle);$("#printModal").on("hidden.bs.modal",function(){$(window).scrollTop(h)});disableScrollTracking==="0"&&(li=sw.isXs()||sw.isSm()?$("#topLeftPanel").outerHeight()+$("#mobileToolbar").outerHeight()+rt:$("#DesktopToolbar").outerHeight()+rt,$("body").css("position","relative"),$("#tocNav").swscrollspy({offset:rt,onChange:function(){var i=$("#toc").find("a.active").last(),t="",u,e;lt===1?(t=at,setTimeout(function(){lt=0;at=""},200)):(i.length>0&&!ei(i,r)&&(u=i.offset().top,e=r.offset().top,r.scrollTop(r.scrollTop()+(u-e)-50)),t=$.trim(i.text()));t?(n.LegisTitle1(f(legisTitle,l)),n.SectionTitle(t),n.SectionTitle1(f(t,l)),n.SectionTitle2(f(t,o))):(n.SectionTitle(provTitle),n.SectionTitle1(f(provTitle,l)),n.SectionTitle2(f(provTitle,o)))}}));sw.isMobile()?(v(),ni.Timeline==="On"&&n.ShowMobileTimeline()):(pt(),ni.Timeline==="On"&&(n.Show.DesktopTimeline(!0),nt(isProvisionView)));ri=!1;ui=function(){$("div[data-toggle=popover]").each(function(){$(this).popover("hide")})};$(document).on("touchstart",function(){ui();ri=!1});if(disableScrollTracking==="1")u.on("scroll",function(){yi()});u.on("orientationchange",function(){ot=1;ht=sw.isMobile();setTimeout(function(){sw.isMobile()?(v(),g()):(pt(),resizePanels())},200)});u.on("resize",function(){if(i=u.height(),et=u.width(),ht=sw.isMobile(),oi(),ot){ot=0;return}setTimeout(function(){sw.isMobile()?sw.isTouchDevice&&(n.Show.MobileTimeline()||n.Show.Toc())?g():v():(pt(),resizePanels());si()},200)});resizePanels=function(){if(yt(),disableScrollTracking==="0"){var n=$("#colLegis").width();et<n?$(".table-responsive").parent().css({width:et-62+"px",display:"block"}):($(".table-responsive").parent().css({"max-width":n-20+"px"}),$(".table-responsive").each(function(){var t=$(this),n={},i;n=t.width()<t.find(".table").width()?{"max-height":$(window).height()-100,"overflow-y":"auto"}:{"max-height":"none","overflow-y":"initial"};n["max-width"]=$(window).width()-20;i=t.parent().prev();i.length>0&&i.hasClass("p1No")&&(n["max-width"]=n["max-width"]-44);t.css(n)}))}};setTimeout(function(){disableScrollTracking==="1"&&$(".footer").hide();resizePanels()},100);disableScrollTracking==="0"&&$(window).on("scroll",function(){var t=u.scrollTop(),i;if(t>=(ht?hi:$("#sidebar").position().top)){if(i=$("#nav"),i.addClass("affix").removeClass("affix-top"),sw.isMobile()){$("#colLegis").css({"margin-top":$("#nav").outerHeight()+"px"});return}setTimeout(yt,100)}else $("#nav").addClass("affix-top").removeClass("affix"),$("#colLegis").css({"margin-top":"0px"}),setTimeout(yt,100);t>=201?($("#DesktopToolbar").addClass("affix").removeClass("affix-top"),$("#fragview").css({"margin-top":$("#DesktopToolbar").outerHeight()+"px"}),$("#DesktopToolbar").width($("#fragview").outerWidth())):($("#DesktopToolbar").addClass("affix-top").removeClass("affix"),$("#fragview").css({"margin-top":"20px"}),n.LegisTitle1(""),n.SectionTitle1(""))}).trigger("scroll");$('[data-toggle="tooltip"]').tooltip();$("a[data-toggle=popover]").each(function(){new bootstrap.Popover(this)});tt("#docTimeline");tt("#provTimeline");tt("#mobileDocTimeline");tt("#mobileProvTimeline");$(document).on("click",function(){var n=$(this);n.hasClass("popover")||n.parents(".popover").length>0||$('[aria-describedby^="popover"]').each(function(){var n=bootstrap.Popover.getInstance(this);n&&n.hide()})});vt=function(){for(var n=0;n<timelineItems.length;n++){var t=timelineItems[n],r=parseServerDate(t.Item1),i=new Date(2999,11,31);n+1<timelineItems.length&&(i=parseServerDate(timelineItems[n+1].Item1));r<=b&&b<i&&(w=1,window.location=t.Item2+"&Timeline=On")}w||alert("Could not find any version in force as at "+(sw.isMobile()?$("#versionDateHidden").val():$("#versionDatePicker").val())+".")};$("#versionForm").submit(function(){return vt(),!1});$(".datepicker-trigger").datepicker({autoclose:!0,format:"dd M yyyy",disableTouchKeyboard:!1}).each(function(n,t){validStartDate.getFullYear()!==1753&&($(t).datepicker("setDate",validStartDate),b=validStartDate)}).on("changeDate",function(n){b=n.date;sw.isMobile()&&vt()});sw.popover("#versionsButton","#versionsPopover","bottom");sw.popover("#versionsButton2","#versionsPopover","bottom");$("#toc").find(".form-check").click(function(n){n.stopPropagation()});$("#toc").find("a").click(function(t){var t,i,u,f,e,r;return t.target.tagName==="INPUT"&&t.preventDefault(),$(".row-offcanvas").toggleClass("active"),sw.isMobile()&&n.HideMobileToc(),lt=1,at=$.trim($(this).text()),t=this,i=t.href.substring(t.href.indexOf("#")+1),c="#"+i,u=!1,f=document.getElementById(i),f==null?(f=document.getElementsByName(i),f.length>0&&(u=!0)):u=!0,u?(window.location.hash=i,!1):(e=$(this).attr("data-part"),r=e?e:i,r.indexOf("-.")===-1&&(r=r),w=1,window.location.href=bt("ProvIds",r)+"#"+i,!1)});$("#nav, #TocBar, #ButtonRow, .front .actHd, .front .chapNo").trigger("affixed.bs.affix");ko.applyBindings(n,$("#Container").get(0));$("#docTimeline,#provTimeline").each(function(){var n=$(this).find("ul");n.width(n.find("li").length*140)});$("#ToggleAnnotate").change(function(){$(this).prop("checked")?$(".amendNote").show():$(".amendNote").hide()});$("#ToggleShowDiff").change(function(){window.location=currUrl.replaceAll("&ShowDiff=on","").replaceAll("&ShowDiff=off","")+(currUrl.indexOf("?")>-1?"&":"?")+"ShowDiff="+($(this).prop("checked")?"on":"off")});$("#mobileToggleAnnotate").click(function(){$("#ToggleAnnotate").prop("checked")?($(".amendNote").hide(),$("#ToggleAnnotate").prop("checked",!1),$(this).text("Show Amendment Annotation")):($(".amendNote").show(),$("#ToggleAnnotate").prop("checked",!0),$(this).text("Hide Amendment Annotation"))});$(window).on("hashchange",function(){d(window.location.hash)});setTimeout(function(){var n,t,i,u,f;(ai(),window.location.hash?(t=d(window.location.hash),n=window.location.hash):fragmentPath.length>0&&(t=d(fragmentPath.split(",")[0]),n=fragmentPath.split(",")[0]),n&&t)&&(n=n.replace("#",""),n=n.replace(".",""),i=$('a[href="'+it("#"+n)+'"'),i.length>0&&(u=i.offset().top,f=r.offset().top,r.scrollTop(r.scrollTop()+(u-f)-50)))},100);$(document).on("click","#legis img",function(){window.open($(this).attr("src"),"Legislation Image","width=800,height=600,location=0,menubar=0")});p=0;sw.isTouchDevice||disableScrollTracking!=="0"?($("#loadingIndicator").hide(),$(window).scroll(function(){$(window).scrollTop()+$(window).height()>$(document).height()-100&&k()})):k()});$(function(){window.location.href.indexOf("Print")>-1&&initPrintForm()})