var requiredVersion = 6;			// player version the user needs to view the site: <2..5>
var useRedirect = false	// "true" loads flash or non-flash page into browser
							// "false" embeds movie or alternate html code into current page

// set next three vars if useRedirect is true
var flashPage = "lang.html"		// the location of the flash movie page
var noFlashPage = "no_flash.html"	// send user here if they don't have the plugin or we can't detect it
var upgradePage = "upgrade.html"	// send user here if we detect an old plugin

// system globals
var flash2Installed = false;		// true if flash 2 is installed
var flash3Installed = false;		// true if flash 3 is installed
var flash4Installed = false;		// true if flash 4 is installed
var flash5Installed = false;		// true if flash 5 is installed
var flash6Installed = false;		// true if flash 6 is installed

var maxVersion = 6;			// highest version we can actually detect
var actualVersion = 0;			// version the user really has
var hasRightVersion = false;		// true if it's safe to embed the flash movie in the page
var jsVersion = 1.0;			// the version of javascript supported


// check ie and win platform
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		// true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;	// true if we're on windows

// javascript 1.1 is supported.
jsVersion = 1.1;

// build in vbscript detection
if (isIE && isWin)
{
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n'); 
	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n'); 
	document.write('</SCR' + 'IPT\> \n');
}
// -->

// standard navigator.plugins array detection
function detectFlash()
{	
	
	// loop through all the versions, set actualVersion to highest detected version
	for (var i = 2; i <= maxVersion; i++) 
	{	
		if (eval("flash" + i + "Installed") == true) 
			actualVersion = i;
	}

	// webtv -> version supported is 2
	if(navigator.userAgent.indexOf("WebTV") != -1)
		actualVersion = 2;	
	
	// uncomment next line to display flash version during testing
	//alert("flash version detected: " + actualVersion);

	if (actualVersion >= requiredVersion) 	
	{
		hasRightVersion = true;
	} 


	if (hasRightVersion != true)
	{
		if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) {
			plugin = navigator.mimeTypes["application/x-shockwave-flash"];
			hasRightVersion = true;
		}
	}
	
	
}

	// call detector
// -->


function komunikat()
{

	if (!hasRightVersion)
	{
		document.write("<CENTER>");
		document.write("<BR/>");
		if (actualVersion > 0) 	
		{
			document.write("Wykryto plug-in Macromedia Flash Player w wersji "+actualVersion);
			document.write("<BR/>");
		}
		document.write("Do korzystania z serwisu wymagany jest plug-in Macromedia Flash Player w wersji "+requiredVersion);
		document.write("<BR/>");

		document.write("<A href='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>Pobierz Macromedia Flash Player</A>");
		document.write("</CENTER>");
	}
	
}

function sanLogo()
{
	if (hasRightVersion)
	{	
		document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='213' height='82'>");
		document.write("<PARAM name=movie value='SAN_flash/logoanim.swf'>");
		document.write("<PARAM name=quality value=high>");
		document.write("<EMBED src='SAN_flash/logoanim.swf' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='213' height='82'>");
		document.write("</EMBED>");
		document.write("</OBJECT>	");
	} else {
		document.write("<td width='213' valign='top' rowspan='2'><a href='index.html' TARGET='_parent'><img src='SAN_images/PKI_MenuFrame/logo.jpg' width='213' height='82'border='0'></a></td>");
	}
}