flash_versions = 20;

var flash = new Object();
flash.installed=false;
flash.version='0.0';

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) {}
	}
}

flash.ver = Array();
for(i = 4; i <= flash_versions; i++) {
	eval("flash.ver[" + i + "] = (flash.installed && parseInt(flash.version) >= " + i + ") ? true : false;");
}

function isSafari() {
	var ua = navigator.userAgent.toLowerCase();
	var	ret;
	var isSafariVar = (ua.indexOf('safari') != - 1); 
	if (isSafariVar)
		ret = true;
	else 
		ret = false;
	return ret;
};

function getmood(flashname,width,height,altpicture,vars){

	ua = navigator.userAgent.toLowerCase();
	isSaf = (ua.indexOf('safari') != - 1); 

	wmode= (!isSaf)? 'transparent':'window';
	//&& !isSafari() //safari weg weil die dropdowns dort nicht funktionieren
	wmode='opaque';
	
	if (flash.ver[7] && flashname!="" && height!="" && width!="" && (!isSaf) ) 
	{
		document.write('<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ');
		document.write('codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ');
		document.write('WIDTH=\"'+width+'\" HEIGHT=\"'+height+'\" id=\"pxd\" ALIGN=\"\"> ');
		document.write('<param name=movie VALUE=\"'+flashname+vars+'\" /> ');
		document.write('<param name=quality VALUE=high /> ');
		document.write('<param name=\"scale\" value=\"noscale\" /> ');
		document.write('<param name=\"wmode\" value=\"'+wmode+'\" /> ');
		document.write('<param=\"bgcolor\" value=\"#000000\" /> ');
		document.write('<EMBED src=\"'+flashname+vars+'\" quality=\"high\" scale=\"noscale\" wmode=\"'+wmode+'\" '); 
		document.write('bgcolor=\"#ffffff\"  WIDTH=\"'+width+'\" HEIGHT=\"'+height+'\" NAME=\"pxd\" ALIGN=\"\" ');
		document.write('TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED> ');
		document.write('</OBJECT>');		
	}
	else
	{
		document.write('<img src=\"'+altpicture+'\" alt=\"\" border=\"0\" width=\"'+width+'\" height=\"'+height+'\">');
	}

}		
