mode = 0;
var x,flashversion = 0;
function checkPlugIn(i_name) {
	if (i_name=='flash') {
		if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
			if (navigator.plugins && navigator.plugins["Shockwave Flash"]){// && !(ie4 && mac))
				x = navigator.plugins["Shockwave Flash"];
					if (x.description){
						y = x.description;
						flashversion = y.charAt(y.indexOf('.')-1);
					}
					mode = 1;
			}
		}
		else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
		   	&& (navigator.userAgent.indexOf("Windows 9")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {

			document.write('<SCRIPT LANGUAGE=VBScript\> \n');

			document.write('on error resume next \n');


			document.write('set mode = CreateObject("ShockwaveFlash.ShockwaveFlash.6") \n');
			document.write('if IsObject(mode) then \n');
			document.write('flashversion = 6 \n');

			document.write('else \n');

			document.write('set mode = CreateObject("ShockwaveFlash.ShockwaveFlash.5") \n');
			document.write('end if\n');

			document.write('if flashversion < 6 and IsObject(mode) then \n');
			document.write('flashversion = 5 \n');
			document.write('else \n');
			document.write('set mode = CreateObject("ShockwaveFlash.ShockwaveFlash.4") \n');
			document.write('end if\n');

			document.write('if flashversion < 5 and IsObject(mode) then \n');
			document.write('flashversion = 4 \n');
			document.write('else \n');
			document.write('set mode = CreateObject("ShockwaveFlash.ShockwaveFlash.3") \n');
			document.write('end if\n');

			document.write('if flashversion < 4 and IsObject(mode) then \n');
			document.write('flashversion = 3 \n');
			document.write('end if\n');

			document.write('</SCRIPT\> \n');
		}
		return mode;
	}	
}

function insertVar () {

        if ( overview ) {

                var var_string = "prod=" + overview + "&&";
                return  var_string;
        }
        else {
                var_string = "";
                return var_string;
        }
}

