

			findSlash = window.location.pathname.lastIndexOf('/');
			
			if (findSlash == 0) findSlash = window.location.pathname.lastIndexOf('\\'); 
			
			findDot = window.location.pathname.lastIndexOf('.');
			
			if (window.location.protocol == "file:")
			   thisSite=window.location.pathname.substring((findSlash+1),findDot);
			else
			   thisSite=window.location.pathname.substring((findSlash+1),findDot);
			
			thisSiteName="";
			
			   			
// ***************************************************************************

if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}


var opaInc = 0;
var opacity = 100;

// WELCOME IMAGE :
// ************************************************************************************************




function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function welcomeOn()
{
				opaInc =-25;				
}
function welcomeOut()
{
				opaInc =10;
}

function welcomeDyna()

{
 		 opacity += opaInc;

		 if (opacity > 99) opacity = 99; 
		 if (opacity < 0) opacity = 0;
		 
		 if (opaInc != 0) changeOpac (opacity, "welcomeImg");

		 if ((opacity == 99) || (opacity == 0)) opaInc = 0;  
		 
		 setTimeout ("welcomeDyna()", 60);
}


// INDEX & MENU :
// ************************************************************************************************



function writeIndex(branch,level,deep,surf)
{
 		 var size = branch.length;
 		 var x=0;
		 for (x=0; x<=size; x++)
		 {
		   		 if ((typeof branch[x]) == "string")
		   		 {
		   	  		   
					   if ((level<=deep) || (deep==undefined))
					   if ((level>=surf) || (surf==undefined))
					   {
					   	  document.write("<div class='menuLeave' style='padding-left: "+((level-surf)*8+3)+"px;' onmouseover='this.className=&#34;menuSpot&#34;' onmouseout='this.className=&#34;menuLeave&#34;'><a class='menuHref' href='http://itu-itc.elka.pw.edu.pl/"+(branch[x])+".html'>");
					   	  if (level==surf) document.write("<span style='font-weight: bold'>");					   
					   	  document.write(branch[x+1]);
					   	  if (level==surf) document.write("</span>");
					   	  document.write("<br></a></div>"); 
					   }
					   x++;
		   		 }   
		   		 if ((typeof branch[x]) == "object") writeIndex(branch[x], level+1, deep, surf); 
		 }
}	

function writeIndexArea(branch,area,deep,surf)
{
 		 var size = branch.length;
 		 var x=0;
		 
		 for (x=0; x<=size; x++)
		 {
		   		 if ((typeof branch[x]) == "string")
		   		 {
				  	   if (branch[x]==area) writeIndex(branch,0,deep,surf);
					   x++;
		   		 }   
		   		 if ((typeof branch[x]) == "object") writeIndexArea(branch[x],area,deep,surf); 
		 }
}	

//	

var showingMenu=false;

function createMenu(branch,item,xp,yp,wp)
{
	document.write("<div id='menu_"+item+"' style='filter:alpha(opacity=94); opacity: 0.94; MozOpacity: 0.94; KhtmlOpacity: 94; zIndex: 200; z-index:200; position: absolute; left:"+xp+"px; top: "+yp+"px; width: "+wp+"px; visibility: hidden'>");
	writeIndexArea(branch,item,2,1);
	document.write("</div>");
	
 	obj=document.getElementById("menu_"+item);
}	

//createMenu(files,"szkolenia",320,93,500);
//createMenu(files,"inneuslugi",398,93,250);


function showMenu(branch)
{

 	showingMenu=true;	
 	obj=document.getElementById("menu_"+branch);
	obj.style.visibility="visible";
	
	setTimeout("hideMenu('"+branch+"')", 250);
}

function hideMenu(branch)
{
 	showingMenu=false;

 	obj=document.getElementById("menu_"+branch);
	var objTop = obj.offsetTop;
	var objLeft = obj.offsetLeft;
	var objWidth = obj.offsetWidth;
	var objHeight = obj.offsetHeight;
	
	tab=document.getElementById("imgHead_"+branch);
	var tabTop = tab.offsetTop;
	var tabLeft = tab.offsetLeft;
	var tabWidth = tab.offsetWidth;
	var tabHeight = tab.offsetHeight;

		
	if (((yMousePos < objTop-70) || (yMousePos > (objTop+objHeight)) || (xMousePos < objLeft) || (xMousePos > (objLeft+objWidth))) ||
	   ((xMousePos>tabLeft+tabWidth) && (yMousePos<90)) )
	{

	  obj.style.visibility="hidden";
	 	
	  if (branch=="szkolenia")
		if (document.all) imgHead_szkolenia.src=headImageSzkolenia.src;
		else document.imgHead_szkolenia.src=headImageSzkolenia.src;

	  if (branch=="inneuslugi")
		if (document.all) imgHead_inneuslugi.src=headImageInneuslugi.src;
		else document.imgHead_inneuslugi.src=headImageInneuslugi.src;

	}
	else
	{   
	    showingMenu=true;
		setTimeout("hideMenu('"+branch+"')", 250);
	}  
}

function findSiteName(branch,what)
{
 		 var size = branch.length;
 		 var x=0;
		 for (x=0; x<=size; x++)
		 {
		   		 if ((typeof branch[x]) == "string")
		   		 {
		   	  		   if (branch[x] == what) thisSiteName = branch[x+1];
					   
					   x++;
		   		 }   
		   		 if ((typeof branch[x]) == "object") findSiteName(branch[x],what); 
		 }
}	

function writeSiteName ()
{
 		 //findSiteName(files, cat);
 		 document.write (""+
		 
		 "<table class='subHeadTable' width='500' border='0' cellpadding='0' cellspacing='0'><tr>"+
		 "<td><!--a href='"+cat+".html'>"+ thisSiteName +"</a><br-->");

 		 findSiteName (files, thisSite);
 		 if (thisSite!="kontakt")
		 	document.write (thisSiteName + "</td><td nowrap valign='bottom'><div style='padding: 0px' align='right'>|&nbsp; <a href='kontakt.html'>Kontakt&nbsp;&raquo;</a></div></td></tr></table>");
 		 else
		 	document.write (thisSiteName + "</td><td nowrap valign='bottom'><div style='padding: 0px' align='right'>|&nbsp; <a href='mailto:itu-itc@elka.pw.edu.pl'>E-mail: itu-itc@elka.pw.edu.pl</a></div></td></tr></table>");

			
		 document.title="ITU-ITC@WUT - " + thisSiteName;
}