
function PlayerOpen(soundfiledesc,imagepath,soundfilepath) {
    var UniqueID = 314; // Make each link open in a new window 
    var newWinOffset = 0; // Position of first pop-up
    
    PlayWin = window.open('',UniqueID,'width=300,height=400,top=0,left=50,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
    PlayWin.focus(); 
    soundfiledesc = soundfiledesc.replace(/'/gi, "&#39;");
    if (imagepath == '') {imagepath = 'NoImage.jpg'}
    imagepath = "audio\/" + imagepath;
    
    var obj = "<HTML><HEAD><TITLE>" + soundfiledesc + "</TITLE>"; 
    obj += "<link rel='stylesheet' type='text/css' href='player.css' /></HEAD><BODY>";
    obj += "<div id='player'>";
    obj += "<br/><h1>" + soundfiledesc + "</h1>";
    obj += "<img width='300' src='" + imagepath + "'/>";
    obj += "<object width='280' height='42' codebase='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'>"; 
    obj += "<param name='src' value='" + soundfilepath + "'>";
    obj += "<param name='autoplay' value='true'>"; 
    obj += "<param name='controller' value='true'>";
    obj += "<param name='bgcolor' VALUE='#5f8a96'>"; 
    obj += "<embed src='" + soundfilepath + "' autostart='true' loop='false' width='280' height='42' controller='true' bgcolor='#5f8a96' type='audio/mpeg' pluginspage='http://www.apple.com/quicktime/download/'/>";
    obj += "</object>";
    obj += "<p>Can't play this file? <a href='" + soundfilepath +"'>Click here to download.</a><p>"; 
    obj += "</div>"; 
    obj += "<script type='text/javascript' src='/includes/loadControl.js'></script>"; 
    obj += "</BODY></HTML>"; 

    PlayWin.document.write(obj); 
    PlayWin.document.close(); // "Finalizes" new window 
    UniqueID = UniqueID + 1;
} 
