// JavaScript Document
// Pop-Up Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com
var UniqueID = 100 // Make each link open in a new window.
var newWinOffset = 0 // Position of first pop-up
function PlayerOpen(soundfiledesc,soundfilepath) {
  var width=450;
  var height=170;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2; }
PlayWin = window.open('',UniqueID,'width=' + width + ',height=' + height + ',top=' + yc +',left=' + xc + ',screenY=' + yc +',screenX=' + xc + ',resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
PlayWin.focus(); 
var winContent = "<html><head><title>" + soundfiledesc + "</title></head><body style='padding:0 0 0 0;margin:0 0 0 0;' bgcolor='#b5ccec'>";
winContent += "<table cellspacing='0' cellpadding='0'><tr valign='center'><td><img class='nobord' src='public/images/susanpic1.gif' width='139' height='170'></td><td>"
winContent += "<div style='font-size:18px;font-family:Verdana,sans-serif,arial;'><br />" + soundfiledesc + "<br /><br /></div>";

winContent += "<object width='300' height='42'>";
winContent += "<param name='SRC' value='" +  soundfilepath + "'>";
winContent += "<param name='AUTOPLAY' VALUE='true'>";
winContent += "<param name='CONTROLLER' VALUE='true'>";
winContent += "<param name='BGCOLOR' VALUE='#FF9900'>";
winContent += "<embed src='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#FF9900'></embed>";
winContent += "</object>";
winContent += "<form><div align='center'><input type='button' value='Close this window' onClick='javascript:window.close();'></div></form>";
winContent += "</td></tr></table></body></html>";
PlayWin.document.write(winContent);
PlayWin.document.close(); // "Finalizes" new window
UniqueID = UniqueID + 1
// newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower.
}