// The key in this array of literals is the content type of the file.
var PlayerUrls = {
	// Video:
	"video/x-ms-wmv"  : "MoviePlayer.aspx",
	"video/quicktime" : "MoviePlayer.aspx",
	
	// Audio:
	"audio/x-mpeg-3" : "AudioPlayer.aspx",
	"audio/mpeg"     : "AudioPlayer.aspx",
	"audio/mpeg3"    : "AudioPlayer.aspx",
	"audio/wav"      : "AudioPlayer.aspx",
	
	// Application, such as Flash
	"application/x-shockwave-flash" : "FlashPlayer.aspx"
};

// The beginning part of the player's URL, including the trailing slash (/). 
// For example: http://domainname.com/
var __playerPathPrefix = "./";

function GetPlayerUrl( contentType )
{
	return PlayerUrls[ contentType ];
}

function OpenMultimediaPopup( id, fname, mimeType, contentType )
{
	var playerUrl = GetPlayerUrl( contentType );

	if( null != playerUrl )
	{	
		var newUrl = __playerPathPrefix + playerUrl 
			+ "?id=" + escape( id ) 
			+ "&fn=" + escape( fname )
			+ "&ct=" + escape( contentType );
		
		popupAd( newUrl , mimeType + "Window", 370, 400 );

		if( adWindow && adWindow.open && !window.closed )
		{
			adWindow.focus();
		}
	}

	// Always return false so the browser doesn't use the URL in
	// the HREF attribute of the <A> tag.
	return false;
}
