|
|
\n');
}
function RetrieveRandomSong(numberOfSongs, currentSong) {
var randomNumber = Math.floor(Math.random() * numberOfSongs);
if (artistSongs[randomNumber][1] == currentSong && numberOfSongs > 1) {
randomNumber = RetrieveRandomSong(numberOfSongs, currentSong);
}
return randomNumber;
}
function LoadRandomSong(bPlaySong) {
var randomNumber = RetrieveRandomSong(artistSongs.length, currentSong);
LoadSelectedSong(artistSongs[randomNumber][0], artistSongs[randomNumber][1], artistSongs[randomNumber][2]);
if (bPlaySong == true) {
StartSong();
}
}
function LoadSelectedSong(artist, song, song_description) {
currentSong = song;
if (isIE) {
document.getElementById("swl_media_player").SetVariable("swl_artist", artist);
document.getElementById("swl_media_player").SetVariable("swl_html_song", song);
document.getElementById("swl_media_player").SetVariable("swl_song_description", song_description);
document.getElementById("swl_media_player").TCallLabel("/", "loadsong");
} else {
if (window.document.swl_media_player != undefined) {
window.document.swl_media_player.SetVariable("swl_artist", artist);
window.document.swl_media_player.SetVariable("swl_html_song", song);
window.document.swl_media_player.SetVariable("swl_song_description", song_description);
window.document.swl_media_player.TCallLabel("/", "loadsong");
} else {
parent.header_content.document.swl_media_player.SetVariable("swl_artist", artist);
parent.header_content.document.swl_media_player.SetVariable("swl_html_song", song);
parent.header_content.document.swl_media_player.SetVariable("swl_song_description", song_description);
parent.header_content.document.swl_media_player.TCallLabel("/", "loadsong");
}
}
/*
if (parent.header_content.document.swl_media_player != undefined) {
parent.header_content.document.swl_media_player.SetVariable("swl_artist", artist);
parent.header_content.document.swl_media_player.SetVariable("swl_html_song", song);
parent.header_content.document.swl_media_player.SetVariable("swl_song_description", song_description);
parent.header_content.document.swl_media_player.TCallLabel("/", "loadsong");
} else {
window.document.swl_media_player.SetVariable("swl_artist", artist);
window.document.swl_media_player.SetVariable("swl_html_song", song);
window.document.swl_media_player.SetVariable("swl_song_description", song_description);
window.document.swl_media_player.TCallLabel("/", "loadsong");
}
}
*/
}
function StartSong() {
if (isIE) {
document.getElementById("swl_media_player").SetVariable("playing_selected_song", true);
document.getElementById("swl_media_player").TCallLabel("/", "playsong");
} else {
window.document.swl_media_player.SetVariable("playing_selected_song", true);
window.document.swl_media_player.TCallLabel("/", "playsong");
}
}
// -->
|