var contentFile = "";
contentFile += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
contentFile += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" ";
contentFile += "width=\"785\" ";
contentFile += "height=\"300\">";
contentFile += "<param name=\"movie\" value=\"index/title.swf\">";
contentFile += "<param name=\"quality\" value=\"high\">";
contentFile += "<param name=\"wmode\" value=\"opaque\" /> ";
contentFile += "<embed src=\"index/title.swf\" ";
contentFile += "quality=\"high\" ";
contentFile += "pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
contentFile += "type=\"application/x-shockwave-flash\" ";
contentFile += "wmode=\"opaque\" ";
contentFile += "width=\"785\" ";
contentFile += "height=\"300\"></embed>";
contentFile += "</object>";

var contentContainerId = "containerTD";
var versionDetectorPath = "index/";

var contentVersion = 8;
var contentMajorRevision = 0;
var contentMinorRevision = 0;

var errorStyle = "font-family:verdana; font-size:12px;  color:#CC0000;";
var sucStyle = "font-family:verdana; font-size:12px;  color:#009900;";
var normStyle = "font-family:verdana; font-size:12px;  color:#666666;";

var errorPage = "<table width=\"785\" height=\"300\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" ";
errorPage += "background=\"index/vr_topBG_verlauf.gif\" style=\"background-position:top; background-repeat:repeat-x;\"> ";
errorPage += "<tr><td valign=\"top\"><img src=\"index/vr_logoECK_de.gif\" width=\"267\" height=\"150\" /></td></tr></table>";



// ___________________________________________________________________________________
// check if flash is installed  //////////////////////////////////////////////////////////////////////////////////////

var detectableWithVB = false;
var pluginFound = false;

function detectFlash() {
    pluginFound = detectPlugin('Shockwave','Flash'); 
    if(!pluginFound && detectableWithVB) {
	pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.1');
    }
    return pluginFound;
}

function detectPlugin() {
	var daPlugins = detectPlugin.arguments;
	var pluginFound = false;
	if (navigator.plugins && navigator.plugins.length > 0) {
		var pluginsArrayLength = navigator.plugins.length;
		for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {
			var numFound = 0;
			for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {
				if( (navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) || (navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) {
					numFound++;
				}   
			}
			if(numFound == daPlugins.length) {
				pluginFound = true;
				break;
			}
		}
	}
	return pluginFound;
}

if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    document.writeln('<script language="VBscript">');

    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');
    
    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('</scr' + 'ipt>');
}

// if flash is installed check flashvesion ///////////////////////////////////////////////////////////////////////////

if(detectFlash() == true){
	document.writeln("<object ");
	document.writeln("classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" ");
	document.writeln("codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0\" ");
	document.writeln("width=\"1\" ");
	document.writeln("height=\"1\" ");
	document.writeln("id=\"flashVersionDetector\" ");
	document.writeln("align=\"middle\">");
	document.writeln("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.writeln("<param name=\"movie\" value=\""+versionDetectorPath+"flashVersionDetector.swf\" />");
	document.writeln("<param name=\"quality\" value=\"high\" />");
	document.writeln("<param name=\"bgcolor\" value=\"\" />");
	document.writeln("<embed src=\""+versionDetectorPath+"flashVersionDetector.swf\" ");
	document.writeln("quality=\"high\" ");
	document.writeln("bgcolor=\"\" ");
	document.writeln("width=\"1\" ");
	document.writeln("height=\"1\" ");
	document.writeln("name=\"flashVersionDetector\" ");
	document.writeln("swliveconnect=\"true\" "); 
	document.writeln("align=\"middle\" ");
	document.writeln("allowScriptAccess=\"sameDomain\" ");
	document.writeln("type=\"application/x-shockwave-flash\" ");
	document.writeln("pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.writeln("</object>");
}else if (isflash == false){
	toOutput("<span style=\""+errorStyle+"\">Flash Plugin ist nicht installiert</span>");
}else{
	toOutput("<span style=\""+errorStyle+"\">Flash Plugin ist wurde nicht gefunden</span>");
}

// reactions  ///////////////////////////////////////////////////////////////////////////////////////////////////

function toOutput(message){
	document.getElementById(contentContainerId).innerHTML = message;
}

function gotVersion(playerVersion, playerMajorRevision, playerMinorRevision){
	if (playerVersion < contentVersion) { 
		// Error --------------------------------
		toOutput("<span style=\""+errorStyle+"\">Flash Plugin Version "+playerVersion+"."+playerMajorRevision+"."+playerMinorRevision+".0 ist installiert</span>");
		toOutput(errorPage);
	} else if (playerVersion>contentVersion) {
		toOutput("<span style=\""+sucStyle+"\">Flash Plugin Version "+playerVersion+"."+playerMajorRevision+"."+playerMinorRevision+".0 ist installiert</span>");
		toOutput(contentFile);
		
	} else if ((playerVersion == contentVersion && playerMajorRevision < contentMajorRevision)) {
		// Error --------------------------------
		toOutput("<span style=\""+errorStyle+"\">Flash Plugin Version "+playerVersion+"."+playerMajorRevision+"."+playerMinorRevision+".0 ist installiert</span>");
		toOutput(errorPage);
	} else if ((playerVersion == contentVersion) && (playerMajorRevision == contentMajorRevision) && (playerMinorRevision < contentMinorRevision)) {
		// Error --------------------------------
		toOutput("<span style=\""+errorStyle+"\">Flash Plugin Version "+playerVersion+"."+playerMajorRevision+"."+playerMinorRevision+".0 ist installiert</span>");
		toOutput(errorPage);
	} else if ((playerVersion == contentVersion) && (playerMajorRevision == contentMajorRevision) && (playerMinorRevision >= contentMinorRevision)) {
		toOutput("<span style=\""+sucStyle+"\">Flash Plugin Version "+playerVersion+"."+playerMajorRevision+"."+playerMinorRevision+".0 ist installiert</span>");
		toOutput(contentFile);
		
	}
	M_click(0);
}



