((function(){(function(a){return a.fn.ajax_busy_link=function(){var b,c,d,e,f,g,h=this;return g=a(this).attr("data-showresult"),g=g?g:!1,f=a(this).attr("data-hidelink"),f=f?f:!1,d=a(this).parent().prev(),b=d.children(".ajax_busy"),e=d.children(".ajax_success"),c=d.children(".ajax_error"),a(this).bind("ajax:beforeSend",function(d,g,i){e.hide(),c.hide(),b.show();if(f)return a(h).hide()}),a(this).bind("ajax:success",function(a,b,c,d){}),a(this).bind("ajax:error",function(a,b,c,d){}),a(this).bind("ajax:complete",function(d,f,i){var j;j=f.responseText,b.hide(),a(h).show();switch(f.status){case 200:case 201:case 202:if(g)return e.show();break;case 301:return window.location.replace(j);default:g&&c.show();if(j.size>0&&f.status!==422)return a("html").replaceWith(j)}})}})(jQuery)})).call(this),function(){(function(a){return a.fn.init_dialog=function(b){var c;return c=a(this),c.attr("data-table-id",b),c.css({"max-width":a(window).width()*.8,"overflow-x":"auto","max-height":a(window).height()*.8,"overflow-y":"auto"}),c.dialog({autoOpen:!0,title:c.attr("data-title"),width:"auto",resize:"auto",resizable:!0,modal:!0,draggable:!0,zIndex:11e3}),c.bind("dialogclose",function(a){return c.remove()})},a.fn.form_dialog=function(){var b,c,d=this;return b=a(this),c=b.find("form"),c.bind("ajax:beforeSend",function(a,b,c){}),c.bind("ajax:success",function(a,b,c,d){}),c.bind("ajax:error",function(a,b,c,d){}),c.bind("ajax:complete",function(c,d,e){var f,g;f=d.responseText,g=a("#"+b.attr("data-table-id")).dataTable(),b.dialog("close");switch(d.status){case 200:return a(".main-content").html(f);case 201:return g.fnDraw();case 202:return g.fnDraw();case 301:case 302:return b.parent.window.location.replace(f);case 422:return a(f).init_dialog(g.attr("id"));default:return a("html").replaceWith(f)}})}})(jQuery)}.call(this),function(){jQuery(function(){return $(".tabs").livequery(function(){return $(this).tabs()}),$(".accordion").livequery(function(){return $(this).accordion()}),$(".button, button, input[type='submit']").livequery(function(){return $(this).button()}),$(".in_place_edit").livequery(function(){return $(this).in_place_edit()}),$(".open_form_link").livequery(function(){return $(this).open_form_link()}),$(".modify_list_link").livequery(function(){return $(this).modify_list_link()}),$(".form_dialog").livequery(function(){return $(this).form_dialog()}),$(".destroy_item_link").livequery(function(){return $(this).destroy_item_link()}),$(".popup_attribute_link").livequery(function(){return $(this).popup_attribute_link()}),$(".static_progress_bar").livequery(function(){return $(this).static_progress_bar()}),$(".local_resource_list").livequery(function(){return $(this).init_resource_list("local")}),$(".short_resource_list").livequery(function(){return $(this).init_resource_list("short")}),$(".long_resource_list").livequery(function(){return $(this).init_resource_list("long")}),$(".ajax_busy_link").livequery(function(){return $(this).ajax_busy_link()})})}.call(this),function(){jQuery(function(){return $("ul#menubar li").hover(function(){return $("ul",this).slideDown(200),$(this).children("a:first").addClass("hov")},function(){return $("ul",this).slideUp(100),$(this).children("a:first").removeClass("hov")})})}.call(this),function(){(function(a){return a.fn.static_progress_bar=function(){var b;return b=parseInt(a(this).attr("data-percent")),a(this).progressbar({value:b})}})(jQuery)}.call(this),function(){(function(a){return a.fn.open_form_link=function(){var b=this;return a(this).bind("ajax:beforeSend",function(a,b,c){}),a(this).bind("ajax:success",function(a,b,c,d){}),a(this).bind("ajax:error",function(a,b,c,d){}),a(this).bind("ajax:complete",function(c,d,e){var f,g;return f=d.responseText,d.status===200?(g=a(b).attr("data-table"),g||(g=a(c.target).closest(".short_resource_list,.long_resource_list").attr("id")),a(f).init_dialog(g)):a("body").replaceWith(f)})},a.fn.modify_list_link=function(){var b=this;return a(this).bind("ajax:beforeSend",function(a,b,c){}),a(this).bind("ajax:success",function(a,b,c,d){}),a(this).bind("ajax:error",function(a,b,c,d){}),a(this).bind("ajax:complete",function(c,d,e){var f,g;f=d.responseText,g=a("#"+a(b).attr("data-table")).dataTable();switch(d.status){case 200:case 201:case 202:return g.fnDraw();case 301:case 302:return window.location.replace(f);default:return a("html").replaceWith(f)}})},a.fn.destroy_item_link=function(){var b=this;return a(this).click(function(c){return confirm(a(b).attr("data-confirm-1"))&&confirm(a(b).attr("data-confirm-2"))?!0:!1}),a(this).bind("ajax:beforeSend",function(a,b,c){}),a(this).bind("ajax:success",function(a,b,c,d){}),a(this).bind("ajax:error",function(a,b,c,d){}),a(this).bind("ajax:complete",function(b,c,d){var e,f;return e=c.responseText,c.status===202?(f=a(b.target).closest(".short_resource_list,.long_resource_list").dataTable(),f.fnDraw()):a("body").replaceWith(e)})},a.fn.popup_attribute_link=function(){var b,c;return b=a(this),c=a("#"+b.attr("data-popup")),c.show(),b.et(c.find("p"),"click",{color:"yellow"})}})(jQuery)}.call(this),function(){(function(a){return a.fn.init_resource_list=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;v=a(this),f=a("#"+v.attr("id")+"_data"),w=a("#"+v.attr("id")+"_tools");if(f!==null){c=a(f).attr("data-ajaxsource"),e=a(f).find("script.columndef"),d=e.size()>0?jQuery.parseJSON(e.text()):[],u=a(f).find("script.sortdef"),t=u.size()>0?jQuery.parseJSON(u.text()):[],j=a(f).find("script.filterdef"),i=j.size()>0?jQuery.parseJSON(j.text()):[],l=j.attr("data-location"),r=a(f).find("script.lengthmenudef"),q=r.size()>0?jQuery.parseJSON(r.text()):[[5,10,15,20,25],[5,10,15,20,25]],s={bJQueryUI:!0,bAutoWidth:!0,width:"100%",bStateSave:!0,iCookieDuration:604800,bServerSide:!0,bProcessing:!0,sAjaxSource:c,aaSorting:t,aoColumns:d,fnServerData:function(b,c,d){var e,f,g,h,j;if(i)for(f=0,j=i.length;f<j;f++)e=i[f],g="sSearchHelper_"+f,h=e?e.helper:"",c.push({name:g,value:h});return a.ajax({dataType:"json",type:"POST",url:b,data:c,success:d})},oLanguage:{sEmptyTable:"Nothing to show",sProcessing:"<table align='center' height='100%'><tr><td align='center', valign='middle'><img src='/assets/icons/ajax_busy_large.gif' /></td></tr></table>"}};switch(b){case"short":s=jQuery.extend(!0,s,{bInfo:!1,bStateSave:!1,bPaginate:!1,bSort:!1,bSortCellsTop:!1,bFilter:!1});break;case"long":s=jQuery.extend(!0,s,{bInfo:!0,bPaginate:!0,bLengthChange:!0,sPaginationType:"full_numbers",aLengthMenu:q,bSort:!0,bSortCellsTop:!1,bFilter:!0});if(l){o=v.find("thead > tr"),m=function(){switch(l){case"head:before":case"head:after":return a("<tr>").insertBefore(o);case"foot":return n=v.find("tfoot"),n=n.size()===0?a("<tfoot>").appendTo(v):n,a("<tr>").appendTo(n)}}();for(p=1,x=i.length;1<=x?p<=x:p>=x;1<=x?p++:p--)h=i[p-1],k=a("<th>").appendTo(m),h&&h.type==="select"&&k.text("(All)"),h&&h.type==="text"&&l==="foot"&&k.text(o.children()[p-1])}}g=v.dataTable(s);if(b==="long")return g.columnFilter({sPlaceHolder:l,aoColumns:i})}}})(jQuery)}.call(this),function(){jQuery(function(){return function(){var a,b;return a=document.createElement("script"),a.type="text/javascript",a.async=!0,a.src="https://apis.google.com/js/plusone.js",b=document.getElementsByTagName("script")[0],b.parentNode.insertBefore(a,b)}(),function(){var a;return a=document.createElement("script"),a.type="text/javascript",a.async=!0,a.src="//platform.twitter.com/widgets.js",document.getElementsByTagName("head")[0].appendChild(a)}(),function(a,b,c){var d,e;e=void 0,d=a.getElementsByTagName(b)[0];if(a.getElementById(c))return;return e=a.createElement(b),e.id=c,e.src="//connect.facebook.net/en_GB/all.js#xfbml=1",d.parentNode.insertBefore(e,d)}(document,"script","facebook-jssdk")})}.call(this);
