function AudioPopUp(sermonName,sermonFile,WindowNumber)
{

    var isWindows = navigator.userAgent.toLowerCase().indexOf("windows") != -1

    // Get the MIME Type
    var mimeType = "audio/mpeg"; 
    var objTypeTag = "application/x-mplayer2"; //firfox

    var fileType = sermonFile.substr(sermonFile.lastIndexOf('.')+1, 3); //File Type?
    if (fileType.toLowerCase() == "wav") {
        mimeType = "audio/x-wav";
        };
    if (fileType.toLowerCase() == "wma") {
        mimeType = "audio/x-ms-wma";
        };
//    if (isWindows) {
    objTypeTag = mimeType; 
//    };

    PopupWindow = window.open('',WindowNumber,'width=320,height=210,top=0,left=0,screenX=0,screenY=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0');
    PopupWindow.focus();
    PopupWindow.document.writeln("<html><head><title>" + sermonName + "</title></head>");
    PopupWindow.document.writeln("<body style='{background-color: #ADBC8B;}'>");
    PopupWindow.document.writeln("<div align='center'>");
    PopupWindow.document.writeln("<p style ='{font-family: arial;}'><strong>" + sermonName + "</strong></p>");
    PopupWindow.document.writeln("<object width='300' height='70'>");
    PopupWindow.document.writeln("<param name='src' value='" +  sermonFile + "'>");
    PopupWindow.document.writeln("<param name='type' value='" + objTypeTag + "'>");
    PopupWindow.document.writeln("<param name='autostart' value='1'>");
    PopupWindow.document.writeln("<param name='showcontrols' value='1'>");
    PopupWindow.document.writeln("<param name='showstatusbar' value='1'>");
    PopupWindow.document.writeln("<embed src ='" + sermonFile + "' type='" + objTypeTag + "' autoplay='true' width='300' height='70' controller='1' showstatusbar='1' bgcolor='#444444' kioskmode='true'>");   PopupWindow.document.writeln("</embed></object></div>");
    PopupWindow.document.writeln("<form><div align='center'><input type='button' value='Close' onclick='javascript:window.close();'></div></form>");
    PopupWindow.document.writeln("</body></html>");
    PopupWindow.document.close();
}

