(function(a){a.LyricRat={_a:2020,_b:0,_c:function(){var b=this;a.ajax({type:"post",url:"/search/"+this._d+".json",dataType:"json",success:function(d,c){if(d.status=="ok"){b._e(d.result_id,d.result)
}else{b._f()}},error:function(e,d,c){logError("_c:"+b._d,c,d)},timeout:10000})},_f:function(){var b=this;if(this._b++>100){logError("_checkAgain","failsafe",this._b);
return false}window.setTimeout(function(){b._c()},b._a)},_e:function(d,c){var e=window.location.href,b=e.match(/^(http:\/\/[^\/]+\/)lyrics\//);
if(b){window.location=b[1]+"#"+d}else{this._g(c);this._h(d)}},_h:function(b){if(!this._i||this._i!=b){try{window.location.hash=b
}catch(c){}}this._i=b},_j:function(c){var b=this;a.ajax({type:"post",url:"/t/"+c+".json",dataType:"json",success:function(f,d){if(f.status=="ok"){b._g(f.result);
b._h(f.result_id)}else{try{window.location.hash="";logError("_loadResult","bad token",c)}catch(e){}}},error:function(f,e,d){logError("_j:ajax.error:"+c,d,e)
},timeout:10000})},logError:function(e,c,d){try{var b=escape(e+"|"+(c?c:"-")+"|"+(d?d:"-"));a("body").append('<img src="/_.gif?'+b+'" width="1" height="1" />')
}catch(c){}},_g:function(b){this._d=null;a("#results .song").html(b);a("body").addClass("finished").removeClass("searching")
},_k:function(){var b=this;a("body").removeClass("finished").addClass("searching");a.ajax({type:"post",url:"/search.json",data:{query:a("#search_query").val()},dataType:"json",success:function(d,c){b._d=d.search_id;
b._f()},error:function(e,d,c){logError("_search",c,d+" ["+a("#search_query").val()+"]")},timeout:10000})},start:function(){var b=this;
try{a("#sbox .btn").hide();a("#sbox .jsbtn").show().click(function(e){e.preventDefault();e.stopPropagation();b._k();return false
});a("#sbox form").submit(function(e){e.preventDefault();e.stopPropagation();b._k();return false})}catch(d){}try{var c=window.location.hash;
if(c.length>1){this._j(c.substring(1))}}catch(d){}a(window).load(function(){a("#search_query").focus()})},_d:null,_i:null}
})(jQuery);