$(function(){(function(){var e=window.History,g=$("title").html(),h=!0;return{init:function(){function k(a){var b={},c;a=("/"+a).split(/[?&]/);for(var d=a.length-1;0<d;d--)b[(c=a[d].split(/[=#]/))[0].toLowerCase()]=1<c.length?decodeURI(c[1]):"";return b}function m(){var a=k(e.getState().hash);$.each(go_params,function(b,c){"undefined"==typeof c.value&&(c.value="");go_params[b].value="undefined"!=typeof a[c.id]&&0<a[c.id].length?a[c.id]:"";""===go_params[b].value&&""!==go_params[b].defaultvalue&&(go_params[b].value=
go_params[b].defaultvalue)});return!0}function n(){$.getJSON(f(),{pb_skiptemplate:1},function(a){if("undefined"!==typeof a.content&&""!==a.content)return $("#news-content").html(a.content),$(".paginationwrap").html(a.pagination),l(a.available),h&&$("html,body").animate({scrollTop:$(".page-news").offset().top},400),h=!0;e.back();return!1})}function f(){var a="/"+gs_alias,b=a.length;$.each(go_params,function(c,d){"undefined"!=typeof d.value&&0<d.value.toString().length&&(a+=a.length>b?"&"+d.id+"="+
d.value:"?"+d.id+"="+d.value)});return a}function l(a){a=a||go_available;null===a||0===a.length?$(".filter-list option").removeClass("disabled"):$(".filter-list option").each(function(){el=$(this).parent("select").data("container");if("all"==$(this).val())return $(this).removeAttr("disabled"),1;opt=$(this).parent("select").find("option:selected");if(0<opt.length&&"all"!=opt.val())return 1;v=$(this).val();"undefined"==typeof a[el]?$(this).attr("disabled","disabled"):"undefined"==typeof a[el][v]?$(this).attr("disabled",
"disabled"):$(this).removeAttr("disabled")})}if(0===$("#news-content").length)return!1;$(window).bind("statechange",function(){m();n()});$(document).on("click",".pagination a",function(){var a=k($(this).attr("href"));go_params.page.value=a[go_params.page.id];e.pushState(go_params,g,f());return!1});$(".filter-list li").click(function(){var a=$(this).parent().attr("data-container");h=!1;go_params[a].value=$(this).attr("data-category");$("."+a).val($(this).val());e.pushState(go_params,g,f());return!1});
$(".reset").click(function(a){a.preventDefault();$(".filter-list li").parents(".filter-list").find("li").removeClass("active");id=$(".filter-list li").parents(".filter-list").attr("data-container");1==$("."+id).length?go_params[id].value="":(go_params[id].value="",$("."+id+" li.active span").each(function(){go_params[id].value+="|"+$(".filter-list li").attr("data-"+id)}));e.pushState(go_params,g,f());return!1});l();return!0}}})().init()});