function applyFilter(){var n=getParameterByName("search"),t=getParameterByName("sort"),i=getTagString(),r=getTypeString(),u=$('input[name="dates"]').val().trim();document.location.href=createURL(i,r,u,n,t,null)}function applyPage(n){var t=getParameterByName("search"),i=getParameterByName("sort"),r=getParameterByName("tags"),u=getParameterByName("types"),f=getParameterByName("dateRange");document.location.href=createURL(r,u,f,t,i,n)}function applySearch(){var n=getParameterByName("sort"),t=getParameterByName("tags"),i=getParameterByName("types"),r=getParameterByName("dateRange"),u=$("#searchBox").val();document.location.href=createURL(t,i,r,u,n,null)}function applySort(n){var t=getParameterByName("tags"),i=getParameterByName("types"),r=getParameterByName("dateRange"),u=getParameterByName("search");document.location.href=createURL(t,i,r,u,n,null)}function clearFilter(){var n=getParameterByName("sort");document.location.href=createURL(null,null,null,null,n,null)}function clearSearch(){$("#searchBox").val("");applySearch()}function createURL(n,t,i,r,u,f){var e="";return n!=undefined&&n!=null&&n!=""&&(e+="?tags="+n),t!=undefined&&t!=null&&t!=""&&(e+=e!=""?"&types="+t:"?types="+t),i!=undefined&&i!=null&&i!=""&&(e+=e!=""?"&dateRange="+i:"?dateRange="+i),r!=undefined&&r!=null&&r!=""&&(e+=e!=""?"&search="+r:"?search="+r),u!=undefined&&u!=null&&u!=""&&(e+=e!=""?"&sort="+u:"?sort="+u),f!=undefined&&f!=null&&f!=""&&(e+=e!=""?"&page="+f:"?page="+f),basePath+e}function getParameterByName(n,t){t||(t=window.location.href);n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}function getTagString(){var n="";return $.each($("#tags input:checked"),function(){n+=$(this).attr("value")+","}),n=trimChar(n,",")}function getTypeString(){var n="";return $.each($("#types input:checked"),function(){n+=$(this).attr("value")+","}),n=trimChar(n,",")}function showHideFilter(){$("#sort").hide();$("#sortMenuItem").removeClass("selected");$("#search").hide();$("#searchMenuItem").removeClass("selected");var n=$("#filter"),t=$("#filterMenuItem");n.is(":visible")?(n.fadeOut("slow"),t.removeClass("selected")):(n.fadeIn("slow"),t.addClass("selected"))}function showHideSearch(){$("#sort").hide();$("#filter").hide();$("#sortMenuItem").removeClass("selected");$("#filterMenuItem").removeClass("selected");var n=$("#search"),t=$("#searchMenuItem");n.is(":visible")?(n.fadeOut("slow"),t.removeClass("selected")):(n.fadeIn("slow"),t.addClass("selected"))}function showHideSort(){$("#filter").hide();$("#filterMenuItem").removeClass("selected");$("#search").hide();$("#searchMenuItem").removeClass("selected");var n=$("#sort"),t=$("#sortMenuItem");n.is(":visible")?(n.fadeOut("slow"),t.removeClass("selected")):(n.fadeIn("slow"),t.addClass("selected"))}function allTagsClickHandler(){$("#all_subjects").is(":checked")?$("#tags input").prop("checked",!0):$("#tags input").prop("checked",!1)}function allTypesClickHandler(){$("#all_subjects_types").is(":checked")?$("#types input").prop("checked",!0):$("#types input").prop("checked",!1)}function allTagsInit(){$("#tags input:checkbox:checked").length==$("#tags input").length?$("#all_subjects").prop("checked",!0):$("#all_subjects").prop("checked",!1)}function allTypesInit(){$("#types input:checkbox:checked").length==$("#types input").length?$("#all_subjects_types").prop("checked",!0):$("#all_subjects_types").prop("checked",!1)}$(document).ready(function(){var i=document.getElementById("stick"),r=i.offsetTop,n=$("#numberOfPages").val(),t=$("#currentPage").val();n&&$("#pagination, #paginationTop").twbsPagination({totalPages:n,visiblePages:7,startPage:parseInt(t),onPageClick:function(n,i){t!=i&&applyPage(i)}}).show();$('input[name="dates"]').daterangepicker({locale:{format:"DD/MM/YYYY"},autoApply:!0,ranges:{Today:[moment(),moment()],Yesterday:[moment().subtract(1,"days"),moment().subtract(1,"days")],"Next 7 Days":[moment(),moment().subtract(-6,"days"),moment()],"Next 30 Days":[moment(),moment().subtract(-29,"days"),moment()],"This Month":[moment().startOf("month"),moment().endOf("month")],"Next Month":[moment().subtract(-1,"month").startOf("month"),moment().subtract(-1,"month").endOf("month")]},alwaysShowCalendars:!0,autoUpdateInput:!1});$('input[name="dates"]').on("apply.daterangepicker",function(n,t){t.startDate&&t.endDate?$('input[name="dates"]').val(t.startDate.format("DD/MM/YYYY")+" - "+t.endDate.format("DD/MM/YYYY")):$('input[name="dates"]').val("")});$("#search").keypress(function(n){var t=n.which;if(t==13)return applySearch(),!1});$('input[name="dates"]').on("cancel.daterangepicker",function(){$('input[name="dates"]').val("")});$('input[name="dates"]').change(function(){var n=$('input[name="dates"]').val();n==""&&($('input[name="dates"]').data("daterangepicker").setStartDate(moment()),$('input[name="dates"]').data("daterangepicker").setEndDate(moment()))});$("#tags input").change(function(){allTagsInit()});allTagsInit();$("#types input").change(function(){allTypesInit()});allTypesInit();$("#all_subjects").change(function(){allTagsClickHandler()});$("#all_subjects_types").change(function(){allTypesClickHandler()})}),function(n,t,i,r){"use strict";var f=n.fn.twbsPagination,u=function(t,i){var u,f,r;if(this.$element=n(t),this.options=n.extend({},n.fn.twbsPagination.defaults,i),this.options.startPage<1||this.options.startPage>this.options.totalPages)throw new Error("Start page option is incorrect");if(this.options.totalPages=parseInt(this.options.totalPages),isNaN(this.options.totalPages))throw new Error("Total pages option is not correct!");if(this.options.visiblePages=parseInt(this.options.visiblePages),isNaN(this.options.visiblePages))throw new Error("Visible pages option is not correct!");if(this.options.beforePageClick instanceof Function)this.$element.first().on("beforePage",this.options.beforePageClick);if(this.options.onPageClick instanceof Function)this.$element.first().on("page",this.options.onPageClick);return this.options.hideOnlyOnePage&&this.options.totalPages==1?(this.options.initiateStartPageClick&&this.$element.trigger("page",1),this):(this.options.href&&(this.options.startPage=this.getPageFromQueryString(),this.options.startPage||(this.options.startPage=1)),u=typeof this.$element.prop=="function"?this.$element.prop("tagName"):this.$element.attr("tagName"),u==="UL"?this.$listContainer=this.$element:(f=this.$element,r=n([]),f.each(function(){var t=n("