jQuery(function(e){var t=function(s,t,a){"undefined"!=typeof wysijaLazyLoad&&(StatsFilter.instance.isInProgress=!0,wysijaLazyLoad.options.data=t,wysijaLazyLoad.options.task=a,wysijaLazyLoad.options.filter={from:e("#stats-filter-from").val(),to:e("#stats-filter-to").val(),lastDays:e("#custom-date").val()},wysijaLazyLoad.init(function(t,a){0===a&&(StatsFilter.instance.isInProgress=!1),jQuery(s).append(t.result)}))};if(function(){var a=new StatsFilter({from:e("#stats-filter-from").val(),to:e("#stats-filter-to").val(),lastDays:e("#custom-date").val(),formName:"stats-filter",forceToSortByDesc:!0}),s=!1;e("#stats-filter-from").change(function(t){s||(e("#custom-date").val(0),a.lastDaysChange(e("#custom-date").val())),a.fromChange(t)}),e("#stats-filter-to").change(function(t){s||(e("#custom-date").val(0),a.lastDaysChange(e("#custom-date").val())),a.toChange(t)}),e("#custom-date").change(function(t){s=!0,e("#stats-filter-from").val(e(t.target.options[t.target.selectedIndex]).attr("from")).change(),e("#stats-filter-to").val(e(t.target.options[t.target.selectedIndex]).attr("to")).change(),a.lastDaysChange(t.target.value),s=!1,"0"!=t.target.value&&e("#stats-filter").submit()}),e("#stats-filter").submit(function(t){a.submit(t,wysijaStatisticVars.lazyLoad)}),e(document).on("click",".sort-filter",function(){var t=e(this).hasClass("asc")?"asc":"desc";t="desc"===t?"asc":"desc",e(this).removeClass("desc").removeClass("asc").addClass(t),a.orderDirection=t,a.orderBy=e(this).attr("rel"),a.block=e(this).parents(".container").attr("rel"),a.doFilter(e(this).parents(".container"),wysijaStatisticVars.lazyLoad)}),e(".page-limit").click(function(){a.itemPerPage=parseInt(e(this).html()),a.block=e(this).parents(".container").attr("rel"),a.doFilter(e(this).parents(".container"),wysijaStatisticVars.lazyLoad)}),e(document).on("click",".page-limit",function(){a.itemPerPage=parseInt(e(this).html()),a.block=e(this).parents(".container").attr("rel"),a.doFilter(e(this).parents(".container"),wysijaStatisticVars.lazyLoad)})}(),e(wysijaStatisticVars.filter.datePickerElements).datepicker({dateFormat:wysijaStatisticVars.filter.dateFormat}),wysijaStatisticVars.lazyLoad){var a=jQuery.extend([],wysijaStatisticVars.lazyLoad.lazyLoadBlocks);t(wysijaStatisticVars.lazyLoad.targetContainer,a,wysijaStatisticVars.lazyLoad.task)}});