// browser detection

var myBrowser = "unknown";
var browser = navigator.appVersion.toLowerCase() + navigator.userAgent.toLowerCase();

//alert(browser);


if (browser.indexOf("msie 6") > -1)
{
	myBrowser = "ie6";
}

if (browser.indexOf("msie 7") > -1)
{
	myBrowser = "ie7";
}

if ( browser.indexOf("msie 5") > -1 ) 
{
	myBrowser = "ie5";
}

if ( browser.indexOf("msie 4") > -1)
{
	myBrowser = "ie4";
}

if (browser.indexOf("netscape6") > -1)
{
	myBrowser = "nn6";
}

if (browser.indexOf("netscape/7") > -1)
{
	myBrowser = "nn7";
}

if (browser.indexOf("4.7") > -1)
{
	myBrowser = "nn4.7";
}

if (browser.indexOf("opera 7") > -1)
{
	myBrowser = "op7";
}

if (browser.indexOf("opera 6") > -1 && browser.indexOf("msie 5") > -1)
{
	myBrowser = "op6";
}

// menu
var agent = navigator.userAgent.toLowerCase();
var ver_major = parseInt(navigator.appVersion);
var ver_minor = parseFloat(navigator.appVersion);

var ver_opera = (agent.indexOf('opera') != -1);

var ver_nav = ((agent.indexOf('mozilla') != -1) && (agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)); 
var ver_nav4 = (ver_nav && (ver_major == 4));
var ver_nav5 = (agent.indexOf('gecko') != -1);

var ver_ie = (agent.indexOf('msie') != -1);
var ver_ie4 = (ver_ie  && (ver_major == 4));
var ver_ie5up = (ver_ie  && (ver_major > 4));

imgsrc = new Array();
imgsrc[1] = "Img/top_menu_01_off.gif";
imgsrc[2] = "Img/top_menu_01_on.gif";
imgsrc[3] = "Img/top_menu_09_off.gif";
imgsrc[4] = "Img/top_menu_09_on.gif";
imgsrc[5] = "Img/top_menu_10_off.gif";
imgsrc[6] = "Img/top_menu_10_on.gif";


if (zistiVerziu()) {
  img = new Array();
  for (i = 0; i < imgsrc.length; i++) {
    img[i] = new Image();
    img[i].src = imgsrc[i];
  }
}


function zistiVerziu() {
	appname= navigator.appName;
	appversion = navigator.appVersion;
	majorver = appversion.substring(0, 1); 
	if ( (appname == "Netscape") && ( majorver > 3 ) ) return 1;
	if ( (appname == "Microsoft Internet Explorer") && (majorver >= 4) ) return 1;
	if ( (appname == "Opera") && (majorver >= 6) ) return 1;	
	return 0;

}

function vymen(num, imgname) {
	if (zistiVerziu()) {
	document[imgname].src = img[num].src;
	}
}

function zobrazStatus(txt) {
	status=txt;
}


function generujAll(mySrc,sirka,vyska)
{
  okno=window.open("","okno","left=100,top=100,width="+ sirka +",height="+ vyska +",menubar=no,directories=no,"+"toolbar=no,location=no,status=no,scrollbars=no,resizable=no");
  okno.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
  okno.document.write("<html>\n");
  okno.document.write("<head>\n");
  okno.document.write("<title>LIFELINE</title>\n");
  okno.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1250\">\n");
  okno.document.write("<meta name=\"description\" content=\"\">\n");
  okno.document.write("<meta name=\"keywords\" content=\"\">\n");
  okno.document.write("<meta name=\"robots\" content=\"all\">\n");
  okno.document.write("<meta name=\"revisit-after\" content=\"10 days\">\n");
  okno.document.write("<meta name=\"classification\" content=\"\">\n");
  okno.document.write("<meta name=\"author\" content=\"(c) 1998 - 2004 Millennium 000 spol. s r. o. , URL: http://www.millennium000.sk\">\n");
  okno.document.write("<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n");
  okno.document.write("<a href=\"javascript:;\" onClick=\"window.close()\" title=\"Zavrie\"><img src=" + mySrc + "  width="+ sirka +" height="+ vyska +" border=\"0\"></a>\n");
  okno.document.write("</body>\n</html>\n");
}

// 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();

http://localhost/LifeLine/Default.aspx#

function put_flash_lifeline()
{
	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=\"770\" height=\"392\">");
		document.write("<param name=\"movie\" value=\"Img/lifeline.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=\"bgcolor\" value=\"#FFFFFF\">");
		document.write("<param name=\"wmode\" value=\"transparent\">");
		document.write("<embed src=\"Img/lifeline.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"770\" height=\"392\" 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/flash_title.jpg\" width=\"770\" height=\"392\">");
    }
}


function popUp(id)
{
	window.open("Default.aspx?CatID="+id,null,"top=200,left=200,height=300,width=450,status=no,toolbar=no,menubar=no,location=no,scrollbars=0");
}

function popUp_SendTip(id, link)
{		
	window.open("Default.aspx?CatID="+id + "&Link=" + link,null,"top=200,left=200,height=400,width=450,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,resizable=0");
}

function popupimg()
{
	window.open("popupimg.htm", "popupimg","top=200,left=200,height=335,width=372,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,resizable=1");
}

function pomocka()
{
	window.open("pomocka.htm", "pomocka","top=200,left=200,height=300,width=450,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,resizable=1");
}

function openWin( path )
{
	window.open( "Default.aspx?" + path, 'ProductDetail', 'height=425,width=550,status=0,toolbar=0,menubar=0,location=0,scrollbars=0');
}
