function flashDetect() {
	var error = '' ;
	if( typeof FlashWmode == 'undefined' ) {
		var FlashWmode = 'opaque' ;
	}
	var errorHl = " isn't defined.\r\n" ;
	//testuje promene
	if ( !FlashVersion || FlashVersion == '' )
		error += 'Version' + errorHl ;
	if ( !FlashFileSWF || FlashFileSWF == '' )
		error += 'SWF file' + errorHl ;
	if ( !FlashFileIMG || FlashFileIMG == '' )
		error += 'Image file' + errorHl ;
	if ( !FlashFileWidth || FlashFileWidth == '' )
		error += 'Width' + errorHl ;
	if ( !FlashFileHeight || FlashFileHeight == '' )
		error += 'Height' + errorHl ;

	if ( error != '' ) {
		alert ( error ) ;
	} else {
		var plugin = ( navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0 ;
		if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ") ;
			for ( var i = 0; i < words.length; ++i ) {
				if ( isNaN( parseInt( words[i] ) ) )
					continue;
				var MM_PluginVersion = words[i] ;
			}
			var MM_FlashCanPlay = MM_PluginVersion >= FlashVersion ;
		} else if ( navigator.userAgent && navigator.userAgent.indexOf( "MSIE" ) >= 0 && ( navigator.appVersion.indexOf( "Win" ) != -1 ) ) {
			document.write( '<scr' + 'ipt language="VBScript"\> \n' ) ; //FS hide this from IE4.5 Mac by splitting the tag
			document.write( 'on error resume next \n' ) ;
			document.write( 'MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & FlashVersion ) ) )\n' ) ;
			document.write( '</scr' + 'ipt\> \n' ) ;
		}
		if ( MM_FlashCanPlay != '' ) {
			document.write( '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' ) ;
			document.write( ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + FlashVersion + ',0,0,0" ' ) ;
			document.write( ' id="script" width="' + FlashFileWidth + '" height="' + FlashFileHeight + '" align="' + FlashFileAlign + '">' ) ;
				document.write( '<param name="movie" value="' + FlashFileSWF + '" />' ) ;
				document.write( '<param name="quality" value="high" />' ) ;
				document.write( '<param name="bgcolor" value="' + FlashFileBackground + '" />' ) ;
				document.write(' <embed wmode="' + FlashWmode + '" src="' + FlashFileSWF + '" quality="high" bgcolor="' + FlashFileBackground + '"  ');
					document.write(' swLiveConnect="FALSE" width="' + FlashFileWidth + '" height="' + FlashFileHeight + '" name="script" align="' + FlashFileAlign + '"');
					document.write(' type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer">');
				document.write(' </embed>');
			document.write(' </object>');
		} else{
			if ( FlashFileHref && FlashFileHref != '' )
  				document.write('<a href="' + FlashFileHref + '" title="' + FlashFileAlt + '">');
  
			document.write( '<img src="' + FlashFileIMG + '" width="' + ( ( FlashIMGWidth != undefined ) ? FlashIMGWidth : FlashFileWidth ) + '" height="' + ( ( FlashIMGHeight != undefined ) ? FlashIMGHeight : FlashFileHeight ) + '"' + ( ( FlashIMGClass != undefined ) ? ' class="' + FlashIMGClass + '"' : '' ) + ' alt="' + FlashFileAlt + '" />');

			if ( FlashFileHref && FlashFileHref != '' )
				document.write('</a>');
		}
	}
}
