/*
    This file contains js functions for launching and tuning the radio
    adding tracks to playlists, any anything else stream oriented.
*/
function tune_SimilarArtists(id){
    infoid=id;
    infotype=6;
    infotxt='Similar Artists Mode';
    params = "mode=similarartists&id="+id+"&infotype="+infotype+"&infoid="+infoid+"&infotxt="+infotxt;
    tune_URL(params);
}
function tune_PersonalRadio(id){
    infoid=id;
    infotype=4;
    infotxt='Personal Radio';
    params = "mode=personalradio&id="+id+"&infotype="+infotype+"&infoid="+infoid+"&infotxt="+infotxt;
    tune_URL(params);
}
function tune_ProfileRadio(id){
    infoid=id;
    infotype=4;
    infotxt='Profile Radio';
    params = "mode=profileradio&id="+id+"&infotype="+infotype+"&infoid="+infoid+"&infotxt="+infotxt;
    tune_URL(params);
}
function tune_GroupRadio(id){
    infoid=id;
    infotype=20;
    infotxt='Group Radio';
    params = "mode=groupradio&id="+id+"&infotype="+infotype+"&infoid="+infoid+"&infotxt="+infotxt;
    tune_URL(params);
}

function tune_OpenPlayer() {
    popup = window.open('/player/index.php',"popupplayer","toolbar=no, location=no, directories=no, menubar=no,scrollbars=yes, resizable=yes, width=520, height=400");
    setTimeout('popup.focus()',100);
    //popup.name = "popupplayer";
    window.name = "lastfm";
}
function tune_URL(params) {
    url = "/player/tuner.php?" + params;
    popup = window.open(url,"popupplayer","toolbar=no, location=no, directories=no,menubar=no, scrollbars=yes, resizable=yes, width=520, height=400");
    setTimeout('popup.focus()',100);
    //popup.name = "popupplayer";
    window.name = "lastfm";
}
                        
function tune_addAlbumToPlaylist(id){
    tune_URL("mode=addalbumtoplaylist&album="+id+"&infotxt=Playlist");
}
function tune_addTrackToPlaylist(id){
    tune_URL("mode=addtracktoplaylist&track="+id+"&infotxt=Playlist");
}
