var currentPopUp; function popUpPlayer(isJukeBox) { var urlParam = ""; var popUpName = "Alligator Mini Player"; var wAndH = "width=395,height=120"; if (isJukeBox) { urlParam = "&jukebox=yes"; popUpName = "Alligator Jukebox"; wAndH = "width=395,height=502"; } currentPopUp = window.open("/miniplayer/index.cfm?inAPopUp=yes"+urlParam, popUpName, wAndH+",left=0,top=0,scrollbars=0,resizable=1,fullscreen=No,toolbar=no,location=no,status=no,menubar=no"); } function getPopUp(isJukeBox) { var popUpName = "Alligator Mini Player"; if (isJukeBox) popUpName = "Alligator Jukebox"; return window.open('',popUpName); } function playerExistsOnPageAndNotPopped() { if ($( ".jp-jplayer" ).length>0) { if (isPoppedOut) { return false; } else { return true; } } return false } function addSongToPlayer(id,isJukeBox) { if (playerExistsOnPageAndNotPopped()) { addTrackByID(id); } else { var pop = getPopUp(isJukeBox); if (pop.location=="about:blank") { pop.close(); } else { pop.addTrackByID(id); } } } function addPlaylistToPlayer(isJukeBox) { if (playerExistsOnPageAndNotPopped()) { addPlaylist(); } else { getPopUp(isJukeBox).addPlaylist(); } } function playPlayer(isJukeBox) { if (playerExistsOnPageAndNotPopped()) { myPlaylist.play(); } else { try{ currentPopUp.myPlaylist.play(); } catch (e) { } } } function pausePlayer(isJukeBox) { if (playerExistsOnPageAndNotPopped()) { myPlaylist.pause(); } else { try{ currentPopUp.myPlaylist.pause(); } catch (e) { } } }