var FlashMode = isFlash5();

function isFlash5(){
	
	FlashMode =0;
	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
		if (navigator.plugins && navigator.plugins["Shockwave Flash"] && (versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf(".")) != - 1) {
			var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-1, versionIndex);
			versionIndex = parseInt( versionString );
			if ( versionIndex >= 5 ) {
					FlashMode = 1;
			}
		}
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
		document.write('<SCRIPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('FlashMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
		document.write('</SCRIPT\> \n');
		 
	}
	return FlashMode;
}

function openFlash5Window(inHTMLPath,inFallbackPath,inSWFPath,inName,inLanguage,inWidth,inHeight){
	
	if (FlashMode){

if ( inSWFPath == 'bde_simu_v6.swf' )
{
// Je nach Sprachk�rzel wird ein anderer Flashfilm geladen:
// not_antialaised: "Pfad/Flashfilmname" + "_x"
// antialaised: "Pfad/Flashfilmname"

not_antialaised = inLanguage;

switch ( not_antialaised ) // ab 4'er Browser!
{
	// Deutschland
	//case "de":inSWFPath='bde_simu_v6_x.swf';break;

	// England
	//case "en":inSWFPath='bde_simu_v6_x.swf';break;

	// Frankreich
	//case "fr":inSWFPath='bde_simu_v6_x.swf';break;

	// Spanien
	//case "es":inSWFPath='bde_simu_v6_x.swf';break;

	// Italien
	//case "it":inSWFPath='bde_simu_v6_x.swf';break;

	// Belgien 
	//case "bn":inSWFPath='bde_simu_v6_x.swf';break;

	// Portugal
	//case "pt":inSWFPath='bde_simu_v6_x.swf';break;

	// Schweden
	//case "sv":inSWFPath='bde_simu_v6_x.swf';break;

	// D�nemark
	//case "da":inSWFPath='bde_simu_v6_x.swf';break;

	// Niederlande
	//case "nl":inSWFPath='bde_simu_v6_x.swf';break;

	// Bulgarien
	case "bg":inSWFPath='bde_simu_v6_x.swf';break;

	// Korea
	case "ko":inSWFPath='bde_simu_v6_x.swf';break;

	// T�rkei
	case "tr":inSWFPath='bde_simu_v6_x.swf';break;

	// Andere Sprachen (antialaised)
	default:inSWFPath=inSWFPath;
}
}

		theParamStr = "FlashParameter=" + inSWFPath +"|" + inLanguage +"|" + inWidth +"|" + inHeight;
		inPath = inHTMLPath + "?" + theParamStr;
	}else{
		inPath = inFallbackPath;
	}
	
	openNewWindow(inPath,inName,inWidth,inHeight);
}

function openNewWindow(inPath,inName,inWidth,inHeight){
	
	theParamStr ='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,width='+inWidth+',height='+inHeight;
	theWindow = window.open(inPath,inName,theParamStr);
}

function writeFlash5FromSearchString(){
	theString = self.location.search;
	if (theString){
		
    	theString = theString.replace("?","");
		theArray = getListFromString(theString);
		thePath = theArray[0];
		theLanguage = theArray[1];
		theWidth = theArray[2];
		theHeight = theArray[3];
		writeFlash5(thePath,theLanguage,theWidth,theHeight);
	}
}

function getListFromString(inString){
	theArray = inString.split("=");
	theString = theArray[1];
	
	theArray = theString.split("|");
	return theArray;
}

function writeFlash5(inPath,inLanguage,inWidth,inHeight){
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
 	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ');
 	document.write(' WIDTH='+ inWidth + ' HEIGHT=' + inHeight + '> ');
 	document.write('<PARAM NAME=movie VALUE="' + inPath +'"> <PARAM NAME=quality VALUE=high><PARAM NAME=salign VALUE=LT> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
 	document.write(' <EMBED src="' + inPath +'" quality=high scale=exactfit bgcolor=#FFFFFF  WIDTH='+ inWidth + ' HEIGHT='+ inHeight + ' TYPE="application/x-shockwave-flash" ');
 	document.write('PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');

}
