//
function miniCart(){
var prdCount = 0, prdString = "", subTotal = (xmlConfig.cartSubTotal > 0)?xmlConfig.cartSubTotal:0;
	if(xmlOHeader.childNodes.length==0) subTotal = 0;
	for(var i=0;i<xmlOHeader.childNodes.length;i++){
		prdCount = prdCount+(parseInt(xmlOHeader.childNodes[i].QuantityAmount));
		};
	prdString += "Produkte:<strong>&nbsp;" + prdCount + "</strong><br>";
	prdString += "Summe:<strong>&nbsp;" + TFormatCurrency(subTotal, objPriCurrency) + "</strong><br><br>";
	prdString += "<a class=\"WAGRUNAV\" href=\"orderform." + xmlConfig.fileExtension + "\">";
	prdString += "<strong>" + '<img src="assets/images/bullet_standard.gif" width="14" height="14" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">' + "Zum Warenkorb</strong></a>";
	return(prdString);
	};
//
var TNavDropDownIndent = ".."
//
function NavLinkedDropDownList(){
	return(TNavDropDownList(true));
	};
//
function NavDropDownList(){
	return(TNavDropDownList(false));
	};
//
function storeSearchParameters(optionValueArray){
var xmlSearchEngine = xmlConfig.getFirstItem("SearchEngine");
	if(optionValueArray[0]!="null"&&optionValueArray[0]!="nada"){
		xmlSearchEngine.categoryIndex = optionValueArray[0];
		xmlSearchEngine.categoryId = optionValueArray[2];
		xmlSearchEngine.ByCategory = "1";
		}
	else{
		xmlSearchEngine.categoryIndex = "null";
		xmlSearchEngine.categoryId = "null";
		xmlSearchEngine.ByCategory = "0";
		};
	};
//
function TNavDropDownList(asLink){
var rString = "";
var myNavIndex = "";
	if(asLink) myNavIndex = xmlConfig.navIndex;
	else myNavIndex = xmlConfig.getFirstItem("SearchEngine").categoryIndex;
	if(!(myNavIndex=="null"||myNavIndex=="")){ navigation[parseInt(myNavIndex)].active = true; };
	if(asLink) rString += "<select name=\"navselect\" onChange=\"changeLoc(this[this.selectedIndex].value.split(';;')[0],this[this.selectedIndex].value.split(';;')[1])\">"
	else rString += "<select name=\"navselect\" onChange=\"storeSearchParameters(this[this.selectedIndex].value.split(';;'))\">";
	rString += "<option value=\"nada;;start.htm;;null\">Gesamtkatalog</option>";
	for(var i=0; i<navigation.length; i++){
		if(navigation[i].parentId==null){
			rString += TNavDropDownItem(navigation[i], "");
			};
		};
	rString += "</select>";
	return(rString);
	};
//
function TNavDropDownItem(navItem, cptPreFix){
var rString = "";
	rString += "<option value=\"" + navItem.id + ";;" + navItem.linkUrl + ";;" + navItem.categoryId + "\"";
	if(navItem.active) rString += " selected";
	rString += ">" + cptPreFix + navItem.caption + "</option>";
	for(var i=0; i<navigation.length;i++) if(navigation[i].parentId==navItem.id) rString += TNavDropDownItem(navigation[i], cptPreFix + TNavDropDownIndent);
	return(rString);	
	};
