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('mode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
			document.write('</SCRIPT\> \n');
		}
		return mode;
	}	
}

function insertObject(i_plugin, i_path, i_name, i_width, i_height, i_bgcolor, i_alternate, i_status) {
	// FLASH
	if(i_plugin=='flash') {
		if (checkPlugIn(i_plugin)){
			var theArray = i_path.split("/");
			theArray =theArray.slice(0,-1);
			var theParamStr = "archiv=" + isInArchiv();
			theParamStr =theParamStr + "&path=" + theArray.join("/");
			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=4,0,0,0"');
			document.write(' ID="' + i_name + '" WIDTH="' + i_width + '" HEIGHT="' + i_height + '">');
			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" 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" usemap="#fallback">');
			}else if(i_status=='iframe'){
				document.write('<iframe src="'+i_alternate+'" width="'+i_width+'" height="'+i_height+'" align="left" scrolling="no" frameborder="0" style="border: none;" border="0"><img src="'+i_path+'.jpg" width="'+i_width+'" height="'+i_height+'" border="0" usemap="#fallback"></iframe>');
			} 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 + '.gif" 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;
}