$(function(){$.widget("custom.catcomplete",$.ui.autocomplete,{_renderMenu:function(d,c){var b=this;var a="";$.each(c,function(e,f){if(f.module!=a){d.append('<li class="ui-autocomplete-category"><h3 class="small">'+f.module+"</h3></li>");a=f.module}b._renderItem(d,f)});d.append('<li class="detailedResults"><a href="#">View detailed search results</a></li>');d.addClass("dropdown-menu");d.addClass("search-dropdown-menu");d.find(".detailedResults a").click(function(){$(".navbar-search").submit()})},_renderItem:function(a,b){return $('<li class="clearfix"></li>').data("item.autocomplete",b).append('<a><img src="'+b.icon+'" alt="" class="pull-left">'+b.description+"</a>").appendTo(a)}});$("#globalSearchInput").catcomplete({source:function(b,a){$.ajax({url:KAJONA_WEBPATH+"/xml.php?admin=1",type:"POST",dataType:"json",data:{search_query:b.term,module:"search",action:"searchXml",asJson:"1"},success:a})},select:function(a,b){if(b.item){document.location=b.item.link}}});$("#content a[rel=popover]").popover();KAJONA.admin.tooltip.initTooltip();KAJONA.admin.contextMenu.showElementMenu=function(){};KAJONA.admin.statusDisplay.classOfMessageBox="alert alert-info";KAJONA.admin.statusDisplay.classOfErrorBox="alert alert-error";KAJONA.admin.scroll=null;$(window).scroll(function(){var a=$(this).scrollTop();if(a>10&&KAJONA.admin.scroll!="top"){$("ul.breadcrumb").addClass("breadcrumbTop");KAJONA.admin.scroll="top"}else{if(a<=10&&KAJONA.admin.scroll!="margin"){$("ul.breadcrumb").removeClass("breadcrumbTop");KAJONA.admin.scroll="fixed"}}})});