//
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 += "Artikel:<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.gif" width="15" height="11" 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/bulletcatact.gif" width="14" height="11" 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/bulletcat1stcls.gif" width="14" height="11" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/bulletcat1st.gif" width="14" height="11" 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,"Autokohlen","pi1116435172.htm",null,"1");
navigation[1] = new navElem(1,"Lichtmaschinen","pi1116762645.htm",0,"11");
navigation[2] = new navElem(2,"Auto-Lite","pi1242824457.htm",1,"1101");
navigation[3] = new navElem(3,"Bosch","pi1374022294.htm",1,"1102");
navigation[4] = new navElem(4,"Chrysler","pi2122162178.htm",1,"1106");
navigation[5] = new navElem(5,"Delco - Remy","pi-1873351589.htm",1,"1107");
navigation[6] = new navElem(6,"Denso","pi123817472.htm",1,"1108");
navigation[7] = new navElem(7,"Ducellier","pi942585345.htm",1,"1109");
navigation[8] = new navElem(8,"Femsa","pi684154380.htm",1,"1111");
navigation[9] = new navElem(9,"Fiat","pi-1869983715.htm",1,"1112");
navigation[10] = new navElem(10,"Ford","pi-494263526.htm",1,"1113");
navigation[11] = new navElem(11,"Hitachi","pi-1303279725.htm",1,"1114");
navigation[12] = new navElem(12,"Iskra","pi-572332328.htm",1,"1115");
navigation[13] = new navElem(13,"Lucas","pi681045711.htm",1,"1118");
navigation[14] = new navElem(14,"Magneti Marelli","pi-1945963420.htm",1,"1119");
navigation[15] = new navElem(15,"Magneton PAL","pi1763102101.htm",1,"1120");
navigation[16] = new navElem(16,"Mando Melroe","pi838205746.htm",1,"1121");
navigation[17] = new navElem(17,"Mitsubishi","pi-1210101072.htm",1,"1123");
navigation[18] = new navElem(18,"Motorola","pi-1550501794.htm",1,"1125");
navigation[19] = new navElem(19,"Nippondenso","pi1403293116.htm",1,"1127");
navigation[20] = new navElem(20,"Noris","pi1313067533.htm",1,"1128");
navigation[21] = new navElem(21,"PAL","pi-1293706678.htm",1,"1129");
navigation[22] = new navElem(22,"Paris Rhone","pi-1893688573.htm",1,"1130");
navigation[23] = new navElem(23,"Prestolite","pi264086761.htm",1,"1132");
navigation[24] = new navElem(24,"S.E.V.","pi342592020.htm",1,"1135");
navigation[25] = new navElem(25,"Valeo","pi-62467269.htm",1,"1138");
navigation[26] = new navElem(26,"Anlasser","pi1445129138.htm",0,"22");
navigation[27] = new navElem(27,"Bosch","pi-949531266.htm",26,"2202");
navigation[28] = new navElem(28,"Briggs & Stratton","pi1179112231.htm",26,"2203");
navigation[29] = new navElem(29,"C.A.V.","pi-444094035.htm",26,"2205");
navigation[30] = new navElem(30,"Delco-Remy","pi-2145423960.htm",26,"2208");
navigation[31] = new navElem(31,"Denso","pi-469027191.htm",26,"2209");
navigation[32] = new navElem(32,"Ducellier","pi-566776810.htm",26,"2210");
navigation[33] = new navElem(33,"Femsa","pi1434191924.htm",26,"2212");
navigation[34] = new navElem(34,"Fiat","pi2133600549.htm",26,"2213");
navigation[35] = new navElem(35,"Ford","pi1476032898.htm",26,"2214");
navigation[36] = new navElem(36,"Hitachi","pi-692967461.htm",26,"2215");
navigation[37] = new navElem(37,"IFA","pi-1126186112.htm",26,"2216");
navigation[38] = new navElem(38,"Iskra","pi-1661313663.htm",26,"2217");
navigation[39] = new navElem(39,"Lucas","pi155462540.htm",26,"2220");
navigation[40] = new navElem(40,"Magneti Marelli","pi119238557.htm",26,"2221");
navigation[41] = new navElem(41,"Magneton PAL","pi2086251674.htm",26,"2222");
navigation[42] = new navElem(42,"Mitsubishi","pi1677568582.htm",26,"2226");
navigation[43] = new navElem(43,"Moskwitsch","pi772919887.htm",26,"2227");
navigation[44] = new navElem(44,"Nikko","pi264330517.htm",26,"2229");
navigation[45] = new navElem(45,"Nippondenso","pi450771634.htm",26,"2230");
navigation[46] = new navElem(46,"PAL","pi741877808.htm",26,"2232");
navigation[47] = new navElem(47,"Paris Rhone","pi1442459761.htm",26,"2233");
navigation[48] = new navElem(48,"Romania","pi140622652.htm",26,"2236");
navigation[49] = new navElem(49,"Valeo","pi-1166369687.htm",26,"2241");
navigation[50] = new navElem(50,"Wapsa","pi-1118579594.htm",26,"2242");
navigation[51] = new navElem(51,"Verteilerkohlen","pi-1822422725.htm",0,"33");
navigation[52] = new navElem(52,"Hupenkohlen","pi-58865455.htm",0,"333");
navigation[53] = new navElem(53,"Motorradkohlen","pi1156956489.htm",null,"30");
navigation[54] = new navElem(54,"Lichtmaschinen","pi921430271.htm",53,"31");
navigation[55] = new navElem(55,"Anlasser","pi1158773174.htm",53,"34");
navigation[56] = new navElem(56,"Marinekohlen","pi1247485374.htm",null,"32");
navigation[57] = new navElem(57,"Oldtimerkohlen-ungeordnet","pi675081831.htm",null,"35");
navigation[58] = new navElem(58,"Lüfterkohlen","pi1422565949.htm",null,"38");
navigation[59] = new navElem(59,"Scheibenwischer, Pumpen, Stellmotore","pi-1482264036.htm",null,"40");
navigation[60] = new navElem(60,"Ersatzteile","pi1162578344.htm",null,"5");
navigation[61] = new navElem(61,"Lichtmaschinen","pi35446327.htm",60,"51");
navigation[62] = new navElem(62,"Bosch","pi-159519939.htm",61,"5101");
navigation[63] = new navElem(63,"Sinterbuchsen","pi766974711.htm",62,"510126");
navigation[64] = new navElem(64,"Schleifringe","pi-904350881.htm",62,"5122");
navigation[65] = new navElem(65,"Bürstenhalter","pi-197205580.htm",62,"5123");
navigation[66] = new navElem(66,"Lagerkappen","pi-1406210302.htm",62,"5125");
navigation[67] = new navElem(67,"Diodenplatten","pi1263472585.htm",62,"5127");
navigation[68] = new navElem(68,"Delco-Remy","pi-742709318.htm",61,"5105");
navigation[69] = new navElem(69,"Regler","pi-1855543072.htm",68,"5151");
navigation[70] = new navElem(70,"Fiat","pi706156467.htm",61,"5113");
navigation[71] = new navElem(71," Ford","pi-753271688.htm",61,"5114");
navigation[72] = new navElem(72,"Regler","pi1758652761.htm",71,"51141");
navigation[73] = new navElem(73,"Schleifringe","pi1140390566.htm",71,"51142");
navigation[74] = new navElem(74,"Bürstenhalter","pi-1888144593.htm",71,"51143");
navigation[75] = new navElem(75,"Iskra","pi979710233.htm",61,"5116");
navigation[76] = new navElem(76,"Lucas","pi-1222240410.htm",61,"5119");
navigation[77] = new navElem(77,"Magneti Marelli","pi-969424657.htm",61,"5120");
navigation[78] = new navElem(78,"Magneton PAL","pi-1075600380.htm",61,"5121");
navigation[79] = new navElem(79,"Motorola","pi431012306.htm",61,"5126");
navigation[80] = new navElem(80,"PAL","pi629364203.htm",61,"5130");
navigation[81] = new navElem(81,"Paris Rhone","pi-1157153712.htm",61,"5131");
navigation[82] = new navElem(82,"Schleifringe","pi-1209310460.htm",81,"51312");
navigation[83] = new navElem(83,"Lagerkappen","pi2086010805.htm",81,"51313");
navigation[84] = new navElem(84,"S.E.V. / Motorola","pi-462063087.htm",61,"5136");
navigation[85] = new navElem(85,"Valeo","pi-1550730498.htm",61,"5139");
navigation[86] = new navElem(86,"Schleifringe","pi1545254821.htm",85,"392");
navigation[87] = new navElem(87,"Lagerkappen","pi-1578072574.htm",85,"393");
navigation[88] = new navElem(88,"Anlasser","pi158890412.htm",60,"52");
navigation[89] = new navElem(89,"Delco-Remy","pi1221284188.htm",88,"5208");
navigation[90] = new navElem(90,"Bürstenhalter","pi-1527796248.htm",89,"5282");
navigation[91] = new navElem(91,"Bosch","pi-132246873.htm",88,"522");
navigation[92] = new navElem(92,"Sinterbuchsen","pi1248356843.htm",91,"5221");
navigation[93] = new navElem(93,"Planetengetriebe","pi-1448038895.htm",91,"5223");
navigation[94] = new navElem(94,"Paris Rhone","pi660025128.htm",88,"5233");
navigation[95] = new navElem(95,"Valeo","pi1085356553.htm",88,"5241");
navigation[96] = new navElem(96,"Kabel,Litzen,Anschlüße","pi1266317498.htm",null,"511");
navigation[97] = new navElem(97,"Kugellager","pi1161098319.htm",null,"6");
navigation[98] = new navElem(98,"Sinterbuchsen","pi1247735454.htm",null,"61");
navigation[99] = new navElem(99,"Dioden- einzeln","pi-1706074984.htm",null,"7");
navigation[100] = new navElem(100,"Bosch","pi1258038252.htm",99,"702");
navigation[101] = new navElem(101,"Hitachi","pi362305661.htm",99,"710");
navigation[102] = new navElem(102,"Werkstatt u. Zubehör","pi1855055303.htm",null,"8");
navigation[103] = new navElem(103,"Russ. Lichtmaschinen","pi1253194567.htm",null,"899");
navigation[104] = new navElem(104,"Nichts gefunden?","pi1163691575.htm",null,"991");
navigation[105] = new navElem(105,"In eigener Sache!","pi1184690681.htm",null,"992");
navigation[106] = new navElem(106,"Gesamtangebot","pi1227807714.htm",null,"993");
navigation[107] = new navElem(107,"Versandkosten","pi1247754931.htm",null,"9999");

// 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.htm";
		};
	};
// activates entries for categories
activateItem(getParameterFromURL("categoryId"));

