var rq=function(a){hu=window.location.search.substring(1);gy=hu.split("&");for(i=0;i<gy.length;i++){ft=gy[i].split("=");if(ft[0]==a){return ft[1]}}};var notify=function(b){$(".panel #info").hide().text(b).fadeIn(300).delay(1200).fadeOut(150)};(function(){function a(){$(".manage-songs .groups").sortable({handle:".groupHandle",update:function(){$.ajax({type:"POST",url:"/ajax/?page="+rq("page")+"&w=groups-sort",data:$(this).sortable("serialize"),success:function(b){if(b=="success"){notify("Sortering sparad!")}else{alert(b)}}})}});$(".manage-songs .groups .group .title > .delBtn").click(function(){var b=$(this),c=$(this).parent().parent().attr("id").toString().replace("group_","");if(confirm("Vill du ta bort denna?")){$.ajax({type:"GET",url:"/ajax/?page="+rq("page")+"&w=group-delete&id="+c,success:function(d){if(d=="success"){$(b).parent().parent().find(".songs .song").appendTo(".manage-songs #songs_0");$(b).parent().parent().remove()}else{alert(d)}}})}return false});$(".manage-songs .songs").sortable({handle:".songHandle",connectWith:".manage-songs .songs",update:function(){$.ajax({type:"POST",url:"/ajax/?page="+rq("page")+"&w=songs-sort&id="+$(this).attr("id").toString().replace("songs_",""),data:$(this).sortable("serialize"),success:function(b){if(b=="success"){notify("Sortering sparad!")}else{alert(b)}}})}});$(".manage-songs .songs .song > .delBtn").click(function(){var b=$(this),c=$(this).parent().attr("id").toString().replace("song_","");if(confirm("Vill du ta bort denna låt?")){$.ajax({type:"GET",url:"/ajax/?page="+rq("page")+"&w=song-delete&id="+c,success:function(d){if(d=="success"){$(b).parent().remove()}else{alert(d)}}})}return false});$(".mp3player").each(function(b){var d=$(this).attr("id").toString(),c=new SWFObject("/mp3player/mp3player.swf","playlist","345","135",d);c.addVariable("file","/playlist/?id="+d.replace("player",""));c.addVariable("backcolor","0x031a28");c.addVariable("frontcolor","0xfdd83d");c.addVariable("lightcolor","0xccccff");c.addVariable("displayheight","0");c.write(d)})}$(function(){a();$("#header").click(function(){window.location="?page=36"})})})();
