
//Poczatek Tree Menu
var menuids=["treemenu1"] // id(s) of menus, separated by commas

function buildsubmenus_horizontal(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.visibility="visible"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)
//Koniec Tree Menu

//Poczatek Menu podswietlanego
   function Who(){
      document.getElementById("Strona").style.backgroundColor="#0060ae";
      document.getElementById("Strona").style.color="#ffffff";
     
      }
      function Careers(){
      document.getElementById("Firma").style.backgroundColor="#0060ae";
      document.getElementById("Firma").style.color="#ffffff";
      
      }
      function Investors()
      {
       document.getElementById("Oferta").style.backgroundColor="#0060ae";
       document.getElementById("Oferta").style.color="#ffffff";
      
      }
      function Corporate()
      {
       document.getElementById("Tech").style.backgroundColor="#0060ae";
       document.getElementById("Tech").style.color="#ffffff";
      
      }
      function News()
      {
       document.getElementById("News").style.backgroundColor="#0060ae";
       document.getElementById("News").style.color="#ffffff";
      
      }
//Koniec Menu podswietlanego

//Nowe okno w fixowanych Wielkosci
function OpenWindow(url)
{
    var params;
    
    if (arguments.length > 1)
        params = arguments[1];
    else
        params = 'scrollbars=yes,resizable=yes,width=640,height=480'
    
    var win = window.open(url,'NewWin',params);
}
//Koniec Nowego okna w fixowanych Wielkosci


function ShowHide (TargetDiv)
{
    //first, check to see if this browser supports modern DHTML
    if (document.getElementById)
    {
        //now, grab a reference to the target div
        var obj = document.getElementById(TargetDiv)
        //check the current status of this target div
        if ( obj.style.display == 'none' ) //if it's hidden,...
        { 
            obj.style.display = 'inline';  //... then show it.
        } else {
            obj.style.display = 'none';    //... otherwise, hide it.
        }
    }
}

function BlankOutSearchBox(objSearchText, strTextToClear)
{
    if (objSearchText.value == strTextToClear)
    {
        objSearchText.value = '';
    }
}

/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/ 

var w=1
var h=1

if (document.getElementById || document.all)
document.write('<div id="trailimageid" style="position:absolute;visibility:hidden;left:0px;top:-1000px;width:1px;height:1px;border:1px solid #888888;background:#DDDDDD;"><img id="ttimg" src="img/s.gif" /></div>')

function gettrailobj()
{
	if (document.getElementById) return document.getElementById("trailimageid").style
	else if (document.all) return document.all.trailimagid.style
}

function truebody()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail()
{
	document.onmousemove=""
	document.getElementById('ttimg').src='/img/s.gif'
	gettrailobj().visibility="hidden"
	gettrailobj().left=-1000
	gettrailobj().top=0
}


function showtrail(width,height,file)
{
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
	{
		w=width
		h=height
		
		// followmouse()
	
		document.getElementById('ttimg').src=file
		document.onmousemove=followmouse
		gettrailobj().visibility="visible"
		gettrailobj().width=w+"px"
		gettrailobj().height=h+"px"
		gettrailobj().z-index="-5"
	        gettrailobj().z_index="-5"


	}
}


function followmouse(e)
{

	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
	{

		var xcoord=20
		var ycoord=20

		if (typeof e != "undefined")
		{
			xcoord+=e.pageX
			ycoord+=e.pageY
		}
		else if (typeof window.event !="undefined")
		{
			xcoord+=truebody().scrollLeft+event.clientX
			ycoord+=truebody().scrollTop+event.clientY
		}

		var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
		var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

		if (xcoord+w+3>docwidth)
		xcoord=xcoord-w-(20*2)

		if (ycoord-truebody().scrollTop+h>truebody().clientHeight)
		ycoord=ycoord-h-20;

		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"

	}

}
