// JavaScript Document

// detekcia flashu

// ---------------
// FLASH DETECTION
// ---------------

var requiredVersion = 5;

var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var maxVersion = 6;
var actualVersion = 0;
var hasRightVersion = false;
var jsVersion = 1.0;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

jsVersion = 1.1;

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');
}

function detectFlash(){	

	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"]|| navigator.plugins["Shockwave Flash"])
		{
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));

			flash2Installed = flashVersion == 2;		
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
		}
	}
	
	for (var i = 2; i <= maxVersion; i++) {	
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}

	if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;	

	if (actualVersion >= requiredVersion)
		hasRightVersion = true;
	else
		hasRightVersion = false;
		
	return hasRightVersion;
}


// priradim hodnotu
var isFLASH = detectFlash();



function put_flash_onas()
{
	if (isFLASH)
	{
		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/01.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/01.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{				
		document.write("<img src=\"Img/subtitle_o_nas.jpg\" width=\"508\" height=\"118\">");
    }
}

function put_flash_pas()
{
	if (isFLASH)
	{

		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/02.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/02.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{		
		document.write("<img src=\"Img/subtitle_programy_a_sluzby.jpg\" width=\"508\" height=\"118\">");
    }
}

function put_flash_fs()
{
	if (isFLASH)
	{

		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/03.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/03.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{
		document.write("<img src=\"Img/subtitle_financne.jpg\" width=\"508\" height=\"118\">");
    }
}

function put_flash_fondyeu()
{
	if (isFLASH)
	{

		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/04.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/04.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{
		document.write("<img src=\"Img/subtitle_fondy.jpg\" width=\"508\" height=\"118\">");
    }
}

function put_flash_ppu()
{
	if (isFLASH)
	{

		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/05.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/05.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{
		document.write("<img src=\"Img/subtitle_podmienky.jpg\" width=\"508\" height=\"118\">");
    }
}

function put_flash_faz()
{
	if (isFLASH)
	{

		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/06.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/06.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{
		document.write("<img src=\"Img/subtitle_tlaciva.jpg\" width=\"508\" height=\"118\">");
    }
}

function put_flash_sp()
{
	if (isFLASH)
	{

		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/07.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/07.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{
		document.write("<img src=\"Img/subtitle_sadzobnik.jpg\" width=\"508\" height=\"118\">");
    }
}

function put_flash_partneri()
{
	if (isFLASH)
	{

		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/08.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/08.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{
		document.write("<img src=\"Img/subtitle_partneri.jpg\" width=\"508\" height=\"118\">");
    }
}

function put_flash_tc()
{
	if (isFLASH)
	{

		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/09.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/09.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{
		document.write("<img src=\"Img/subtitle_tlacove.jpg\" width=\"508\" height=\"118\">");
    }
}

function put_flash_kap()
{
	if (isFLASH)
	{

		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=\"508\" height=\"118\">");
		document.write("<param name=\"movie\" value=\"Img/10.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#000000\">");
		document.write("<embed src=\"Img/10.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"508\" height=\"118\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
		document.write("</object>");
	}
	else
	{
		document.write("<img src=\"Img/subtitle_kontakt.jpg\" width=\"508\" height=\"118\">");
    }
}

function image(cislo,idecko){
	if(cislo==2){		
		document.all.img4.style.display = "none";
		document.all.img3.style.display = "none";
		document.all.img1.style.display = "none";			
		document.all.img2.style.display = "block";}
	else if(cislo==3){		
		document.all.img4.style.display = "none";
		document.all.img2.style.display = "none";
		document.all.img1.style.display = "none";			
		document.all.img3.style.display = "block";}
	else if(cislo==4){		
		document.all.img3.style.display = "none";
		document.all.img2.style.display = "none";
		document.all.img1.style.display = "none";			
		document.all.img4.style.display = "block";}
	else {		
		document.all.img4.style.display = "none";
		document.all.img3.style.display = "none";
		document.all.img2.style.display = "none";			
		document.all.img1.style.display = "block";}
}

// vypisuje dnesny datum
function myDate()
{
	myArray = new Array("january", "february", "march", "april", "may", "june", "july", "august", "september", "oktober", "november", "december")

	today = new Date();

	with (today)
	{
		myDay = getDate();
		myMonth = myArray[getMonth()];
		myYear = getFullYear();
	}

	document.write(myDay + ". " + myMonth + " " + myYear);
}

function popUp(id){
	//alert("kuk");
	window.open("Default.aspx?CatID="+id,null,"height=500,width=600,status=no,toolbar=no,menubar=no,location=no,scrollbars=1");
}

function goOblast(obj){
		if (obj.value != "") window.location="Default.aspx?CatID="+obj.value;
}
