// 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 = 0 // Position of first pop-up
function PlayerOpen(soundfiledesc,soundfilepath) {

PlayWin = window.open('',UniqueID,'width=400,height=260,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><HEAD><TITLE>" + soundfiledesc + "</TITLE></HEAD><BODY background='../images/pagebackground.gif'>";
winContent += "<B style='font-size:18px;font-family:Verdana,sans-serif;text-align:center;line-height:1.5'>" + soundfiledesc + "</B><P>&nbsp;";

winContent += "<OBJECT width='350' height='60'";
winContent += "CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'";
winContent += "standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>";
winContent += "<PARAM NAME='url' VALUE='" + soundfilepath + "'>";
winContent += "<PARAM NAME='SendPlayStateChangeEvents' VALUE='True'>";
winContent += "<PARAM NAME='AutoStart' VALUE='True'>";
winContent += "<PARAM name='uiMode' value='full'>";
winContent += "<embed type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'";
winContent += "showcontrols='true' showstatusbar='true' uimode='full' width='350' height='60'";
winContent += "src='" + soundfilepath + "' autostart='true' loop='false'>";
winContent += "</OBJECT>";

winContent += "<p style='font-size:12px;font-family:Verdana,sans-serif;text-align:center'><a href='"+soundfilepath+"'>Download the mp3 sermon file</a> </p>";

winContent += "<FORM><DIV align='center'><INPUT type='button' value='Close this window' onClick='javascript:window.close();'></DIV></FORM>";
winContent += "</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.
}