
var flash2Installed = false; // true if flash 2 installed
var flash3Installed = false; //
var flash4Installed = false; //
var flash5Installed = false; //
var flash6Installed = false; //
var flash7Installed = false; //
var flash8Installed = false; //
var flash9Installed = false; //
var flash10Installed = false; //
var flash11Installed = false; //
var maxVersion   = 11;  // check to max version
var actualVersion  = 0;  // user installed version

var hasRightVersion = false; // true if user has right version

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; // TRUE if IE
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // TRUE for Win OS	


/* VB-Script Detection for Internet Explorer Windows -------------------------------------------------------------------*/


if(isIE && isWin){
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('on error resume next \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('on error resume next \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('on error resume next \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n'); 
	document.write('on error resume next \n');
	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
	document.write('on error resume next \n');
	document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n'); 
	document.write('on error resume next \n');
	document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
	document.write('on error resume next \n');
	document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
	document.write('on error resume next \n');
	document.write('flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
	document.write('on error resume next \n');
	document.write('flash11Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');
	document.write('</SCRIPT\> \n');
}


function detectFlash(flV) {

	// existiert navigator.plugins
	if (navigator.plugins) {
		
		// check f�r flash 2 oder flash 3+
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			
			var isVersion2    = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription  = navigator.plugins["Shockwave Flash" + isVersion2].description;
			
			 //alert("Flash plugin description: " + flashDescription);
			
			var flashVersion   = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			
			 //alert('flashVersion ' + flashVersion);
			
			flash2Installed   = flashVersion == 2;   
			flash3Installed   = flashVersion == 3;
			flash4Installed   = flashVersion == 4;
			flash5Installed   = flashVersion == 5;
			flash6Installed   = flashVersion == 6;
			flash7Installed   = flashVersion == 7;
			flash8Installed   = flashVersion == 8;
			flash9Installed   = flashVersion == 9;
			flash10Installed   = flashVersion == 10;
			flash11Installed   = flashVersion >= 11;
		}
	}

	for (var i = 2; i <= maxVersion; i++) { 
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}
	
	if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3; 
	
	 //alert("version detected: " + actualVersion);
	
	if (actualVersion >= flV) {
		hasRightVersion = true;
		return true;
	} else { 
		hasRightVersion = false;
		return false;
	}
	 //alert('hasRightVersion ' + hasRightVersion);
}



function showStartseiteFlash() {
	var flash = document.getElementById('startseiteFlash_div');

	if (detectFlash(6)) {
		
		flash.innerHTML = '\
			<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="startseiteFlash" width="743" height="412">\
				<param name="movie" value="/fileadmin/swf/animation.swf" />\
				<param name="wmode" value="transparent" />\
				<embed src="/fileadmin/swf/animation.swf" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="743" height="412" wmode="transparent">\
				</embed>\
			</object>';
		
	} else {
		
		flash.innerHTML = '';
	}
}

function showSubpageFlash() {
	var flash = document.getElementById('startseiteFlash_div');
		
	if (detectFlash(6)) {
		flash.innerHTML = '\
			<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="startseiteFlash" width="743" height="196">\
				<param name="movie" value="/fileadmin/swf/animation_small.swf" />\
				<param name="wmode" value="transparent" />\
				<embed src="/fileadmin/swf/animation_small.swf" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="743" height="196" wmode="transparent">\
				</embed>\
			</object>';
	} else {
		flash.innerHTML = '';
		
		
	}
}