function insertObject(i_plugin, i_path, i_name, i_width, i_height, i_bgcolor, i_alternate, i_status) {
        // FLASH
        /*if(i_plugin=='flash') {

                        if(i_status=='image'){
                                document.write('<img src="'+i_alternate+'" width="'+i_width+'" height="'+i_height+'" border="0">');
                        }else {
                                document.location.href = i_alternate;
                        }
        }*/
        if(i_plugin=='flash') {
                if ( checkPlugIn(i_plugin) && (flashversion == 6) && (i_name.indexOf('_v6') ==-1) ){

//debug
//debug(i_plugin, i_path, i_name, i_width, i_height, i_bgcolor, i_alternate, i_status, FlashPlayerVersion = flashversion);
//if (flashversion == 6)
//{
//alert('Macromedia Flash Player 6' + ' V' + flashversion);
//}
					

// Je nach Sprachk�rzel wird ein anderer Flashfilm geladen:
// not_antialaised: "Pfad/Flashfilmname" + "_x"
// antialaised: "Pfad/Flashfilmname"

not_antialaised = param_currentLanguageID;

switch ( not_antialaised ) // ab 4'er Browser!
{
	// Bulgarien
	case "bg":i_path+='_x';break;

	// Korea
	case "ko":i_path+='_x';break;

	// T�rkei
	case "tr":i_path+='_x';break;

	// Norwegen
	case "no":i_path+='_x';break;

	// China
	case "zh":i_path+='_x';break;

	// Andere Sprachen (antialaised)
	default:i_path=i_path;
}
                        var theArray = i_path.split("/");
                        theArray =theArray.slice(0,-1);
                        var theParamStr = "archiv=" + isInArchiv();
			theParamStr =theParamStr + "&setLang=" + param_currentLanguageID + ".jsp"; 
                        theParamStr =theParamStr + "&path=" + theArray.join("/");

                        // edited: insertVar: variablen�bergabe an flash ( k-seiten )

                        if (theArray.length >0){theParamStr = theParamStr + "/"};
                        document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
                        document.write(' codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=6,0,0,0"');
                        document.write(' ID="' + i_name + '" WIDTH="' + i_width + '" HEIGHT="' + i_height + ' NAME=' + i_name + '">');
                        document.write(' <PARAM NAME=movie VALUE="' + i_path + '.swf?' + theParamStr + '"> ');
                        document.write(' <PARAM NAME=quality VALUE=high> ');
                        document.write(' <PARAM NAME=menu VALUE=false> ');
                        document.write(' <PARAM NAME=bgcolor VALUE=#' + i_bgcolor + '> ');
                        document.write('<EMBED SRC="' + i_path + '.swf?' + theParamStr + '"');
                        document.write(' NAME=' + i_name + ' swLiveConnect="TRUE" ID=' + i_name + ' WIDTH="' + i_width + '" HEIGHT="' + i_height + '"');
                        document.write(' QUALITY="high" MENU="false" BGCOLOR="#' + i_bgcolor + '"');
                        document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
                        document.write('</EMBED>');
                        document.write('</OBJECT>');
                }
                else if ( checkPlugIn(i_plugin) && (flashversion >= 5) && (i_name.indexOf('_v6') !=-1) ){

//debug
//debug(i_plugin, i_path, i_name, i_width, i_height, i_bgcolor, i_alternate, i_status, FlashPlayerVersion = flashversion);
//if (flashversion == 5)
//{
//alert('Macromedia Flash Player 5' + ' V' + flashversion);	
//}
					

                        var theArray = i_path.split("/");
                        theArray =theArray.slice(0,-1);
                        var theParamStr = "archiv=" + isInArchiv();
			theParamStr =theParamStr + "&setLang=" + param_currentLanguageID + ".jsp";
                        theParamStr =theParamStr + "&path=" + theArray.join("/");

                        // edited: insertVar: variablen�bergabe an flash ( k-seiten )

                        if (theArray.length >0){theParamStr = theParamStr + "/"};
                        document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
                        document.write(' codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0"');
                        document.write(' ID="' + i_name + '" WIDTH="' + i_width + '" HEIGHT="' + i_height + ' NAME=' + i_name + '">');
                        document.write(' <PARAM NAME=movie VALUE="' + i_path + '.swf?' + theParamStr + '"> ');
                        document.write(' <PARAM NAME=quality VALUE=high> ');
                        document.write(' <PARAM NAME=menu VALUE=false> ');
                        document.write(' <PARAM NAME=bgcolor VALUE=#' + i_bgcolor + '> ');
                        document.write('<EMBED SRC="' + i_path + '.swf?' + theParamStr + '"');
                        document.write(' NAME=' + i_name + ' swLiveConnect="TRUE" ID=' + i_name + ' WIDTH="' + i_width + '" HEIGHT="' + i_height + '"');
                        document.write(' QUALITY="high" MENU="false" BGCOLOR="#' + i_bgcolor + '"');
                        document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
                        document.write('</EMBED>');
                        document.write('</OBJECT>');
                }
                else {
                        if(i_status=='image'){
                                document.write('<img src="'+i_alternate+'" width="'+i_width+'" height="'+i_height+'" border="0">');
                        }else {
                                document.location.href = i_alternate;
                        }
                }
        }

        if(i_plugin=='quicktime') {
                if (checkPlugIn(i_plugin)){
                        document.write('<EMBED SRC="' + i_path + '.mov"');
                        document.write(' BGCOLOR="#' + i_bgcolor + '" WIDTH="' + i_width + '" HEIGHT="' + i_height + '"');
                        document.write(' CONTROLLER="true" BORDER="0" PLUGINSPAGE="http://www.apple.com/quicktime/download/" cache="true">');
                }
                else {
                        document.write('<img src="' + i_path + '.jpg" width="' + i_width + '" height="' + i_height + '" border="0">')
                }
        }
}

function isInArchiv(){
        var theReturn = false;
        var inArray =self.location.href.split("/");
        var theLength = inArray.length;
        for (i=0;i<theLength;i++){
                theReturn =(inArray[i]=="archiv");
                if (theReturn){break;}
        }
        return theReturn;
}
