//
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/bulletcat1st.gif" width="13" height="14" alt="Bullet.gif" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">' + "Zum Bestellschein</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="1" >';
		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="13" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcatact.gif" width="13" height="14" alt="BulletCatAct.gif" 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="13" height="14" alt="BulletCat1stCls.gif" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/bulletcat1st.gif" width="13" height="14" alt="BulletCat1st.gif" 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 = true;
		this.categoryId = categoryId;
		};
// navigation
var navigation = new Array();
//
navigation[0] = new navElem(0,"CD Tuner / MP3 / DVD","pi1182699900.htm",null,"1000");
navigation[1] = new navElem(1,"Doppeldin CD / MP3 / DVD","pi-497347463.htm",null,"1500");
navigation[2] = new navElem(2,"1-Kanal Amps für Bass&nbsp(4)","pi896869374.htm",null,"1700");
navigation[3] = new navElem(3,"2-Kanal Amps&nbsp(5)","pi-1682131249.htm",null,"1701");
navigation[4] = new navElem(4,"4-Kanal Amps&nbsp(4)","pi-905759574.htm",null,"1702");
navigation[5] = new navElem(5,"5/6-Kanal Amps&nbsp(1)","pi-1450629359.htm",null,"1703");
navigation[6] = new navElem(6,"TFT&nbsp(4)","pi-142323449.htm",null,"1900");
navigation[7] = new navElem(7,"Alfa&nbsp(12)","pi-702787032.htm",null,"2000");
navigation[8] = new navElem(8,"Audi&nbsp(17)","pi-691379959.htm",null,"2001");
navigation[9] = new navElem(9,"BMW&nbsp(11)","pi1778459798.htm",null,"2003");
navigation[10] = new navElem(10,"Bentley","pi1620193887.htm",null,"2005");
navigation[11] = new navElem(11,"Citroen&nbsp(6)","pi1337210036.htm",null,"2006");
navigation[12] = new navElem(12,"Crysler","pi-1828258907.htm",null,"2008");
navigation[13] = new navElem(13,"Chevrolet","pi-1903134206.htm",null,"2009");
navigation[14] = new navElem(14,"Daewoo","pi-746373541.htm",null,"2010");
navigation[15] = new navElem(15,"Daihatsu","pi668448768.htm",null,"2011");
navigation[16] = new navElem(16,"Dodge","pi-801417215.htm",null,"2012");
navigation[17] = new navElem(17,"Fiat&nbsp(19)","pi-1497407954.htm",null,"2013");
navigation[18] = new navElem(18,"Ford&nbsp(21)","pi1673585175.htm",null,"2014");
navigation[19] = new navElem(19,"Honda","pi650668044.htm",null,"2015");
navigation[20] = new navElem(20,"Hyundai","pi-1514860003.htm",null,"2016");
navigation[21] = new navElem(21,"Isuzu","pi-2057683686.htm",null,"2017");
navigation[22] = new navElem(22,"Jeep","pi-935192173.htm",null,"2018");
navigation[23] = new navElem(23,"Kia","pi1549308120.htm",null,"2019");
navigation[24] = new navElem(24,"Lada","pi-877427207.htm",null,"2020");
navigation[25] = new navElem(25,"Lancia","pi2049721030.htm",null,"2021");
navigation[26] = new navElem(26,"Lexus","pi-1857707825.htm",null,"2022");
navigation[27] = new navElem(27,"Lincoln","pi-2139668892.htm",null,"2024");
navigation[28] = new navElem(28,"Mazda","pi1543753621.htm",null,"2025");
navigation[29] = new navElem(29,"Mercedes&nbsp(12)","pi1433099058.htm",null,"2026");
navigation[30] = new navElem(30,"Mercury","pi-900860981.htm",null,"2027");
navigation[31] = new navElem(31,"Mitsubishi","pi-730055504.htm",null,"2028");
navigation[32] = new navElem(32,"Nissan","pi-1268987151.htm",null,"2029");
navigation[33] = new navElem(33,"Opel&nbsp(8)","pi-639356322.htm",null,"2030");
navigation[34] = new navElem(34,"Peugeot&nbsp(3)","pi-1814212985.htm",null,"2031");
navigation[35] = new navElem(35,"Pontiac","pi288626620.htm",null,"2033");
navigation[36] = new navElem(36,"Porsche&nbsp(1)","pi377164813.htm",null,"2034");
navigation[37] = new navElem(37,"Renault&nbsp(2)","pi166081610.htm",null,"2035");
navigation[38] = new navElem(38,"Rover","pi-1326338813.htm",null,"2036");
navigation[39] = new navElem(39,"Saab","pi-1381229688.htm",null,"2037");
navigation[40] = new navElem(40,"Seat&nbsp(2)","pi1643972329.htm",null,"2038");
navigation[41] = new navElem(41,"Skoda","pi2062519542.htm",null,"2039");
navigation[42] = new navElem(42,"Smart","pi-1002386625.htm",null,"2040");
navigation[43] = new navElem(43,"SsangYong&nbsp(5)","pi-1967238124.htm",null,"2041");
navigation[44] = new navElem(44,"Subaru","pi67026821.htm",null,"2042");
navigation[45] = new navElem(45,"Suzuki&nbsp(1)","pi-1676072862.htm",null,"2043");
navigation[46] = new navElem(46,"Toyota&nbsp(4)","pi-1187764933.htm",null,"2044");
navigation[47] = new navElem(47,"Volvo&nbsp(1)","pi-815952544.htm",null,"2045");
navigation[48] = new navElem(48,"VW&nbsp(9)","pi-126477855.htm",null,"2046");
navigation[49] = new navElem(49,"Lautsprecherblenden&nbsp(2)","pi1204676410.htm",null,"2121");
navigation[50] = new navElem(50,"Lautsprecher / Woofer","pi-427433156.htm",null,"3000");
navigation[51] = new navElem(51,"87 mm&nbsp(4)","pi1241706115.htm",50,"3001");
navigation[52] = new navElem(52,"100 mm&nbsp(14)","pi-275185440.htm",50,"3002");
navigation[53] = new navElem(53,"120 mm&nbsp(3)","pi-1166523960.htm",50,"3003");
navigation[54] = new navElem(54,"130 mm&nbsp(18)","pi-879923809.htm",50,"3004");
navigation[55] = new navElem(55,"165 mm&nbsp(27)","pi505658114.htm",50,"3006");
navigation[56] = new navElem(56,"200 mm&nbsp(1)","pi259018379.htm",50,"3007");
navigation[57] = new navElem(57,"250 mm / Woofer&nbsp(1)","pi1262369748.htm",50,"3008");
navigation[58] = new navElem(58,"Hochtöner&nbsp(6)","pi47369246.htm",50,"3009");
navigation[59] = new navElem(59,"Aufbaulautsprecher","pi-268558666.htm",50,"3010");
navigation[60] = new navElem(60,"oval&nbsp(19)","pi-1639206917.htm",50,"3011");
navigation[61] = new navElem(61,"weiße / Marine &nbsp(12)","pi545767930.htm",50,"3013");
navigation[62] = new navElem(62,"300 mm Woofer&nbsp(6)","pi-1183436067.htm",50,"3040");
navigation[63] = new navElem(63,"380 mm Woofer&nbsp(2)","pi-239501606.htm",50,"3045");
navigation[64] = new navElem(64,"Bassbox&nbsp(1)","pi437463123.htm",50,"3060");
navigation[65] = new navElem(65,"Hifonics&nbsp(3)","pi1247911042.htm",null,"321");
navigation[66] = new navElem(66,"Basskisten / Röhren&nbsp(36)","pi1203514751.htm",null,"3400");
navigation[67] = new navElem(67,"Bluetooth-Zubehör","pi1560681698.htm",null,"4000");
navigation[68] = new navElem(68,"Ipod-Zubehör","pi-841640480.htm",null,"4050");
navigation[69] = new navElem(69,"DVBT","pi-1093879434.htm",null,"4060");
navigation[70] = new navElem(70,"Kondensatoren&nbsp(3)","pi1043265943.htm",null,"4070");
navigation[71] = new navElem(71,"Kabel + Montagsets&nbsp(29)","pi-1106819098.htm",null,"4080");
navigation[72] = new navElem(72,"Hazet&nbsp(1)","pi1267565720.htm",null,"43");
navigation[73] = new navElem(73,"Radioblenden&nbsp(1)","pi25858630.htm",null,"5000");
navigation[74] = new navElem(74,"Anschlußadapter&nbsp(25)","pi10461820.htm",null,"5010");
navigation[75] = new navElem(75,"Antennenadapter&nbsp(7)","pi186006808.htm",null,"5015");
navigation[76] = new navElem(76,"Lautsprecheraufnahmen&nbsp(5)","pi1093292028.htm",null,"5020");
navigation[77] = new navElem(77,"Türtaschen","pi400987266.htm",null,"5050");
navigation[78] = new navElem(78,"Lenkradfb Adapter","pi579149353.htm",null,"5080");
navigation[79] = new navElem(79,"Multimedia-Home","pi-1590628724.htm",null,"7000");
navigation[80] = new navElem(80,"Sonstiges&nbsp(44)","pi-368363554.htm",null,"8000");
navigation[81] = new navElem(81,"","pi-1694441799.htm",null,"987");

// 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"));


