/*
 *  trackPlay.js - javascript routines common to both
 *  the jukebox.php and playlists.php pages
 *
 *  $Revision: 1.12 $
 *  $Date: 2008/10/10 08:27:34 $
 *
 *  copyright 2007 Jim E. Sontag
 *
 ****************************************************************/

var msExploder = navigator.appName.match( /Microsoft/ ) ? true : false;
 
var tplayer                  // global var - track player window
function playTrack( code )   // plays a single track
{
  var exp, track, str, param
  exp = /T/
  track = code.replace( exp, '' )
  str = 'trackPlay.php?trk='+track
//  str = 'trackPlay2.php?trk='+track

  if( msExploder) {
    param = 'HEIGHT=270,WIDTH=400,LEFT=300,TOP=400'
  }
  else {
    param = 'HEIGHT=190,WIDTH=400,screenX=300,screenY=400,scrollbars,resizable'
  }
  
  tplayer = window.open( str, 'tplay', param )
  
  if( !tplayer )
    alert( "Sorry, your browser has blocked our pop-up window." )
  
  if( document.getElementById('search') )
    document.getElementById('search').focus() 
    
  if( tplayer && tplayer.focus )
    tplayer.focus()
}