//
	function openItem(itemId){
	var objActiveItem = null;
		if(itemId!=null){
			objActiveItem = navigation[itemId];
			if(objActiveItem!=null){
				objActiveItem.open = true;
				openItem(objActiveItem.parentId);
				};
			};
		};
		
	function activateItem(itemId){
	var objActiveItem = null;
		if(itemId!=null){
			objActiveItem = navigation[itemId];
			if(objActiveItem!=null){
				objActiveItem.active = true;
				openItem(objActiveItem.parentId);
				};
			};
		};
		
	function itemHasSubelems(itemId){
		for(var i=0; i<navigation.length;i++) if(navigation[i].parentId==itemId) return(true);
		return(false);
		};
	
	function TNavLinkList(){
	var strHTML = "";
		for(var i=0; i<navigation.length; i++) if(navigation[i].parentId==null) strHTML += printItem(navigation[i], 0);
		return(strHTML);
		};	
		
	function printItem(navItem, depth){
	var strHTML = "";
	var elemWidth = 1;
		strHTML += '<table width="100%" class="CATLINKS1STPARENT" border="0" cellpadding="1" cellspacing="0" >';
		strHTML += "<tr>"
		for(var i=0; i<depth; i++){
			strHTML += "<td";
			if(navItem.active) strHTML += " class=\"ACTIVECATEGORY\""
			else strHTML += " class=\"CATLINKS1STBULLET\"";
			strHTML += ' width="1%"><img src="assets/images/spacer.gif" width="14" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bullet_aktiv.gif" width="14" height="14" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else if(navItem.open&&itemHasSubelems(navItem.id)) strHTML += '<td width="1%" class="CATLINKS1STBULLET"><img src="assets/images/bullet_aufgeklappt.gif" width="14" height="14" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/bullet_normal.gif" width="14" height="14" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		strHTML += "<td";
		if(navItem.active) strHTML += " class=\"ACTIVECATEGORY\""
		else strHTML += " class=\"CATLINKS1STBULLET\"";
		strHTML += "width=\"" + ( 100 - ( depth + 1 ) ) + "%\">"
			+ "<a href=\"" + navItem.linkUrl + "?categoryId=" + escape(navItem.id) + "\" class=\"WAGRUNAV\">"
			+ navItem.caption
			+ "</a>"
			+ "</td>";
		strHTML += "</tr>"
		strHTML += "</table>"
		depth++;
		if(navItem.active||navItem.open){
			for(var i=0; i<navigation.length;i++) if(navigation[i].parentId==navItem.id) strHTML += printItem(navigation[i], depth);
			};
		return(strHTML);
		};


//

// navElem
	function navElem(id,caption,linkUrl,parentId,categoryId){
		this.id = id;
		this.caption = caption;
		this.linkUrl = linkUrl;
		this.parentId = parentId;
		this.active = false;
		this.open = false;
		this.categoryId = categoryId;
		};
// navigation
var navigation = new Array();
//
navigation[0] = new navElem(0,"Beleuchtung","pi462133345.html",null,"3");
navigation[1] = new navElem(1,"Glühlampen (Tageslicht)","pi-675961668.html",0,"71");
navigation[2] = new navElem(2,"Leuchten","pi405066586.html",0,"69");
navigation[3] = new navElem(3,"Leuchtstofflampen (Tageslicht)","pi881858551.html",0,"70");
navigation[4] = new navElem(4,"Zubehör Leuchten","pi1045441346.html",0,"100");
navigation[5] = new navElem(5,"Ferngläser","pi-1831621437.html",null,"42");
navigation[6] = new navElem(6,"KL-Pflegemittel","pi70508500.html",null,"425");
navigation[7] = new navElem(7,"Kategorien","pi1504978844.html",6,"501");
navigation[8] = new navElem(8,"Enzymreiniger/Proteinentferner","pi-1635288712.html",7,"502");
navigation[9] = new navElem(9,"für harte KL","pi691458117.html",7,"426");
navigation[10] = new navElem(10,"für weiche KL","pi-167732702.html",7,"427");
navigation[11] = new navElem(11,"Kochsalzlösungen","pi483516855.html",7,"430");
navigation[12] = new navElem(12,"Kombilösungen","pi-1478404832.html",7,"428");
navigation[13] = new navElem(13,"Nachbenetzung","pi-2077464089.html",7,"500");
navigation[14] = new navElem(14,"Peroxid-Systeme","pi1213382734.html",7,"429");
navigation[15] = new navElem(15,"Marken","pi-1465632372.html",6,"431");
navigation[16] = new navElem(16,"Abbott","pi1054654436.html",15,"436");
navigation[17] = new navElem(17,"Alcon","pi539005305.html",15,"434");
navigation[18] = new navElem(18,"Allergan","pi-810051505.html",15,"435");
navigation[19] = new navElem(19,"Bausch & Lomb","pi-432762091.html",15,"437");
navigation[20] = new navElem(20,"Ciba Vision","pi-811419470.html",15,"438");
navigation[21] = new navElem(21,"CooperVision","pi-469081269.html",15,"439");
navigation[22] = new navElem(22,"Eyecare","pi113825328.html",15,"440");
navigation[23] = new navElem(23,"Hecht","pi1035781745.html",15,"441");
navigation[24] = new navElem(24,"Menicon","pi-1682413602.html",15,"442");
navigation[25] = new navElem(25,"ONS MERK","pi-660571560.html",15,"433");
navigation[26] = new navElem(26,"OPTIMA","pi775665159.html",15,"443");
navigation[27] = new navElem(27,"OPTIMEDICS","pi-678304355.html",15,"432");
navigation[28] = new navElem(28,"Oté Group","pi1690913084.html",15,"444");
navigation[29] = new navElem(29,"Sauflon","pi-1305622643.html",15,"445");
navigation[30] = new navElem(30,"Kontaktlinsen","pi1639792469.html",null,"110");
navigation[31] = new navElem(31,"Kategorien","pi1703100171.html",30,"503");
navigation[32] = new navElem(32,"biokompatible Linsen","pi-1904871696.html",31,"504");
navigation[33] = new navElem(33,"Dreimonatslinsen","pi-694996567.html",31,"407");
navigation[34] = new navElem(34,"Farblinsen","pi344836476.html",31,"403");
navigation[35] = new navElem(35,"Monatslinsen","pi-219032883.html",31,"404");
navigation[36] = new navElem(36,"Multifokallinsen","pi1743166802.html",31,"413");
navigation[37] = new navElem(37,"Silikon-Hydrogele","pi987014757.html",31,"410");
navigation[38] = new navElem(38,"Tageslinsen","pi1780890634.html",31,"405");
navigation[39] = new navElem(39,"Wochenlinsen","pi-1237168666.html",31,"415");
navigation[40] = new navElem(40,"Zwei-Wochen-Linsen","pi-774739640.html",31,"406");
navigation[41] = new navElem(41,"Marken","pi-449389135.html",30,"401");
navigation[42] = new navElem(42,"Bausch & Lomb","pi-184217262.html",41,"408");
navigation[43] = new navElem(43,"Ciba Vision","pi1171228733.html",41,"417");
navigation[44] = new navElem(44,"CL-Tinters","pi1626884310.html",41,"411");
navigation[45] = new navElem(45,"Conta Optik","pi1883552011.html",41,"409");
navigation[46] = new navElem(46,"Cooper Vision","pi73074123.html",41,"412");
navigation[47] = new navElem(47,"Johnson & Johnson","pi-58709676.html",41,"418");
navigation[48] = new navElem(48,"Ons Merk","pi289650379.html",41,"422");
navigation[49] = new navElem(49,"Optimedics","pi1479926497.html",41,"423");
navigation[50] = new navElem(50,"Safilens","pi196439842.html",41,"414");
navigation[51] = new navElem(51,"Sauflon","pi735296694.html",41,"416");
navigation[52] = new navElem(52,"Technolens","pi1451620529.html",41,"421");
navigation[53] = new navElem(53,"Wöhlk","pi54544033.html",41,"420");
navigation[54] = new navElem(54,"Zeiss","pi-727377540.html",41,"419");
navigation[55] = new navElem(55,"Monokulare","pi1851789238.html",null,"44");
navigation[56] = new navElem(56,"Zubehör Monokulare","pi-223038820.html",55,"17");
navigation[57] = new navElem(57,"Operngläser","pi1193601424.html",null,"4");
navigation[58] = new navElem(58,"Sportbrillen","pi964108219.html",null,"1");
navigation[59] = new navElem(59,"adidas","pi1447227656.html",58,"80");
navigation[60] = new navElem(60,"adilibria halfrim","pi-1596967770.html",59,"94");
navigation[61] = new navElem(61,"adilibria sense","pi859778111.html",59,"93");
navigation[62] = new navElem(62,"adivista","pi-567362953.html",59,"89");
navigation[63] = new navElem(63,"adizero","pi-1509154435.html",59,"91");
navigation[64] = new navElem(64,"agilis","pi-1627048946.html",59,"88");
navigation[65] = new navElem(65,"elevation ClimaCool","pi1633066687.html",59,"83");
navigation[66] = new navElem(66,"evil eye","pi-998756102.html",59,"92");
navigation[67] = new navElem(67,"evil eye explorer","pi-376938890.html",59,"82");
navigation[68] = new navElem(68,"evil eye halfrim","pi924387512.html",59,"112");
navigation[69] = new navElem(69,"evil eye halfrim pro","pi1843641566.html",59,"111");
navigation[70] = new navElem(70,"evil eye pro","pi1750175337.html",59,"81");
navigation[71] = new navElem(71,"Supernova pro","pi-1261123262.html",59,"113");
navigation[72] = new navElem(72,"terrex","pi-1803702036.html",59,"90");
navigation[73] = new navElem(73,"terrex pro","pi854462946.html",59,"85");
navigation[74] = new navElem(74,"T-Sight","pi1087967585.html",59,"87");
navigation[75] = new navElem(75,"adidas Ersatzfilter","pi-159947684.html",58,"39");
navigation[76] = new navElem(76,"sziols indoor","pi375860420.html",58,"37");
navigation[77] = new navElem(77,"Vergrößernde Sehhilfen","pi-1473079840.html",null,"2");
navigation[78] = new navElem(78,"elektronische Hilfsmittel","pi-356501251.html",77,"47");
navigation[79] = new navElem(79,"Fernrohrlupenbrillen","pi1983283324.html",77,"67");
navigation[80] = new navElem(80,"Kopflupen","pi-57750402.html",77,"48");
navigation[81] = new navElem(81,"Zubehör Kopflupen","pi1900726230.html",80,"35");
navigation[82] = new navElem(82,"Lupen","pi82352925.html",77,"49");
navigation[83] = new navElem(83,"Aufsetzlupen","pi-29778729.html",82,"50");
navigation[84] = new navElem(84,"Hellfeld-/Visolettlupen","pi41887990.html",83,"20");
navigation[85] = new navElem(85,"Lesestäbe","pi1992856297.html",83,"19");
navigation[86] = new navElem(86,"Becherlupen","pi1492833699.html",82,"51");
navigation[87] = new navElem(87,"daylight-Lupen","pi-759844551.html",82,"33");
navigation[88] = new navElem(88,"Fadenzähler","pi2028331444.html",82,"34");
navigation[89] = new navElem(89,"Fresnel-Lupen","pi1133856811.html",82,"52");
navigation[90] = new navElem(90,"Handarbeitslupen","pi1638556606.html",82,"53");
navigation[91] = new navElem(91,"Handlupen ohne Beleuchtung","pi-1598698023.html",82,"54");
navigation[92] = new navElem(92,"Ergo-Style","pi-1092358716.html",91,"25");
navigation[93] = new navElem(93,"Klemmlupen","pi-1100148832.html",82,"55");
navigation[94] = new navElem(94,"Leuchtlupen","pi1294465633.html",82,"56");
navigation[95] = new navElem(95,"Easy Pocket","pi1407475406.html",94,"29");
navigation[96] = new navElem(96,"Ergo-Lux","pi-1937716550.html",94,"24");
navigation[97] = new navElem(97,"Zubehör Ergo-Base","pi-1021237205.html",96,"26");
navigation[98] = new navElem(98,"Mobilux LED","pi-1958829036.html",94,"122");
navigation[99] = new navElem(99,"Modular Standlupe","pi39003521.html",94,"30");
navigation[100] = new navElem(100,"Modular Zubehör","pi-1215332946.html",99,"31");
navigation[101] = new navElem(101,"Ökolux plus mobil","pi-1330862321.html",94,"21");
navigation[102] = new navElem(102,"Ökolux Standlupe","pi152538216.html",94,"27");
navigation[103] = new navElem(103,"Powerlux","pi-327281646.html",94,"219");
navigation[104] = new navElem(104,"Scribolux","pi-581039694.html",94,"41");
navigation[105] = new navElem(105,"Twinlux","pi-1771890621.html",94,"28");
navigation[106] = new navElem(106,"Messlupen","pi-1717365348.html",82,"57");
navigation[107] = new navElem(107,"Ergänzungsskalen zu Skalenmesslupe #8279","pi772028055.html",106,"40");
navigation[108] = new navElem(108,"Taschenlupen","pi565688884.html",82,"18");
navigation[109] = new navElem(109,"Tischlupen","pi117350914.html",82,"58");
navigation[110] = new navElem(110,"Zubehör Tischlupen","pi-1899138806.html",109,"59");
navigation[111] = new navElem(111,"Uhrmacherlupen / Steinlupen","pi-1580336215.html",82,"60");
navigation[112] = new navElem(112,"Zubehör Lupen","pi-995254774.html",82,"61");
navigation[113] = new navElem(113,"Lupenclip","pi-699122805.html",77,"62");
navigation[114] = new navElem(114,"Mikroskope","pi-857154691.html",77,"63");
navigation[115] = new navElem(115,"Mikroskope Zubehör","pi137889446.html",114,"64");
navigation[116] = new navElem(116,"Vergrößerungsspiegel","pi964740622.html",77,"66");
navigation[117] = new navElem(117,"Wettergeräte","pi-586293355.html",null,"120");
navigation[118] = new navElem(118,"Zubehör","pi-68413391.html",null,"5");
navigation[119] = new navElem(119,"Brillenzubehör","pi1670994325.html",118,"11");
navigation[120] = new navElem(120,"Etuis","pi738938544.html",119,"46");
navigation[121] = new navElem(121,"Fester Sitz","pi-1782232926.html",119,"9");
navigation[122] = new navElem(122,"Ketten, Bänder, Kordeln","pi-1881392087.html",119,"8");
navigation[123] = new navElem(123,"Reinigung","pi2106803708.html",119,"7");
navigation[124] = new navElem(124,"Kontaktlinsenzubehör","pi-748516419.html",118,"45");
navigation[125] = new navElem(125,"Abflußsieb","pi-790741848.html",124,"12");
navigation[126] = new navElem(126,"Kontaktlinsenbehälter","pi1500451606.html",124,"14");
navigation[127] = new navElem(127,"Kontaktlinsensauger","pi1133484425.html",124,"13");
navigation[128] = new navElem(128,"Pinzetten","pi26745688.html",124,"16");
navigation[129] = new navElem(129,"Lesepulte","pi735950457.html",118,"43");
navigation[130] = new navElem(130,"Vergrößerungsspiegel","pi1529618143.html",118,"15");

// getNavElementByCatID
function getNavElementByCatID(categoryId){
	for(var i=0; i<navigation.length; i++){
		if(navigation[i].categoryId==categoryId){
			return(navigation[i]);
			break;
			};
		};
		return(null);
	};
// changeLoc
function changeLoc(id,linkUrl){
	if(id!="nada"){
		xmlConfig.navIndex = id.toString();
		if(xmlConfig.getFirstItem("SearchEngine").ByCategory == "1"){
			if(id=="null") xmlConfig.getFirstItem("SearchEngine").categoryId = "null"
			else xmlConfig.getFirstItem("SearchEngine").categoryId = navigation[id].categoryId;
			xmlConfig.getFirstItem("SearchEngine").categoryIndex = id;
			}
		else{
			xmlConfig.getFirstItem("SearchEngine").categoryId = "null";
			xmlConfig.getFirstItem("SearchEngine").categoryIndex = "null";
			};
		safeData();
		location.href = linkUrl + "?categoryId=" + id.toString();
		};
	};
// searchOnEnterNavi
function searchOnEnterNavi(){
	if(window.event.keyCode==13){
		xmlConfig.getFirstItem('SearchEngine').term=document.searchEngine.searchTerm.value;
		location.href = "search.html";
		};
	};
// activates entries for categories
activateItem(getParameterFromURL("categoryId"));


