$(function(){var b=function(d,e){$.ajax({data:{cat:d,cnt:e},error:function(g,f,h){showLoadError($("#message td"))},success:function(g,f){if(typeof g.success!=undefined&&g.success){c(g)}else{showLoadError($("#message td"))}},type:"POST",dataType:"json",url:"/services/trends-load/format/json"})};var c=function(h){var e,f,g;e=$("#trends").html("");for(var f in h.s){g=h.s[f];e.append('<tr><td span class="gry">'+(Number(f)+1)+'</span> <a href="/services/detail/'+g.c+'">'+g.n+'</a></td><td><a href="/services/all?c='+encodeURIComponent(g.t)+'">'+h.cn[g.t]+'</a></td><td><img src="'+g.s+'" width="60" height="20"/></td><td class="right">'+g.p+'%</td><td class="right"><span class="'+((g.d==0)?"":((g.d>0)?"grn":"red"))+'">'+g.d+"%</span></td></tr>")}$("#trends").show();clearMessage($("#message td"))};var a=function(d,f){var e={};e[d]=$(f).val();document.location.href=$.param.fragment(document.location.href,e)};$("#topservices-cat").change(function(d){a("cat",this)});$("#topservices-cnt").change(function(d){a("cnt",this)});$(window).bind("hashchange",function(f){var d=$.deparam.fragment();if(typeof d.cat=="undefined"){d.cat=""}if(typeof d.cnt=="undefined"){d.cnt=10}$("#topservices-cat").val(d.cat);$("#topservices-cnt").val(d.cnt);showLoadPending($("#message td"));$("#trends").hide();b(d.cat,d.cnt)});$(window).trigger("hashchange")});