/*! flypanels - v0.12.1 - 2015-06-17 * https://github.com/subzane/flypanels * copyright (c) 2015 andreas norman; licensed mit */ !function(a){function b(b,d){function e(){f(),c=a(".flypanels-left").css("width"),y(),d.search.init&&t(),d.treemenu.init&&g(),a(document).ready(function(){e.removeclass("preload")}),b("oninit")}function f(){a(".flypanels-left").css("height",f),a(".flypanels-right").css("height",f),a(".flypanels-overlay").css("height",f)}function g(){(kitutils.isandroid()||kitutils.isios())&&a(".flypanels-treemenu").addclass("touch"),a(".flypanels-treemenu li.haschildren "+d.treemenu.expandhandler).click(function(b){a(this).parent().parent().toggleclass("expanded"),b.preventdefault()})}function h(){r(),p(),n()}function i(){a("body").removeclass("flypanels-open"),a("html").removeclass("flypanels-open"),b("oncloseleft")}function j(){a("body").removeclass("flypanels-open"),a("html").removeclass("flypanels-open"),b("oncloseright")}function k(){a("body").addclass("flypanels-open"),a("html").addclass("flypanels-open"),b("onopenleft")}function l(){a("body").addclass("flypanels-open"),a("html").addclass("flypanels-open"),b("onopenright")}function m(){a(".flypanels-content").append('
'),a(".flypanels-content").on("click touchmove touchend touchleave touchcancel",function(a){h(),a.preventdefault()}),b("onopen")}function n(){a(".flypanels-content #flypanels-overlay").remove(),a(".flypanels-content").off("click touchmove touchend touchleave touchcancel"),b("onclose")}function o(b){e.addclass("openright"),settimeout(function(){a(".flypanels-right").find('[data-panel="'+b+'"]').show(),l(),m()},200)}function p(){e.removeclass("openright"),settimeout(function(){a(".offcanvas .panelcontent").hide(),j(),n()},200)}function q(b){e.addclass("openleft"),settimeout(function(){a(".flypanels-left").find('[data-panel="'+b+'"]').show(),k(),m()},200)}function r(){e.removeclass("openleft"),settimeout(function(){a(".offcanvas .panelcontent").hide(),i(),n()},200)}function s(){f=window.innerheight,f()}function t(){(kitutils.isandroid()||kitutils.isios())&&a(".flypanels-searchresult").addclass("touch"),d.search.searchpanel.find(".searchbutton").on("click",function(a){a.preventdefault(),v("show"),w(d.search.searchpanel.find(".searchbox input").val())}),d.search.searchpanel.find(".searchbox input").keydown(function(b){13===b.which&&(v("show"),w(a(this).val()),a(this).blur())}),j.has("searchquery")===!0&&d.search.savequerycookie===!0&&w(j.get("searchquery"))}function u(a){"hide"===a?d.search.searchpanel.find(".errormsg").hide():d.search.searchpanel.find(".errormsg").show()}function v(a){"hide"===a?d.search.searchpanel.find(".loading").hide():d.search.searchpanel.find(".loading").show()}function w(b){u("hide"),$jsonurl=d.search.searchpanel.find(".searchbox").data("searchurl"),$ajaxcall=a.ajax({url:$jsonurl+"&q="+b,datatype:"json"}),$ajaxcall.done(function(a){var c;$foundresults=a.items.length,$foundresults>0?(d.search.savequerycookie===!0&&j.set("searchquery",b,null,"/"),c=x(a.items)):(d.search.savequerycookie===!0&&j.remove("searchquery","/"),u("show")),d.search.searchpanel.find(".resultinfo .query").html(b),d.search.searchpanel.find(".resultinfo .num").html($foundresults),d.search.searchpanel.find(".flypanels-searchresult").html(c),v("hide"),d.search.searchpanel.find(".resultinfo").show(),d.search.searchpanel.find(".flypanels-searchresult").show()}),$ajaxcall.fail(function(){u("show")})}function x(a){output="