// JavaScript Document
function popup(v)
{
	window.open(v, '',
'width=476,height=660,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no');
}

function openDemoQT()
{
	window.open('/mod/show_demo_mov.html', '',
'width=378,height=330,menubar=no,location=no,resizable=yes,scrollbars=no,status=no');
}

function openDemoWM()
{
	window.open('/mod/show_demo_wmv.html', '',
'width=378,height=330,menubar=no,location=no,resizable=yes,scrollbars=no,status=no');
}

function openDemo()
{
	// navigator object functions don't work with MSIE except on
	// Internet Explorer 5.0 Macintosh Edition (maybe later versions)
	var	bMSIE     = (navigator.appName.indexOf("Internet Explorer") >= 0);
	var	iVersion  = -1;
	var	sPlatform = navigator.platform;
	var	bIsMacOS  = (sPlatform.indexOf("Mac")   >= 0);
	var	bIsWin32  = (sPlatform.indexOf("Win32") >= 0);
	var	bIsWin64  = (sPlatform.indexOf("Win64") >= 0);
	var	bChkPlgin = false;
	// generally prefer using Apple Quick Time to open the video
	var	bUseAppQT = false;
	var	bUseAppWM = false;

	if (bMSIE)
	{
		// MSIE has more than one version information in this string:
		var	iPos = navigator.appVersion.indexOf("MSIE ");

		if (iPos >= 0)
		{
			iVersion  = parseInt(navigator.appVersion.substr(iPos + 5, 1));
			bChkPlgin = (iVersion >= 5 && bIsMacOS);
		}

		bUseAppWM = (iPos < 0 || !bChkPlgin);
	}
	else
	{
		// direct version access is correct for Netscape and maybe other non-MSIE's
		iVersion  = parseInt(navigator.appVersion.substring(0, 1));
		bChkPlgin = true;
	}

	if (bChkPlgin)
	{
		var	iCntPlg = navigator.mimeTypes.length;

		for (var i = 0; i < iCntPlg; i++)
		{
			if ( navigator.mimeTypes[i].enabledPlugin != null	&&
				(navigator.mimeTypes[i].description.indexOf("QuickTime video") >= 0	||
				 navigator.mimeTypes[i].description.indexOf("QuickTime Film")  >= 0))
			{
				bUseAppQT = true;
				break;
			}
			else if (navigator.mimeTypes[i].enabledPlugin != null	&&
					 navigator.mimeTypes[i].description.indexOf("Windows Media video") >= 0)
			{
				bUseAppWM = true;
				break;
			}
		}
	}

	if (!bUseAppQT && !bUseAppWM)
	{
		alert('Ihr Browser kann das Video nur mit einem zus&auml;tzlichen\n'   +
			  'Plugin wiedergeben! Bitte klicken Sie auf einen der\n'     +
			  'Links bei dem das Abspielformat explizit angegeben wird\n' +
			  'und folgen Sie der Anweisung des Browsers (z.B. in der\n'  +
			  'Titelleiste des neu ge&ouml;ffneten Fensters) um das\n'         +
			  'erforderliche Plugin herunterzuladen und zu\n'             +
			  'installieren.');
	}
	else if (bUseAppQT)
	{
		openDemoQT();
	}
	else
	{
		openDemoWM();
	}
//	alert('Browser = ' + navigator.appName + ', Plattform = ' + sPlatform +
//		  ',\nBrowser-Version = ' + iVersion + ', Plugin-Check: ' +
//		  (bChkPlgin ? 'true' : 'false'));
}

// the next two functions are to manage the portrait gallery

function showFullImg(imgPath)
{
	img_tag = document.images['stage_img'];
	img_tag.src = imgPath;
	div_tag = document.getElementById('big_img');
	div_tag.style.visibility = 'visible';
}

function hideImage()
{
	div_tag = document.getElementById('big_img');
	div_tag.style.visibility = 'hidden';
	div_tag.style.height = 1;
	div_tag.style.width  = 1;
}

