var playing;function play(song,mp3){if(song){$('#playing').html('Stiahni: <a href="'+mp3+'">'+song+'</a>');$('#player').jwPlayer('load',mp3);}};function first(){play($("table td.song").html(),$("table td.song").next("td").children("a").attr("href"));}
function ready(){if(playing==1){first();}
playing=2;}
function load_list(query){$('#data').load('/data.php?q='+encodeURIComponent(query),function(){if(playing==2){first();}
playing=1;$("table td.song").click(function(){play($(this).html(),$(this).next("td").children("a").attr("href"));});$("table td.song").hover(function(){$(this).addClass("i");},function(){$(this).removeClass("i");});});}
function trim(str){return(new String(str)).replace(/^\s+|\s+$/g,"");}
var sugg=[];handleResponse=function(suggestions){sugg=[];key=trim(suggestions[0]);for(key in suggestions[1]){sugg.push(suggestions[1][key][0]);}}
$(document).ready(function(){$('#player').jwPlayer({id:'jwPlayer',swf:'/player.swf',height:24,width:728,autostart:"true",playerready:ready});$('#q').focus();$.trackPage('UA-6091696-1');$('a[rel*=external]').click(function(){window.open(this.href);return false;});$('#q').autocomplete({source:function(request,response){$.ajax({url:'http://suggestqueries.google.com/complete/search?ds=yt&client=youtube&jsonp=handleResponse',dataType:'script',data:{q:request.term},success:function(){response($.map(sugg,function(item){return{label:item}}));}});},minLength:3});$('#fb').html('<fb:like href="http://www.mp3ky.info" show_faces="true" width="450" font="verdana"></fb:like>');});
