var Root = new Object();
var nodeIndex = new Object();
var level1 = new Array('_active.gif', '.gif','tc1',        'tc1',    '',      '', 5);
var level2 = new Array('images/square_arrow.gif','images/square_w_open.gif', 'tc2','tc2', 'navigation_active','navigation', 20,'images/square_w_closed.gif');
var level3 = new Array('images/square_d_closed.gif','images/square_d_open.gif', 'tc3','tc3', 'subnav_active','navigation',32,'images/square_d_closed.gif');
var level4 = new Array('images/square_3_closed.gif','images/square_3_open.gif', 'tc1','tc1', 'subnav_active','navigation',40,'images/square_3_closed.gif');
var navProperties = new Array(level1, level2, level3, level4);
function navObj(_title, _id,_type, _url, _parent, _bChildNodes, _gifPre){
	     this.title    = 	_title;
	        this.id    = 	_id;
	      this.type    = 	_type;
	       this.url    = 	_url;
	this.childNodes    = 	new Object();
	this.parentNode    =   _parent;
 this.hasChildNodes    =   _bChildNodes;
 	   this.gifPrefix  =   _gifPre;
}

var hu= new Array();hu[hu.length]= new Array('&Eacute;letrajz','zilahy7.html');hu[hu.length]= new Array('&Iacute;r&aacute;sok','zilahy8.html');hu[hu.length]= new Array('CD-ROM','azs.html');hu[hu.length]= new Array('Ki&aacute;ll&iacute;t&aacute;s','zilahy12.html');hu[hu.length]= new Array('Sajt&oacute;','zilahy95.html');hu[hu.length]= new Array('F&eacute;nyk&eacute;pek','zilahy11.html');

function fnInArray(sSearchItem, arArray){var i;	if (sSearchItem != '' && arArray){for( i = 0; i < arArray.length; i++ ){if ( sSearchItem.toLowerCase() == arArray[ i ].toLowerCase() ) {return true;};};};return false;}
var arArray = new Array();var locStr = new String(document.location);var pageID = locStr.slice(locStr.lastIndexOf('/') +1, locStr.length);pageID = (pageID.indexOf('?') > 0 ) ? pageID.slice(0, pageID.lastIndexOf('?')) : pageID;
if (pageID != ''){setUrlStr(Root,pageID,pageID);}function setUrlStr(sN, pageID, str){var newString ='';for(var i in sN){if (sN[i].url == pageID){arArray = str.split(',');}else{newString = str + ','+sN[i].url;	if(sN[i].hasChildNodes){setUrlStr(sN[i].childNodes, pageID, newString);	};};};}
function buildCustomTree(objNodes,iElement, sLeftIndent){
	var oNode,display,imageActive,returnValue, kleur, useClass;
	var bHasChildren = false;
	var imageOver;
	returnValue = '';
	iElement++;
	var activeProps =( navProperties[	iElement ])? navProperties[ iElement ] : navProperties[ ( navProperties.length - 1 ) ];
	for(var oNode in objNodes){
		if(!fnInArray(objNodes[oNode].url, arArray)){
			display = 'none;';imageActive = activeProps[1];	kleur = activeProps[3];	useClass = activeProps[5];imageOver = activeProps[7];
		}else{
			display = '';imageOver = activeProps[0];imageActive = activeProps[0];kleur = activeProps[2];useClass = activeProps[4];	
		}
		returnValue += 	'<TABLE class="'+kleur+'" width="167" cellpadding="0" cellspacing="0" border="0"><TR><TD width="'+sLeftIndent+'" valign="top" align="left"><IMG src="images/empty.gif" width="'+sLeftIndent+'" height="1" border="0"></TD><TD  valign="top"><table cellpadding="0" cellspacing="0" border="0"><tr><td valign="top" align="left" width="1%" background=""><img src="'+imageActive+'" border="0" name="square_'+objNodes[oNode].id+'"></td><td width="99%" valign="top" align="left" background=""><a href="'+objNodes[oNode].url+'" class="'+useClass+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'square_'+objNodes[oNode].id+'\',\'\',\''+imageOver+'\',1)">'+objNodes[oNode].title+'</a></td></tr></TABLE></TD></TR></TABLE>';		
		if( display == ''){
			if( objNodes[oNode].hasChildNodes ){
				var	kleur2 = (navProperties[	iElement +1 ])?navProperties[	iElement +1 ][3] :navProperties[iElement][3];
				returnValue += '<TABLE class="'+kleur+'" height="3"  width="167" cellpadding="0" cellspacing="0" border="0"><TR><td><IMG src="images/empty.gif" width="167" height="3" border="0"></TD></TR></table><TABLE class="'+kleur2+'" width="167" height="3" cellpadding="0" cellspacing="0" border="0"><TR><td><IMG src="images/empty.gif" width="167" height="3" border="0"></TD></TR></table>' +  buildCustomTree(objNodes[ oNode ].childNodes,iElement, activeProps[6])+'<TABLE class="'+kleur2+'" height="3"  width="167" cellpadding="0" cellspacing="0" border="0"><TR><td><IMG src="images/empty.gif" width="167" height="3" border="0"></TD></TR></table><TABLE class="'+kleur+'" height="3"  width="167" cellpadding="0" cellspacing="0" border="0"><TR><td><IMG src="images/empty.gif" width="167" height="3" border="0"></TD></TR></table>';
			}
		}
	}
	return returnValue;
}
var mainGif = '';
function writeNavigation(){
	var contentTxt
	contentTxt = '';
	var display = '';
	for(var oNode in Root){
		if ( fnInArray(Root[oNode].url, arArray)  ){	
			mainGif = Root[oNode].gifPrefix;
			contentTxt 	+= '<TABLE class="tc1" width="167" cellpadding="0" cellspacing="0" border="0"><TR><TD><A href="'+Root[oNode].url+'"><IMG src="images/nav_'+ Root[oNode].gifPrefix + navProperties[0][0] +'" width="167" height="14" border="0" alt="'+ Root[oNode].title +'" name="'+Root[oNode].gifPrefix+'"></A></TD></TR></TABLE>';
			if(Root[oNode].hasChildNodes){
				contentTxt += '<TABLE class="'+navProperties[1][3]+'" height="3"  width="167" cellpadding="0" cellspacing="0" border="0"><TR><td><IMG src="images/empty.gif" width="167" height="3" border="0"></TD></TR></table>'+ buildCustomTree(Root[oNode].childNodes,0,navProperties[0][6])+ '<TABLE class="'+navProperties[1][3]+'" height="3"  width="167" cellpadding="0" cellspacing="0" border="0"><TR><td><IMG src="images/empty.gif" width="167" height="3" border="0"></TD></TR></table>';
			}
		}else{	
			contentTxt 	+= '<TABLE class="tc1" width="167" cellpadding="0" cellspacing="0" border="0"><TR><TD><A href="'+Root[oNode].url+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\''+Root[oNode].gifPrefix+'\',\'\',\'images/nav_'+Root[oNode].gifPrefix+'_active.gif\',1)"><IMG src="images/nav_'+Root[oNode].gifPrefix+'.gif" width="167" height="14" border="0" alt="" name="'+Root[oNode].gifPrefix+'"></A></TD></TR></TABLE>';
		}
	}		
	document.write(contentTxt);
}
writeNavigation();

