// JS

var UniqueID = 314 // Make each link open in a new window
var newWinOffset = 0 // Position of first pop-up

function AudioPlayer(soundfiletitle,soundfiledesc,performer,soundfilepath)
{
	PlayerOpen(soundfiletitle,soundfiledesc,performer,soundfilepath,420,130+80,380,16);
}

function VideoPlayer(soundfiletitle,soundfiledesc,performer,soundfilepath)
{
	PlayerOpen(soundfiletitle,soundfiledesc,performer,soundfilepath,320+20+10,120+240+80,320,240+16);
}

function PlayerOpen(soundfiletitle,soundfiledesc,performer,soundfilepath,window_width,window_height,player_width,player_height)
{
	PlayWin = window.open('',UniqueID,'width=' + window_width + ',height=' + window_height + ',top=' + newWinOffset +',left=0,resizable=1,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
	PlayWin.resizeTo(window_width,window_height);
	PlayWin.focus();
	
	var winContent = "<html><head><title>" + soundfiletitle + "</title><link href=\"audiopopstyle.css\" rel=\"stylesheet\" type=\"text/css\"></head><body bgcolor='#CCCCCC'>";

	winContent += "<p><b><em>" + soundfiletitle + "</em></b><br>" + soundfiledesc + "</p>";
	winContent += "<p>" + performer + "</p>";
	
	winContent += "<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" height=\"" + player_height + "\" width=\"" + player_width +"\">";
	winContent += "<param name=\"src\" value=\"" + soundfilepath + "\">";
	winContent += "<param name=\"autoplay\" value=\"true\">";
	winContent += "<param name=\"controller\" value=\"true\">";
	winContent += "<param name=\"kioskmode\" value=\"true\">";
	winContent += "<embed src=\"" + soundfilepath + "\" pluginspage=\"http://www.apple.com/quicktime/download/\" type=\"video/quicktime\" controller=\"true\" autoplay=\"true\" kioskmode=\"true\" height=\"" + player_height + "\" width=\"" + player_width + "\"></object>";
	
	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
}
