//
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,"Elmot","pi318432302.htm",1,"1110");
navigation[9] = new navElem(9,"IFA / FER","pi1687908375.htm",1,"11101");
navigation[10] = new navElem(10,"Femsa","pi684154380.htm",1,"1111");
navigation[11] = new navElem(11,"Fiat","pi-1869983715.htm",1,"1112");
navigation[12] = new navElem(12,"Ford","pi-494263526.htm",1,"1113");
navigation[13] = new navElem(13,"Hitachi","pi-1303279725.htm",1,"1114");
navigation[14] = new navElem(14,"Iskra","pi-572332328.htm",1,"1115");
navigation[15] = new navElem(15,"Lada","pi1514710009.htm",1,"1116");
navigation[16] = new navElem(16,"Lucas","pi681045711.htm",1,"1118");
navigation[17] = new navElem(17,"Magneti Marelli","pi-1945963420.htm",1,"1119");
navigation[18] = new navElem(18,"Magneton PAL","pi1763102101.htm",1,"1120");
navigation[19] = new navElem(19,"Mando Melroe","pi838205746.htm",1,"1121");
navigation[20] = new navElem(20,"Mitsubishi","pi-1210101072.htm",1,"1123");
navigation[21] = new navElem(21,"Motorola","pi-1550501794.htm",1,"1125");
navigation[22] = new navElem(22,"Nippondenso","pi1403293116.htm",1,"1127");
navigation[23] = new navElem(23,"Noris","pi1313067533.htm",1,"1128");
navigation[24] = new navElem(24,"PAL","pi-1293706678.htm",1,"1129");
navigation[25] = new navElem(25,"Paris Rhone","pi-1893688573.htm",1,"1130");
navigation[26] = new navElem(26,"Prestolite","pi264086761.htm",1,"1132");
navigation[27] = new navElem(27,"Puch / Steyr","pi-1816177930.htm",1,"1133");
navigation[28] = new navElem(28,"S.E.V.","pi342592020.htm",1,"1135");
navigation[29] = new navElem(29,"Valeo","pi-62467269.htm",1,"1138");
navigation[30] = new navElem(30,"Anlasser","pi1445129138.htm",0,"22");
navigation[31] = new navElem(31,"Bosch","pi-949531266.htm",30,"2202");
navigation[32] = new navElem(32,"Briggs & Stratton","pi1179112231.htm",30,"2203");
navigation[33] = new navElem(33,"C.A.V.","pi-444094035.htm",30,"2205");
navigation[34] = new navElem(34,"Chrysler","pi-124601437.htm",30,"2207");
navigation[35] = new navElem(35,"Delco-Remy","pi-2145423960.htm",30,"2208");
navigation[36] = new navElem(36,"Denso","pi-469027191.htm",30,"2209");
navigation[37] = new navElem(37,"Ducellier","pi-566776810.htm",30,"2210");
navigation[38] = new navElem(38,"Elmot","pi736429023.htm",30,"2211");
navigation[39] = new navElem(39,"Femsa","pi1434191924.htm",30,"2212");
navigation[40] = new navElem(40,"Fiat","pi2133600549.htm",30,"2213");
navigation[41] = new navElem(41,"Ford","pi1476032898.htm",30,"2214");
navigation[42] = new navElem(42,"Hitachi","pi-692967461.htm",30,"2215");
navigation[43] = new navElem(43,"IFA","pi-1126186112.htm",30,"2216");
navigation[44] = new navElem(44,"Iskra","pi-1661313663.htm",30,"2217");
navigation[45] = new navElem(45,"Lada","pi591680942.htm",30,"2218");
navigation[46] = new navElem(46,"Lucas","pi155462540.htm",30,"2220");
navigation[47] = new navElem(47,"Magneti Marelli","pi119238557.htm",30,"2221");
navigation[48] = new navElem(48,"Magneton PAL","pi2086251674.htm",30,"2222");
navigation[49] = new navElem(49,"Mitsubishi","pi1677568582.htm",30,"2226");
navigation[50] = new navElem(50,"Moskwitsch","pi772919887.htm",30,"2227");
navigation[51] = new navElem(51,"Nikko","pi264330517.htm",30,"2229");
navigation[52] = new navElem(52,"Nippondenso","pi450771634.htm",30,"2230");
navigation[53] = new navElem(53,"PAL","pi741877808.htm",30,"2232");
navigation[54] = new navElem(54,"Paris Rhone","pi1442459761.htm",30,"2233");
navigation[55] = new navElem(55,"Romania","pi140622652.htm",30,"2236");
navigation[56] = new navElem(56,"Valeo","pi-1166369687.htm",30,"2241");
navigation[57] = new navElem(57,"Wapsa","pi-1118579594.htm",30,"2242");
navigation[58] = new navElem(58,"Verteilerkohlen","pi-1822422725.htm",0,"33");
navigation[59] = new navElem(59,"Hupenkohlen","pi-58865455.htm",0,"333");
navigation[60] = new navElem(60,"Motorradkohlen","pi1156956489.htm",null,"30");
navigation[61] = new navElem(61,"Lichtmaschinen","pi921430271.htm",60,"301");
navigation[62] = new navElem(62,"Anlasser","pi1158773174.htm",60,"304");
navigation[63] = new navElem(63,"Dynastarter","pi-701430631.htm",60,"305");
navigation[64] = new navElem(64,"Marinekohlen","pi1247485374.htm",null,"32");
navigation[65] = new navElem(65,"Oldtimerkohlen","pi675081831.htm",null,"35");
navigation[66] = new navElem(66,"Lüfterkohlen","pi1422565949.htm",null,"38");
navigation[67] = new navElem(67,"Scheibenwischer, Pumpen, Stellmotore","pi-1482264036.htm",null,"40");
navigation[68] = new navElem(68,"Ersatzteile","pi1162578344.htm",null,"5");
navigation[69] = new navElem(69,"Lichtmaschinen","pi35446327.htm",68,"51");
navigation[70] = new navElem(70,"Bosch","pi-159519939.htm",69,"5101");
navigation[71] = new navElem(71,"Regler","pi-1366603370.htm",70,"5111");
navigation[72] = new navElem(72,"Schleifringe","pi-904350881.htm",70,"5122");
navigation[73] = new navElem(73,"Bürstenhalter","pi-197205580.htm",70,"5123");
navigation[74] = new navElem(74,"Lagerkappen","pi-1406210302.htm",70,"5125");
navigation[75] = new navElem(75,"Diodenplatten","pi1263472585.htm",70,"5127");
navigation[76] = new navElem(76,"Sinterbuchsen","pi766974711.htm",70,"5129");
navigation[77] = new navElem(77,"Delco-Remy","pi-742709318.htm",69,"5105");
navigation[78] = new navElem(78,"Regler","pi-1855543072.htm",77,"5151");
navigation[79] = new navElem(79,"Schleifringe","pi1325756649.htm",77,"515142");
navigation[80] = new navElem(80,"Bürstenhalter","pi-1610374313.htm",77,"515143");
navigation[81] = new navElem(81,"Fiat","pi706156467.htm",69,"5113");
navigation[82] = new navElem(82," Ford","pi-753271688.htm",69,"5114");
navigation[83] = new navElem(83,"Regler","pi1758652761.htm",82,"51141");
navigation[84] = new navElem(84,"Schleifringe","pi1140390566.htm",82,"51142");
navigation[85] = new navElem(85,"Bürstenhalter","pi-1888144593.htm",82,"51143");
navigation[86] = new navElem(86,"Iskra","pi979710233.htm",69,"5116");
navigation[87] = new navElem(87,"Lucas","pi-1222240410.htm",69,"5119");
navigation[88] = new navElem(88,"Magneti Marelli","pi-969424657.htm",69,"5120");
navigation[89] = new navElem(89,"Magneton PAL","pi-1075600380.htm",69,"5121");
navigation[90] = new navElem(90,"Mitsubishi","pi761228469.htm",69,"5124");
navigation[91] = new navElem(91,"Motorola","pi431012306.htm",69,"5126");
navigation[92] = new navElem(92,"Paris Rhone","pi-1157153712.htm",69,"5131");
navigation[93] = new navElem(93,"Schleifringe","pi-1209310460.htm",92,"51312");
navigation[94] = new navElem(94,"Lagerkappen","pi2086010805.htm",92,"51313");
navigation[95] = new navElem(95,"S.E.V. / Motorola","pi-462063087.htm",69,"5136");
navigation[96] = new navElem(96,"Valeo","pi-1550730498.htm",69,"5139");
navigation[97] = new navElem(97,"Schleifringe","pi1545254821.htm",96,"392");
navigation[98] = new navElem(98,"Lagerkappen","pi-1578072574.htm",96,"393");
navigation[99] = new navElem(99,"Anlasser","pi158890412.htm",68,"52");
navigation[100] = new navElem(100,"Bosch","pi-132246873.htm",99,"5202");
navigation[101] = new navElem(101,"Sinterbuchsen","pi1248356843.htm",100,"52201");
navigation[102] = new navElem(102,"Planetengetriebe","pi-1448038895.htm",100,"52203");
navigation[103] = new navElem(103,"Federn/Bürstenhalter","pi2142363390.htm",100,"52204");
navigation[104] = new navElem(104,"Delco-Remy","pi1221284188.htm",99,"5208");
navigation[105] = new navElem(105,"Sinterbuchsen","pi1302260592.htm",104,"5281");
navigation[106] = new navElem(106,"Bürstenhalter","pi-1527796248.htm",104,"5282");
navigation[107] = new navElem(107,"Hitachi","pi-1971044097.htm",99,"5215");
navigation[108] = new navElem(108," Lucas","pi-1222474006.htm",99,"5220");
navigation[109] = new navElem(109,"Federn/Bürstenhalter","pi-571284099.htm",108,"522044");
navigation[110] = new navElem(110,"Kleinteile","pi-854758336.htm",108,"522049");
navigation[111] = new navElem(111,"Paris Rhone","pi660025128.htm",99,"5233");
navigation[112] = new navElem(112,"Valeo","pi1085356553.htm",99,"5241");
navigation[113] = new navElem(113,"Steckverbinder","pi1300285843.htm",null,"530");
navigation[114] = new navElem(114,"Flachsteckverbinder","pi444432600.htm",113,"531");
navigation[115] = new navElem(115,"Superseal","pi1741796857.htm",113,"532");
navigation[116] = new navElem(116,"Kugellager","pi1161098319.htm",null,"6");
navigation[117] = new navElem(117,"Nadellager","pi1247735454.htm",null,"61");
navigation[118] = new navElem(118,"Dioden- einzeln","pi-1706074984.htm",null,"7");
navigation[119] = new navElem(119,"Bosch","pi1258038252.htm",118,"702");
navigation[120] = new navElem(120,"Hitachi","pi362305661.htm",118,"710");
navigation[121] = new navElem(121,"Lucas","pi1325505899.htm",118,"718");
navigation[122] = new navElem(122,"Universal","pi1280146850.htm",118,"750");
navigation[123] = new navElem(123,"Werkstatt u. Zubehör","pi1855055303.htm",null,"8");
navigation[124] = new navElem(124,"Nichts gefunden?","pi1163691575.htm",null,"991");
navigation[125] = new navElem(125,"In eigener Sache!","pi1184690681.htm",null,"992");
navigation[126] = new navElem(126,"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"));


