var FlashDetectionTimeOut = false;

var arrLanguage = String(document.location.href).split("PublishExamLanguage=");
arrLanguage = arrLanguage[1].split("&");
var strLanguage = arrLanguage[0];

function StartFlashDetection(intTimeOutSeconds){
	if(FlashDetectionTimeOut == false){
		FlashDetectionTimeOut = window.setTimeout("FlashVersionNotAccepted()", intTimeOutSeconds*1000);
	}
}

function FlashVersionAccepted(strDetectedVersion, strMinimalVersion){
	if(FlashDetectionTimeOut != false){
		window.clearTimeout(FlashDetectionTimeOut);
	}
	FlashDetectionTimeOut = true;
	document.getElementById("FlashDetectionLayer").style.visibility = "hidden";
}

function FlashVersionNotAccepted(){
	document.getElementById("FlashDetectionLayer").style.visibility = "hidden";
	if(strLanguage == "de" || strLanguage == "DE"){
		document.location.href = "noflash_de.html";
	}else if(strLanguage == "fr" || strLanguage == "FR"){
		document.location.href = "noflash_de.html";
	}else if(strLanguage == "it" || strLanguage == "IT"){
		document.location.href = "noflash_de.html";
	}else if(strLanguage == "en" || strLanguage == "EN"){
		document.location.href = "noflash_de.html";
	}
}

function ShowFlashDetectionLayer(){
	document.writeln("<div id=\"FlashDetectionLayer\" style=\"position:absolute; width:500px; height:50px; z-index:1; left: 10; top: 10\">");
	document.writeln("<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#999999\">");

	if(strLanguage == "de" || strLanguage == "DE"){
		document.writeln("Cybertest ermittelt die Version Ihres Flash Players. Bitte warten..");
	}else if(strLanguage == "fr" || strLanguage == "FR"){
		document.writeln("Cybertest is detecting the version of your Flash Player. Please wait..");
	}else if(strLanguage == "it" || strLanguage == "IT"){
		document.writeln("Cybertest is detecting the version of your Flash Player. Please wait..");
	}else if(strLanguage == "en" || strLanguage == "EN"){
		document.writeln("Cybertest is detecting the version of your Flash Player. Please wait..");
	}
	document.writeln("</font></div>");
}
