var agt=navigator.userAgent.toLowerCase();
var ns4 = (document.layers)? true:false;				//Detect Browsers DTW 27/03/2004
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var n6 = (document.getElementById && !document.all) ? true : false;
var is_mac = (agt.indexOf("mac")!=-1);


//Flash detection routines DTW 27/03/2004
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var verNo=0;
var flashInstalled = false;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

if(isIE && isWin){ 
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \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('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('</SCR' + 'IPT\> \n');
}





var currentMenu = null;

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;

    //if (window.opera) return; // I'm too tired

    actuator.onmouseover = function() {
        //if (currentMenu) {
            //currentMenu.style.visibility = "hidden";
            this.showMenu();
        //}
    }
  
  
      actuator.onmouseout = function() {
		 currentMenu.style.visibility = "hidden";
    }
    
    
    actuator.onclick = function() {
        //if (currentMenu == null) {
            //this.showMenu();
        //}
        //else {
            //currentMenu.style.visibility = "hidden";
           // currentMenu = null;
       // }

        return false;
    }

    actuator.showMenu = function() {
    if(isIE){
        menu.style.left = this.offsetLeft + 102 + "px";
        menu.style.top = this.offsetTop +  98 +  this.offsetHeight + "px";
        }
        else
        {
        //menu.style.left = (this.offsetLeft-20)  + "px";
        menu.style.top = this.offsetTop  + this.offsetHeight + 2 +  "px";
        }
        menu.style.visibility = "visible";
        currentMenu = menu;
    }
}






// menu code
//--><![CDATA[//><!--

sfHover = function() {
	var sfEls = document.getElementById("linki").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>

sfHover = function() {
var BUA = navigator.userAgent;
var BIE = BUA.indexOf("MSIE");
var BIsIE = BIE>=0;

var sfEls = document.getElementById("linki").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {this.className+=" sfhover";}
sfEls[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" sfhover\\b"), "");}

//all is normal till here. If we're using IE then this tells any first level item to have a width of 1px
if (sfEls[i].parentNode == document.getElementById("linki") && BIsIE) {
sfEls[i].style.width = '1px';
}
}
}



/**  IE JavaScript  - przyklej**/
ieHover = function() {
var ieULs = document.getElementById('linki').getElementsByTagName('ul');

/** IE script to change class on mouseover **/

	var ieLIs = document.getElementById('linki').getElementsByTagName('li');
	for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
		ieLIs[i].onmouseover=function() {this.className+=" iehover";}
		ieLIs[i].onmouseout=function() {this.className=this.className.replace(' iehover', '');}
	}}
if (window.attachEvent) window.attachEvent('onload', ieHover);
/** end **/

