// You may incorporate this Apple sample code into your own code// without restriction. This Apple sample code has been provided "AS IS"// and the responsibility for its operation is yours. You may redistribute// this code, but you are not permitted to redistribute it as// "Apple sample code" after having made changes.// initialize global variablesvar detectableWithVB = false;var pluginFound = false;var os = "unknown";function goURL(daURL) {    // if the browser can do it, use replace to preserve back button    if(javascriptVersion1_1) {	window.location.replace(daURL);    } else {	window.location = daURL;    }    return;}function redirectCheck(pluginFound, redirectURL, redirectIfFound) {    // check for redirection    if( redirectURL && ((pluginFound && redirectIfFound) || 	(!pluginFound && !redirectIfFound)) ) {	// go away	goURL(redirectURL);	return pluginFound;    } else {	// stay here and return result of plugin detection	return pluginFound;    }	}function canDetectPlugins() {    if( detectableWithVB || (navigator.plugins && navigator.plugins.length > 0) ) {	return true;    } else {	return false;    }}function detectQuickTime(redirectURL, redirectIfFound) {    pluginFound = detectPlugin('QuickTime');    // if not found, try to detect with VisualBasic    if(!pluginFound && detectableWithVB) {	pluginFound = detectQuickTimeActiveXControl();    }    return redirectCheck(pluginFound, redirectURL, redirectIfFound);}function detectReal(redirectURL, redirectIfFound) {    pluginFound = detectPlugin('RealPlayer');    // if not found, try to detect with VisualBasic    if(!pluginFound && detectableWithVB) {	pluginFound = (detectActiveXControl('rmocx.RealPlayer G2 Control') ||		       detectActiveXControl('RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)') ||		       detectActiveXControl('RealVideo.RealVideo(tm) ActiveX Control (32-bit)'));    }	    return redirectCheck(pluginFound, redirectURL, redirectIfFound);}function detectWindowsMedia(redirectURL, redirectIfFound) {    pluginFound = detectPlugin('Windows Media');    // if not found, try to detect with VisualBasic    if(!pluginFound && detectableWithVB) {	pluginFound = detectActiveXControl('MediaPlayer.MediaPlayer.1');    }    return redirectCheck(pluginFound, redirectURL, redirectIfFound);}function detectPlugin() {    // allow for multiple checks in a single pass    var daPlugins = detectPlugin.arguments;    // consider pluginFound to be false until proven true    var pluginFound = false;    // if plugins array is there and not fake    if (navigator.plugins && navigator.plugins.length > 0) {	var pluginsArrayLength = navigator.plugins.length;	// for each plugin...	for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {	    // loop through all desired names and check each against the current plugin name	    var numFound = 0;	    for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {		// if desired plugin name is found in either plugin name or description		if( (navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) || 		    (navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) {		    // this name was found		    numFound++;		}   	    }	    // now that we have checked all the required names against this one plugin,	    // if the number we found matches the total number provided then we were successful	    if(numFound == daPlugins.length) {		pluginFound = true;		// if we've found the plugin, we can stop looking through at the rest of the plugins		break;	    }	}    }    return pluginFound;} // detectPlugin// Here we write out the VBScript block for MSIE Windowsif ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {    document.writeln('<script language="VBscript">');    document.writeln('\'do a one-time test for a version of VBScript that can handle this code');    document.writeln('detectableWithVB = False');    document.writeln('If ScriptEngineMajorVersion >= 2 then');    document.writeln('  detectableWithVB = True');    document.writeln('End If');    document.writeln('\'this next function will detect most plugins');    document.writeln('Function detectActiveXControl(activeXControlName)');    document.writeln('  on error resume next');    document.writeln('  detectActiveXControl = False');    document.writeln('  If detectableWithVB Then');    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');    document.writeln('  End If');    document.writeln('End Function');    document.writeln('\'and the following function handles QuickTime');    document.writeln('Function detectQuickTimeActiveXControl()');    document.writeln('  on error resume next');    document.writeln('  detectQuickTimeActiveXControl = False');    document.writeln('  If detectableWithVB Then');    document.writeln('    detectQuickTimeActiveXControl = False');    document.writeln('    hasQuickTimeChecker = false');    document.writeln('    Set hasQuickTimeChecker = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1")');    document.writeln('    If IsObject(hasQuickTimeChecker) Then');    document.writeln('      If hasQuickTimeChecker.IsQuickTimeAvailable(0) Then ');    document.writeln('        detectQuickTimeActiveXControl = True');    document.writeln('      End If');    document.writeln('    End If');    document.writeln('  End If');    document.writeln('End Function');    document.writeln('</scr' + 'ipt>');}function checkOS() {	if (navigator.userAgent.indexOf('Win') != -1) 		os="win";		else if (navigator.userAgent.indexOf('Mac') != -1)		os="mac";	return os;}function writeMatrix(matrix, url, lang){	plus = new Array();	plus["de"] = "und";	plus["en"] = "and";	use = new Array();	use["de"] = "Player verwenden";	use["en"] = "Use player";	var selected = "";	if(matrix == "001" || matrix == "010" || matrix == "100") 	{		selected = "checked=\"checked\" ";	} 		var qt = "<div class=\"mediawin\" style=\"width:290px\"><input name=\"vidplayer\" type=\"radio\" style=\"margin-top:8px\" value=\"qt\" id=\"qt\" " + selected + "/> <label for=\"qt\"><img src=\"/assets/img/misc/vid_qt.gif\" alt=\"\" width=\"25\" height=\"25\" border=\"0\" align=\"middle\" " + "/>&nbsp;Apple Quicktime</lab" + "el></di" + "v>";	var real = "<div class=\"mediawin\" style=\"width:290px\"><input name=\"vidplayer\" type=\"radio\" style=\"margin-top:8px\" value=\"real\" id=\"real\" " + selected + "/> <label for=\"real\"><img src=\"/assets/img/misc/vid_real.gif\" alt=\"\" width=\"25\" height=\"22\" border=\"0\" align=\"middle\" " + "/>&nbsp;Real-Media</lab" + "el></di" + "v>";	var wm = "<div class=\"mediawin\" style=\"width:290px\"><input name=\"vidplayer\" type=\"radio\" style=\"margin-top:8px\" value=\"wm\" id=\"wm\" " + selected + "/> <label for=\"wm\"><img src=\"/assets/img/misc/vid_wm.gif\" alt=\"\" width=\"25\" height=\"25\" border=\"0\" align=\"middle\" " + "/>&nbsp;Windows Media</lab" + "el></di" + "v>";	var out = "";	d1 = new Array();	d1["de"] = "<div class=\"mediawin\" style=\"width:320px;\"><span class=\"zwischenueberschrift\">Videowiedergabe</span><br clear=\"none\" " + "/><br clear=\"none\" " + "/><strong>Auf Ihrem System sind mehrere Player installiert, die zum Abspielen von Videosequenzen in Frage kommen.</str" + "ong><br clear=\"none\" " + "/><br clear=\"none\" " + "/>Medien Kunst Netz unterst&uuml;tzt die Streaming-Videoformate ";	d1["en"] = "<div class=\"mediawin\" style=\"width:320px\"><span class=\"zwischenueberschrift\">Video playback</span><br clear=\"none\" " + "/><br clear=\"none\" " + "/><strong>On your system several players are installed, which can be used to play video sequences.</str" + "ong><br clear=\"none\" " + "/><br clear=\"none\" " + "/>Media Art Net supports following streaming formats ";		d2 = new Array();	d2["de"] = ".<br clear=\"none\" " + "/><br clear=\"none\" " + "/><strong>Bitte w&auml;hlen Sie das von Ihnen bevorzugte Format:</str" + "ong></di" + "v><div class=\"col\" style=\"width:290px;padding-bottom:1px;\">";	d2["en"] = ".<br clear=\"none\" " + "/><br clear=\"none\" " + "/><strong>Please select the format you prefer:</str" + "ong></di" + "v><div class=\"col\" style=\"width:290px;padding-bottom:1px;\">";	d3 = new Array();	d3["de"] = "<div class=\"mediawin\" style=\"width:320px;\"><span class=\"zwischenueberschrift\">Videowiedergabe</span><br clear=\"none\" " + "/><br clear=\"none\" " + "/><strong>Auf Ihrem System wurde ein Player gefunden, der zum Abspielen von Videosequenzen in Frage kommt.</str" + "ong><br clear=\"none\" " + "/><br clear=\"none\" " + "/> ";	d3["en"] = "<div class=\"mediawin\" style=\"width:320px\"><span class=\"zwischenueberschrift\">Video playback</span><br clear=\"none\" " + "/><br clear=\"none\" " + "/><strong>On your system one player could be located, which can be used to play video sequences.</str" + "ong><br clear=\"none\" " + "/><br clear=\"none\" " + "/> ";	d4 = "</di" + "v><div class=\"col\" style=\"width:290px;padding-bottom:1px;\">";	switch(matrix) 	{	case "000":		// Kein Player installiert. Downloadseite anzeigen		noplayer = new Array();		noplayer["de"] = "<div id=\"image\" class=\"video\" style=\"width:480px\"><div class=\"mediawin\" style=\"width:320px;\"><span class=\"zwischenueberschrift\">Videowiedergabe</span><br clear=\"none\" " + "/><br clear=\"none\" " + "/><strong>Auf Ihrem System konnte kein geeigneter Player zur Wiedergabe der Videosequenzen gefunden werden.</str" + "ong><br clear=\"none\" " + "/><br clear=\"none\" " + "/>Medien Kunst Netz unterst&uuml;tzt die Streaming-Videoformate <strong>Quicktime</str" + "ong>, <strong>Real-Media</str" + "ong> und <strong>Windows-Media</str" + "ong>. Wenn Sie die Videosequenzen sehen möchten, installieren Sie bitte einen der kostenlosen Player. Zur Installation folgen Sie bitten den Hinweisen des Herstellers.</di" + "v><div class=\"mediawin\" style=\"width:320px\"><img src=\"/assets/img/misc/vid_qt.gif\" alt=\"\" width=\"25\" height=\"25\" border=\"0\" align=\"middle\" " + "/>&nbsp;&nbsp;<a href=\"javascript:openMknWin('http://www.apple.com/quicktime/download/',3)\">[ Download Quicktime Player ]</" + "a></di" + "v><div class=\"mediawin\" style=\"width:320px\"><img src=\"/assets/img/misc/vid_real.gif\" alt=\"\" width=\"25\" height=\"22\" border=\"0\" align=\"middle\" " + "/>&nbsp;&nbsp;<a href=\"javascript:openMknWin('http://www.real.com',3)\">[ Download Real Player ]</" + "a></di" + "v><div class=\"mediawin\" style=\"width:320px\"><img src=\"/assets/img/misc/vid_wm.gif\" alt=\"\" width=\"25\" height=\"25\" border=\"0\" align=\"middle\" " + "/>&nbsp;&nbsp;<a href=\"javascript:openMknWin('http://www.microsoft.com/windows/windowsmedia/download/default.asp?DispLang=de',3)\">[ Download Windows Media Player ]</" + "a></di" + "v></di" + "v>";		noplayer["en"] = "<div id=\"image\" class=\"video\" style=\"width:480px\"><div class=\"mediawin\" style=\"width:320px;\"><span class=\"zwischenueberschrift\">Video playback</span><br clear=\"none\" " + "/><br clear=\"none\" " + "/><strong>Your computer doesn't support the necessary video format for playback.</str" + "ong><br clear=\"none\" " + "/><br clear=\"none\" " + "/>Media Art Net operates with the following streaming formats: <strong>Quicktime</str" + "ong>, <strong>Real-Media</str" + "ong> und <strong>Windows-Media</str" + "ong>. Please download one of the free players. For installation please follow the instructions that accompanies the download option on the respective website.</di" + "v><div class=\"mediawin\" style=\"width:320px\"><img src=\"/assets/img/misc/vid_qt.gif\" alt=\"\" width=\"25\" height=\"25\" border=\"0\" align=\"middle\" " + "/>&nbsp;&nbsp;<a href=\"javascript:openMknWin('http://www.apple.com/quicktime/download/',3)\">[ Download Quicktime Player ]</" + "a></di" + "v><div class=\"mediawin\" style=\"width:320px\"><img src=\"/assets/img/misc/vid_real.gif\" alt=\"\" width=\"25\" height=\"22\" border=\"0\" align=\"middle\" " + "/>&nbsp;&nbsp;<a href=\"javascript:openMknWin('http://www.real.com',3)\">[ Download Real Player ]</" + "a></di" + "v><div class=\"mediawin\" style=\"width:320px\"><img src=\"/assets/img/misc/vid_wm.gif\" alt=\"\" width=\"25\" height=\"25\" border=\"0\" align=\"middle\" " + "/>&nbsp;&nbsp;<a href=\"javascript:openMknWin('http://www.microsoft.com/windows/windowsmedia/download/default.asp?DispLang=en',3)\">[ Download Windows Media Player ]</" + "a></di" + "v></di" + "v>";		document.writeln(noplayer[lang]);		break;	case "001":		// Real		document.writeln("<form action=\"" + url + "\" method=\"post\" name=\"playerselect\">");		document.writeln("<div id=\"image\" class=\"video\" style=\"width:480px\">");		document.writeln(d3[lang] + d4 + real);		document.writeln("</di" + "v>");		document.writeln("<div class=\"col\" style=\"width:30px;\"><input name=\"\" type=\"image\" style=\"margin-top:5px;\" src=\"/assets/img/misc/browse_th_right.gif\" alt=\"" + use[lang] + "\" border=\"0\" " + "/></di" + "v><br clear=\"all\" " + "/>");		document.writeln("</di" + "v>");		document.writeln("</fo" + "rm>");		break;	case "010":		// Windows Media		document.writeln("<form action=\"" + url + "\" method=\"post\" name=\"playerselect\">");		document.writeln("<div id=\"image\" class=\"video\" style=\"width:480px\">");		document.writeln(d3[lang] + d4 + wm);		document.writeln("</di" + "v>");		document.writeln("<div class=\"col\" style=\"width:30px;\"><input name=\"\" type=\"image\" style=\"margin-top:5px;\" src=\"/assets/img/misc/browse_th_right.gif\" alt=\"" + use[lang] + "\" border=\"0\" " + "/></di" + "v><br clear=\"all\" " + "/>");		document.writeln("</di" + "v>");		document.writeln("</fo" + "rm>");		break;		case "100":		// Quicktime		document.writeln("<form action=\"" + url + "\" method=\"post\" name=\"playerselect\">");		document.writeln("<div id=\"image\" class=\"video\" style=\"width:480px\">");		document.writeln(d3[lang] + d4 + qt);		document.writeln("</di" + "v>");		document.writeln("<div class=\"col\" style=\"width:30px;\"><input name=\"\" type=\"image\" style=\"margin-top:5px;\" src=\"/assets/img/misc/browse_th_right.gif\" alt=\"" + use[lang] + "\" border=\"0\" " + "/></di" + "v><br clear=\"all\" " + "/>");		document.writeln("</di" + "v>");		document.writeln("</fo" + "rm>");		break;	case "011":		// Auswahl: Windows-Media oder Real.		document.writeln("<form action=\"" + url + "\" method=\"post\" name=\"playerselect\">");		document.writeln("<div id=\"image\" class=\"video\" style=\"width:480px\">");		document.writeln(d1[lang] + "<strong>Real-Media</str" + "ong> " + plus[lang] + " <strong>Windows-Media</str" + "ong>" + d2[lang] + real + wm);		document.writeln("</di" + "v>");		document.writeln("<div class=\"col\" style=\"width:30px;\"><input name=\"\" type=\"image\" style=\"margin-top:5px;\" src=\"/assets/img/misc/browse_th_right.gif\" alt=\"" + use[lang] + "\" border=\"0\" " + "/></di" + "v><br clear=\"all\" " + "/>");		document.writeln("</di" + "v>");		document.writeln("</fo" + "rm>");		break;	case "101":		// Auswahl: Quicktime oder Real.		document.writeln("<form action=\"" + url + "\" method=\"post\" name=\"playerselect\">");		document.writeln("<div id=\"image\" class=\"video\" style=\"width:480px\">");		document.writeln(d1[lang] + "<strong>Quicktime</str" + "ong> " + plus[lang] + " <strong>Real-Media</str" + "ong>" + d2[lang] + qt + real);		document.writeln("</di" + "v>");		document.writeln("<div class=\"col\" style=\"width:30px;\"><input name=\"\" type=\"image\" style=\"margin-top:5px;\" src=\"/assets/img/misc/browse_th_right.gif\" alt=\"" + use[lang] + "\" border=\"0\" " + "/></di" + "v><br clear=\"all\" " + "/>");		document.writeln("</di" + "v>");		document.writeln("</fo" + "rm>");		break;	case "110":		// Auswahl: Quicktime oder Windows-Media.		document.writeln("<form action=\"" + url + "\" method=\"post\" name=\"playerselect\">");		document.writeln("<div id=\"image\" class=\"video\" style=\"width:480px\">");		document.writeln(d1[lang] + "<strong>Quicktime</str" + "ong> " + plus[lang] + " <strong>Windows-Media</str" + "ong>" + d2[lang] + qt + wm);		document.writeln("</di" + "v>");		document.writeln("<div class=\"col\" style=\"width:30px;\"><input name=\"\" type=\"image\" style=\"margin-top:5px;\" src=\"/assets/img/misc/browse_th_right.gif\" alt=\"" + use[lang] + "\" border=\"0\" " + "/></di" + "v><br clear=\"all\" " + "/>");		document.writeln("</di" + "v>");		document.writeln("</fo" + "rm>");		break;	case "111":		// Auswahl: Quicktime oder Windows-Media oder Real.		document.writeln("<form action=\"" + url + "\" method=\"post\" name=\"playerselect\">");		document.writeln("<div id=\"image\" class=\"video\" style=\"width:480px\">");		document.writeln(d1[lang] + "<strong>Quicktime</str" + "ong>, <strong>Real-Media</str" + "ong> " + plus[lang] + " <strong>Windows-Media</str" + "ong>" + d2[lang] +  qt + real + wm);		document.writeln("</di" + "v>");		document.writeln("<div class=\"col\" style=\"width:30px;\"><input name=\"\" type=\"image\" style=\"margin-top:5px;\" src=\"/assets/img/misc/browse_th_right.gif\" alt=\"" + use[lang] + "\" border=\"0\" " + "/></di" + "v><br clear=\"all\" " + "/>");		document.writeln("</di" + "v>");		document.writeln("</fo" + "rm>");		break;	}}
