// JavaScript Document
// Pop-Up Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com
var UniqueID = 314 // Make each link open in a new window.
var newWinOffset = 100 // Position of first pop-up
function PlayerOpen(soundfiledesc,soundfilepath) {

PlayWin = window.open('',UniqueID,'width=330,height=190,top=' + newWinOffset +',left=100,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
PlayWin.focus(); 
var winContent = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
winContent += "<html xmlns='http://www.w3.org/1999/xhtml'><head><title>" + soundfiledesc + "</title><link rel='StyleSheet' href='../Stylesheet.css' media='screen' type='text/css' /></head><body>";
winContent += "<div id='PageContent' style='width:300px; padding:10px 10px;'>";
winContent += "<h2>" + soundfiledesc + "</h2>";

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='#FFFFFF'>";
winContent += "<EMBED SRC='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#FFFFFF'></EMBED>";
winContent += "</OBJECT>";

winContent += "<p style='text-align:center'><a href='"+soundfilepath+"'>Download this file</a> (right-click or Option-click)</p>";

winContent += "<form><p align='center'><input type='button' value='Close this window' onClick='javascript:window.close();' /></p></form>";
winContent += "</div></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.
}