//
// --- open een menu-bestand met de opties (form)
//
function getStream (nr, speed) {
	var newWin = window.open ('streamingMedia.php?nr=' + nr + '&speed=' + speed + '', 'selectStream', 'width=320px, height=240px, menubar=no, personalbar=no, scrollbars=no, statusbar=no, resizable=no');
	if (!newWin) {
		alert("filmples worden geladen in een pop-up, blijkbaar zijn pop-ups niet toegestaan in uw browser");
	}
	newWin.focus();
	//alert ("uitzendingen zijn even niet beschikbaar, excuses voor het ongemak.");
}

//
// --- begin EMBED_MEDIA
//
function popupStreamingMedia ($TYPE, $URL, $W, $H)
	{
	$W = (!$W) ? 320 : $W;
	$H = (!$H) ? 240 : $H;
	var newWin = window.open ('', 'goStream', 'width='+$W+'px, height='+($H+36)+'px, menubar=no, personalbar=no, scrollbars=no, statusbar=no, resizable=no');
	newWin.document.open ();
	newWin.document.write (" <html>"
		+ "\n <head>"
		+ "\n\t <title>even geduld aub<\/title>"
		+ "\n <\/head>\n"
		+ "\n <body bgcolor='#EFEFEF' width='100\%' height='100\%' topmargin='0' leftmargin='0' rightmargin='0' marginwidth='0' marginheight='0'>\n" 
		+ embed_media($TYPE, $URL, $W, $H)
		+ "\n <\/body>"
		+ "\n <\/html>"
		+ "\n");
	newWin.document.close ();
	newWin.focus();
}

function embed_media ($TYPE, $URL, $W, $H)
	{
	if (!$TYPE || !$URL) 
		{
		return ("insufficient arguments in 'embed_media()':"
			+ "\n<br \/>$TYPE = "+ $TYPE
			+ "\n<br \/>$URL = "+ $URL
			+ "\n");
		} 
	else if ($TYPE.toLowerCase() == 'asf') 
		{
	// -- Windows media player
	// .asf
		return ("\n" 
			//+ "\n<table valign='top' width='100\%' height='100\%' border='0' cellspacing='0' cellpadding='0'>"
			//+ "\n\t <tr>"
			//+ "\n\t\t <td>"
			+ "\n\t\t\t <EMBED TYPE='video/x-ms-asf-plugin' " 
			+ "\n\t\t\t\t SRC='" + $URL + "' "
			+ "\n\t\t\t\t NAME='MediaPlayer' "
			+ "\n\t\t\t\t WIDTH=" + $W + " "
			+ "\n\t\t\t\t HEIGHT=" + ($H+36) + " \/>"
			+ "\n\t\t\t <\/EMBED \/>"
			//+ "\n\t\t<\/td>"
			//+ "\n\t<\/tr>"
			//+ "\n<\/table>"
			+ "\n");
		//
		//	+ "\n <OBJECT ID='MediaPlayer' "
		//	+ "\n\t CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' "
		//	+ "\n\t CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112' "
		//	+ "\n\t STANDBY='Windows Media Player componenten worden geladen ...' "
		//	+ "\n\t TYPE='application/x-oleobject' "
		//	+ "\n\t WIDTH=" + $W + " "
		//	+ "\n\t HEIGHT=" + $H + " \/>"
		//	+ "\n\t <PARAM name='autoStart' value='true' \/>"
		//	+ "\n\t <PARAM name='filename' value='" + $URL + "' \/>"
		//	+ "\n <\/OBJECT \/>");
		} 
	else if ($TYPE.toLowerCase() == 'rm') 
		{
		//
		// -- Real Player
		// .rm
		return ("\n" 
			+ "\n<table width='100\%' height='100\%' border='0' cellspacing='0' cellpadding='0'>"
			+ "\n\t <tr>"
			+ "\n\t\t <td valign='top'>"
			+ "\n\t\t\t <EMBED TYPE='audio/x-pn-realaudio-plugin' "
			+ "\n\t\t\t\t SRC='" + $URL + "' "
			+ "\n\t\t\t\t WIDTH=" + $W + " "
			+ "\n\t\t\t\t HEIGHT=" + ($H) + " "
			+ "\n\t\t\t\t AUTOSTART='true' "
			+ "\n\t\t\t\t CONTROLS='ImageWindow' "
			+ "\n\t\t\t\t CONSOLE='one' "
			//+ "\n\t\t\t\t NOLOGO='true' "
			+ "\n\t\t\t\t NOJAVA='true' "
			+ "\n\t\t\t\t NOLABELS='true' \/>"
			+ "\n\t\t\t <\/EMBED \/>"
			//+ "\n\t\t <\/td>"
			//+ "\n\t <\/tr>"
			//+ "\n\t <tr>"
			//+ "\n\t\t <td height='25' bgcolor='#CCCCCC'>"
			+ "\n\t\t\t <EMBED TYPE='audio/x-pn-realaudio-plugin' "
			+ "\n\t\t\t\t NAME='controlPanelInstance' "
			+ "\n\t\t\t\t CONSOLE='one' "
			+ "\n\t\t\t\t CONTROLS='ControlPanel' "
			+ "\n\t\t\t\t WIDTH=" + $W + " "
			+ "\n\t\t\t\t HEIGHT=25 "
			+ "\n\t\t\t <\/EMBED \/>"
			+ "\n\t\t <\/td>"
			+ "\n\t <\/tr>"
			+ "\n <\/table>"
			+ "\n");
		//
		//	+ "\n <OBJECT ID='RVOCX' "
		//	+ "\n\t CLASSID='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' "
		//	+ "\n\t WIDTH=" + $W + " "
		//	+ "\n\t HEIGHT=" + $H + " \/>"
		//	+ "\n\t <PARAM name='src' value='" + $URL + "' \/>"
		//	+ "\n\t <PARAM name='autostart' value='true' />"
		//	+ "\n\t <PARAM name='controls' value='imagewindow' \/>"
		//	+ "\n\t <PARAM name='console' value='video' \/>"
		//	+ "\n <\/OBJECT \/>");
		} 
	else if ($TYPE.toLowerCase() == 'qt') 
		{
		// -- Quicktime
		// .qt
		// mime-type: video/quicktime ...?
		return ("\n"
			+ "\n<table valign='top' width='100\%' height='100\%' border='0' cellspacing='0' cellpadding='0'>"
			+ "\n\t <tr>"
			+ "\n\t\t <td>"
			+ "\n\t\t\t <embed type='video/quicktime' "
			+ "\n\t\t\t\t src='" + $URL + "' "
			+ "\n\t\t\t\t width=" + $W + " "
			+ "\n\t\t\t\t height=" + ($H + 36) + " \/>"
			+ "\n\t\t\t <\/embed \/>"
			+ "\n\t\t <\/td>"
			+ "\n\t <\/tr>"
			+ "\n <\/table>"
			+ "\n");
		}
	}
//
// ---- eind EMBED_MEDIA
//
