// Defines FileExtension by video format (prepared for use in HTML document)
var VideoFileExtType = new Array();
VideoFileExtType[0] = '_modem.ram';
VideoFileExtType[1] = '_isdn.ram';
VideoFileExtType[2] = '_dsl.ram';
VideoFileExtType[3] = '_modem.asx';
VideoFileExtType[4] = '_isdn.asx';
VideoFileExtType[5] = '_dsl.asx';
VideoFileExtType[6] = '_modem.mov';
VideoFileExtType[7] = '_isdn.mov';
VideoFileExtType[8] = '_dsl.mov';
VideoFileExtType[9] = '_modem.rm';
VideoFileExtType[10] = '_isdn.rm';
VideoFileExtType[11] = '_dsl.rm';
VideoFileExtType[12] = '_modem.wmv';
VideoFileExtType[13] = '_isdn.wmv';
VideoFileExtType[14] = '_dsl.wmv';

// Opens Video Window
// Expects VideoSrc (Path and src name), VideoWidth (just video width), VideoHeight (just video width)...
// ... VideoWinPosX,VideoWinPosY,VideoWinCentered,ShowVideoControls,ShowVideoDisplay,ShowVideoStatusBar
// Example: openVideoWin('videos/cvc.asx',160,115,145,230,false,true,false,true)
function openVideoWin(VideoSrc,VideoWidth,VideoHeight,VideoWinPosX,VideoWinPosY,VideoWinCentered,ShowVideoControls,ShowVideoDisplay,ShowVideoStatusBar)
{
	if (VideoSrc == "")
	{
		alert("Bitte wählen Sie ein Videoformat aus.")
		return;
	}
	ShowVideoControls = (ShowVideoControls == true) ? "1" : "0"
	ShowVideoDisplay = (ShowVideoDisplay == true) ? "1" : "0"
	ShowVideoStatusBar = (ShowVideoStatusBar == true) ? "1" : "0"

	VideoWidth = parseInt(VideoWidth)
	VideoHeight = parseInt(VideoHeight)
	var htmlStr = '<html><head><title>Staatsbad Pyrmont</title><link rel="stylesheet" type="text/css" href="css/style-neuigkeiten.css"><link rel="stylesheet" type="text/css" href="css/style.css"></head><body bgcolor="#BDCFFF" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">'
	htmlStr += '<table border="0" cellpadding="0" cellspacing="0" width="1"><tr><td width="10" height="10"><img src="images/empty.gif" width="10" height="1" alt="" border="0"></td><td></td><td width="10"></td></tr><tr><td></td><td align="center">'
	// Real Videos
	if (VideoSrc.indexOf('.ram') > -1 || VideoSrc.indexOf('.rm') > -1)
	{
		htmlStr += '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="' + VideoWidth + '" height="' + VideoHeight + '">'
		htmlStr += '<param name="controls" value="ImageWindow">'
		htmlStr += '<param name="console" value="_master">'
		htmlStr += '<param name="autostart" value="true">'
		htmlStr += '<param name="src" value="' + VideoSrc + '">'
		htmlStr += '<embed src="' + VideoSrc + '" type="audio/x-pn-realaudio-plugin" console="_master" controls="ImageWindow" width="' + VideoWidth + '" height="' + VideoHeight + '" autostart="true"></embed>'
		htmlStr += '</object>'
		if (ShowVideoControls == "1")
		{
			htmlStr += '</td>'
			htmlStr += '</tr>'
			htmlStr += '<tr>'
			htmlStr += '<td></td><td>'
			htmlStr += '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="' + VideoWidth + '" height="18">'
			htmlStr += '<param name="controls" value="ControlPanel">'
			htmlStr += '<param name="console" value="_master">'
			htmlStr += '<embed type="audio/x-pn-realaudio-plugin" console="_master" controls="ControlPanel" width="' + VideoWidth + '" height="18"></embed>'
			htmlStr += '</object>'
			VideoHeight += 18
		}
	}
	// Windows Media Videos
	else if (VideoSrc.indexOf('.wmv') > -1 || VideoSrc.indexOf('.asx') > -1 || VideoSrc.indexOf('.asf') > -1)
	{
		if (ShowVideoControls == true) VideoHeight += 50
		if (ShowVideoDisplay == true) VideoHeight += 75
		if (ShowVideoStatusBar == true) VideoHeight += 25
		htmlStr += '<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width="' + VideoWidth + '" height="' + VideoHeight + '">'
		htmlStr += '<param name="fileName" value="' + VideoSrc + '">'
		htmlStr += '<param name="ShowControls" VALUE="' + ShowVideoControls + '">'
		htmlStr += '<param name="ShowDisplay" VALUE="' + ShowVideoDisplay + '">'
		htmlStr += '<param name="ShowStatusBar" VALUE="' + ShowVideoStatusBar + '">'
		htmlStr += '<embed type="application/x-mplayer2" src="' + VideoSrc + '" width="' + VideoWidth + '" height="' + VideoHeight + '" ShowControls="' + ShowVideoControls + '" ShowDisplay="' + ShowVideoDisplay + '" ShowStatusBar="' + ShowVideoStatusBar + '"></embed>'
		htmlStr += '</object>'
	}
	// Quicktime Movies
	else if (VideoSrc.indexOf('.mov') > -1)
	{
		if (ShowVideoControls == true) VideoHeight += 40
		htmlStr += '<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="' + VideoWidth + '" HEIGHT="' + VideoHeight + '" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">'
		htmlStr += '<PARAM NAME="src" VALUE="' + VideoSrc + '">'
		htmlStr += '<PARAM NAME="controller" VALUE="' + ShowVideoControls + '">'
		htmlStr += '<PARAM NAME="target" VALUE="myself">'
		htmlStr += '<PARAM NAME="href" VALUE="' + VideoSrc + '">'
		htmlStr += '<PARAM NAME="pluginspage" VALUE="http://www.apple.com/quicktime/download/indext.html">'
		htmlStr += '<EMBED WIDTH="' + VideoWidth + '" HEIGHT="' + VideoHeight + '" CONTROLLER="' + ShowVideoControls + '" TARGET="myself" HREF="' + VideoSrc + '" SRC="' + VideoSrc + '" BGCOLOR="FFFFFF" BORDER="0" PLUGINSPAGE="http://www.apple.com/quicktime/download/indext.html"></EMBED>'
		htmlStr += '</OBJECT>'
	}
	htmlStr += '</td></tr><tr><td></td><td align="right" valign="bottom" height="15"><a href="javascript:self.close();" class="text">[Fenster schliessen]</a></td></tr><tr><td height="10"></td></tr></table></body></html>'
	var VideoWinWidth = VideoWidth + 20;
	// if (is.ns6) VideoWinWidth += 5;
	var VideoWinHeight = VideoHeight + 30;
	// if (is.ns6) VideoWinHeight += 5;

	if (VideoWinCentered == true)
	{
		VideoWinPosX = (screen.width - VideoWinWidth) / 2
		VideoWinPosY = (screen.height - VideoWinHeight) / 2
	}

	var VideoWin = window.open('','VideoWin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=' + VideoWinPosX + ',top=' + VideoWinPosY + ',width=' + VideoWinWidth + ',height='+ VideoWinHeight);
	with (VideoWin.document)
	{
		open();
		write(htmlStr);
		close();
	}
	VideoWin.focus();
}
