function fensterhoehe() {
	var myWidth = 0, heig = 0;
	if (typeof (window.innerWidth) == 'number') {
		//Non-IE
		myWidth = window.innerWidth;
		heig = window.innerHeight - 20;
		return heig;
	} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		heig = document.documentElement.clientHeight - 20;
		return heig;
	} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		heig = document.body.clientHeight - 20;
		return heig;
	}
}
function heighter() {
	var hei = fensterhoehe();
	if (typeof (window.innerWidth) == 'number') {
		document.getElementById("mainTable").style.height = hei + "px";
	} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		hei = hei.toString();
		document.all.flash.style.setAttribute("padding", "0px", 1);
		document.all.flash.style.setAttribute("position", "relative", 1);
		document.all.mainTable.style.setAttribute("height", hei, 1);
	} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		hei = hei.toString();
		document.all.flash.style.setAttribute("padding", "0px", 1);
		document.all.flash.style.setAttribute("position", "relative", 1);
		document.all.mainTable.style.setAttribute("height", hei, 1);
	}
	}
function addFlash(movieURL, width, height, targ, divID, affiliateParam) {
	var url = window.location.href;
	// look if affiliate parameter is set
	if (affiliateParam != "affiliateParameter") {
		var affpar = "&" + affiliateParam;
	} else {
		var affpar = "";
	}
	// look if url parameters are set and building the variables for flash
	if (url.indexOf("?") != -1) {
		var urlParams = url.substring((url.indexOf("?") + 1), url.length);
		//urlParams = encodeURI(urlParams);
		var paraArray = urlParams.split("&");
		for (var i = 0; i < paraArray.length; i++) {
			if (i == 0) {
				var urlParamStr = paraArray[i] + "|";
			} else if (i < paraArray.length - 1) {
				urlParamStr = urlParamStr + paraArray[i] + "|";
			} else {
				urlParamStr = urlParamStr + paraArray[i];
			}
		}
		var params = "<param name='FlashVars' value='URLparam=" + urlParamStr + "" + affpar + "&targetWin=" + targ + "&lcId=" + divID + "'/>";
	} else {
		var params = "<param name='FlashVars' value='URLparam=false" + affpar + "&targetWin=" + targ + "&lcId=" + divID + "'/>";
	}
	// building the flash into the desired element
	document.getElementById(divID).innerHTML = "\r\n<object id='" + divID + "_swf' data='" + movieURL + "' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'>\r\n<param name='movie' value='" + movieURL + "' />\r\n<param name='quality' value='high' />\r\n<param name='allowScriptAccess' value='allways' />\r\n<param name='swliveconnect' value='true' />\r\n" + params + "\r\n</object>\r\n";
	heighter();
}
function addImage(altURL, targ, width, height, divID, affiliateParam) {
	// look if affiliate parameter is set
	if (affiliateParam != "affiliateParameter") {
		var affURL = affiliateParam.split("=");
		var affiURL = affURL[1] + "=";
	} else {
		var affiURL = "";
	}
	// building the alternative image into the desired element
	document.getElementById(divID).innerHTML = '<a href="' + affiURL + 'http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=German&P5_Language=German" rel="nofollow" rel="nofollow" target="' + targ + '"><img src="' + altURL + '" width="' + width + '" height="' + height + '" border="0" /></a>';
	heighter();
}
function checkFlash(URL, altURL, target, w, h, id, affiParam) {
	// This script will test up to the following version.
	flash_versions = 20;
	// Initialize variables and arrays
	var flash = new Object();
	flash.installed = false;
	flash.version = '0.0';
	// Dig through Netscape-compatible plug-ins first.
	if (navigator.plugins && navigator.plugins.length) {
		for (x = 0; x < navigator.plugins.length; x++) {
			if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
				flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
				flash.installed = true;
				break;
			}
		}
	} else if (window.ActiveXObject) {
		for (x = 2; x <= flash_versions; x++) {
			try {
				oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
				if (oFlash) {
					flash.installed = true;
					flash.version = x + '.0';
				}
			} catch (e) {
			}
		}
	}
	// Create sniffing variables in the following style: flash.ver[x] 
	flash.ver = Array();
	for (i = 4; i <= flash_versions; i++) {
		eval("flash.ver[" + i + "] = (flash.installed && parseInt(flash.version) >= " + i + ") ? true : false;");
	}
	if (flash.ver[8]) {
		addFlash(URL, w, h, target, id, affiParam);
	} else {
		addImage(altURL, target, w, h, id, affiParam);
	}
}