// JavaScript Document
var windowName = "soundpop" // Make each link open in a new window 
var newWinOffset = 0 // Position of first pop-up

function PlayerOpen(soundfiledesc,soundfilepath,showdownloadlink) { 
	PlayWin = window.open('',windowName,'width=440,height=170,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
	PlayWin.focus(); 
	
	var winContent = "<html xmlns='http://www.w3.org/1999/xhtml'>" +
		"<head>" +
			"<title>" + soundfiledesc + "</title>" +
			"<style type='text/css'>" +
				"body {font-family:Verdana,sans-seif;}" +
			"</style>" +
		"</head>" +
		"<body bgcolor='#CCCCCC'>" +
			"<div style='width:100%;' align='center'>" +
				"<div style='font-size:14px; font-weight:bold; padding:4px;'>" + soundfiledesc + "</div>" +
				"<object width='300' height='42'>" +
					"<param name='SRC' value='" + soundfilepath +"' />" +
					"<param name='AUTOPLAY' value='true' />" +
					"<param name='CONTROLLER' value='true' />" +
					"<param name='BGCOLOR' value='#FF9900' />" +
					"<embed src='" + soundfilepath + "' autostart='true' loop='false' width='300' height='42' " +
						"controller='true' bgcolor='#FF9900'></embed>" +
				"</object>";
	
	if (showdownloadlink == true)
	{
		winContent += "<p style='font-size:12px;'>" +
						"<a href='" + soundfilepath +"'>Download this file</a> <span style='font-size:10px;'>(right-click)</span>" +
					"</p>";
	}
	winContent += "<div style='font-size:11px;'>" +
					"[<a href='#' onclick='javascript:window.close();' style='cursor:pointer;'>close window</a>]" +
				"</div>" +
			"</div>" +
		"</body>" +
	"</html>";
	
	PlayWin.document.write(winContent); 
	PlayWin.document.close(); // "Finalizes" new window 
} 