// Do not copy and paste the script to your document. // It needs to be included as an external script! // Please include this script in the section of your (X)HTML document only! // // Version: 1.6.7 // --- USAGE --- // writeFlashCode(flash_movie, fallback_image, flash_parameters); // flash_movie - URL to Flash Movie // fallback_image - URL to Fallback Image // flash_parameters - Flash Parameters, e.g. width=775;height=600;version=6,0,65,0 // --- CUSTOMIZABLE PARAMETERS --- var fsiPresetFlashVersion='6,0,65,0'; // Default value for required Flash version var fsiImageFallbackLinked=true; // Add a link to Flash Player download location to the fallback image var fsiTextFallbackActive=true; // Activate text fallback? var fsiTextFallbackText='Flash Player Required.\nWould you like to download the latest version of Flash Player now?'; var flashFallbackImage='erez?src=erez-private/flashrequired.svg&tmp=Large&quality=97';//virtual-zoom.cz/makro/flash_player_cz-en.jpg // // EDITING THE LINES BELOW IS NOT RECOMMENDED // function flashDetector(presetFlashVersion, imageFallbackLinked, textFallbackActive, textFallbackText){ this.flashVersion = 0; var flashDownload; var flashDownloadCab; this.init = function(){ var scheme; if (window.location && window.location.protocol.indexOf('https') > -1) scheme='https://'; else scheme='http://'; flashDownload = scheme+'www.adobe.com/go/getflashplayer'; flashDownloadCab = scheme+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab'; var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var isIE11 = (navigator.appVersion.indexOf("Trident") != -1) ? true : false; var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1) ? true : false; if ( (isIE || isIE11) && isWin && !isOpera) { try { var axTester = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); var axVersionFull = axTester.GetVariable("$version"); if (axVersionFull){ var regVersion = axVersionFull.match(/(\d+),\d+,\d+,\d+/); if (regVersion && regVersion[1]){ this.flashVersion = parseInt(regVersion[1]); } } } catch (e){} } else { var napl; if (navigator.plugins) napl = navigator.plugins; else napl = false; if (napl && napl.length > 0 && (napl["Shockwave Flash 2.0"] || napl["Shockwave Flash"])) { var flashDesc = napl["Shockwave Flash" + (napl["Shockwave Flash 2.0"] ? " 2.0" : "")].description; this.flashVersion = parseInt(flashDesc.split(" ")[2].split(".")[0]); } } // Scan Win/IE Old if (this.flashVersion == 0 && (isIE || isIE11) && isWin && !isOpera) { pushVBDetection(); } } this.writeFlashCode = function (fsiurl, fallbackimg, parameters){ var objcode='= majorversion){ var code; if (params["width"]) { code=' width="'+params["width"]+'"'; objcode+=code; emdcode+=code; params["width"]=''; } if (params["height"]) { code=' height="'+params["height"]+'"'; objcode+=code; emdcode+=code; params["height"]=''; } if (params["id"] || params["name"]) { objcode+=' id="'+params["id"]+'"'; if (params["name"]) emdcode+=' name="'+params["name"]+'"'; else emdcode+=' name="'+params["id"]+'"'; params["id"]=''; params["name"]=''; } objcode+='>\n'; params["src"]=encodeURI(fsiurl); params["movie"]=encodeURI(fsiurl); for (var pkey in params){ if (params[pkey]){ if (pkey != 'src') objcode+='\n'; if (pkey != 'movie') emdcode+=' '+pkey+'="'+decodeURI(params[pkey])+'"'; } } emdcode+='\/>'; objcode+=emdcode+'\n'; objcode+='<\/object>'; } else if (fallbackimg){ objcode=''; if (imageFallbackLinked) objcode=''+objcode+''; objcode='

'+objcode+'

'; } if (!objcode){ if (textFallbackActive && confirm(textFallbackText)) top.location=flashDownload; } else { document.write(objcode); } } // Run VBScript detection part in old IE pushVBDetection = function(){ var doc = '\n'; doc += 'On Error Resume Next\n'; doc += 'Dim i\n'; doc += 'For i = 30 to 6 Step -1\n'; doc += 'If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then\n'; doc += 'Else\n'; doc += 'fsiFD.flashVersion = i\n'; doc += 'Exit For\n'; doc += 'End If\n'; doc += 'Next\n'; doc += '<\/scr' + 'ipt>\n'; document.write (doc); } } function writeFlashCode(fsiurl, fallbackimg, parameters){ if (fsiFD) fsiFD.writeFlashCode(fsiurl, fallbackimg, parameters); } var fsiFD; if (!fsiFD) { fsiFD = new flashDetector(fsiPresetFlashVersion, fsiImageFallbackLinked, fsiTextFallbackActive, fsiTextFallbackText); fsiFD.init(); } // Copyright 2008 NeptuneLabs GmbH (http://www.neptunelabs.com)