var VidUniqueID = 522 // Make each link open in a new window 
var newVidWinOffset = 10 // Position of first pop-up

function VideoPlayerOpen(soundfiledesc,soundfilepath) { 
PlayWin = window.open(soundfiledesc,VidUniqueID,'width=400,height=400,top=' + newVidWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=1,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
PlayWin.focus(); 

alert(soundfilepath);
var winContent = "<HTML><HEAD><TITLE>" + soundfiledesc + "</TITLE>";



winContent += "</HEAD><BODY bgcolor='#FF9900'>"; 
winContent += "<B style='font-size:18px;font-family:Verdana,sans-serif;line-height:1.5'>" + soundfiledesc + "</B>";

winContent +='<object id="MediaPlayer1" width="310" height="278" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> <param name="FileName" value=' + soundfilepath + '> <param name="animationatStart" value="false"> <param name="transparentatStart" value="true"> <param name="autoStart" value="true"> <param name="showControls" value="true"> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" Name="MediaPlayer" src=' + soundfilepath + 'AutoStart="true"  ShowStatusBar="0" volume="-1" HEIGHT="278" WIDTH="310"></embed></object><br>'; 




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 
VidUniqueID = VidUniqueID + 1;
newVidWinOffset = newVidWinOffset + 20 // subsequent pop-ups will be this many pixels lower 
} 
