//
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.gif" width="13" height="10" 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="0" 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="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="10" 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="10" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/bulletcatact.gif" width="11" 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,"<b>OEM CD Wechslerpakete </b>","pi1062186722.htm",null,"2");
navigation[1] = new navElem(1,"AUDI","pi-730337037.htm",0,"20");
navigation[2] = new navElem(2,"Mercedes-Benz","pi1757463142.htm",0,"23");
navigation[3] = new navElem(3,"VOLKSWAGEN","pi-212286883.htm",0,"26");
navigation[4] = new navElem(4,"<b>OEM DIN Fach CD-Wechsler / CD-Spieler / MP3-Radio</b>","pi658601952.htm",null,"3");
navigation[5] = new navElem(5,"Audi","pi1125098042.htm",4,"222");
navigation[6] = new navElem(6,"Mercedes-Benz","pi-979300356.htm",4,"68");
navigation[7] = new navElem(7,"Volkswagen","pi-1040211917.htm",4,"333");
navigation[8] = new navElem(8,"<b>OEM VW iPod Adapter / Media-IN <b>","pi449964124.htm",null,"323");
navigation[9] = new navElem(9,"<b>OEM Navigationssysteme Audi / BMW / SEAT / SKODA / Mercedes-Benz / VW</b>","pi1062959528.htm",null,"5");
navigation[10] = new navElem(10,"Audi","pi1109270360.htm",9,"122");
navigation[11] = new navElem(11,"A2 - 8Z0","pi1647479258.htm",10,"1357");
navigation[12] = new navElem(12,"A3 - 8L0","pi1597773651.htm",10,"1358");
navigation[13] = new navElem(13,"A3 - 8P0","pi811186880.htm",10,"1360");
navigation[14] = new navElem(14,"A4 - 8D0","pi-1236448803.htm",10,"1356");
navigation[15] = new navElem(15,"A4 - 8E0 / 8H0","pi227431361.htm",10,"1351");
navigation[16] = new navElem(16,"A6 - 4B0","pi746856174.htm",10,"1352");
navigation[17] = new navElem(17,"A6 - 4F0","pi-188344628.htm",10,"1355");
navigation[18] = new navElem(18,"TT - 8J0","pi478364631.htm",10,"1354");
navigation[19] = new navElem(19,"A8 - 4D0","pi809806744.htm",10,"1359");
navigation[20] = new navElem(20,"A8 - 4E0","pi-1348188665.htm",10,"1366");
navigation[21] = new navElem(21,"BMW","pi1206026267.htm",9,"123");
navigation[22] = new navElem(22,"Mercedes-Benz","pi-869397193.htm",9,"22");
navigation[23] = new navElem(23,"A- Klasse  W168","pi1055934402.htm",22,"1320");
navigation[24] = new navElem(24,"A- Klasse  W169 ","pi-1758140133.htm",22,"1321");
navigation[25] = new navElem(25,"B- Klasse  W245 ","pi374866113.htm",22,"1323");
navigation[26] = new navElem(26,"C- Klasse  W203 ","pi-1844860980.htm",22,"1325");
navigation[27] = new navElem(27,"C- Klasse  W204","pi574915290.htm",22,"1327");
navigation[28] = new navElem(28,"CLK  W208","pi-1031784803.htm",22,"1322");
navigation[29] = new navElem(29,"CLK  W209","pi-2011505581.htm",22,"1328");
navigation[30] = new navElem(30,"E- Klasse  W210","pi797314959.htm",22,"1332");
navigation[31] = new navElem(31,"E- Klasse  W211 und CLS W219 ","pi-170075051.htm",22,"1333");
navigation[32] = new navElem(32,"E- Klasse  W212","pi-15097158.htm",22,"1340");
navigation[33] = new navElem(33,"ML  W163","pi464324281.htm",22,"1330");
navigation[34] = new navElem(34,"ML  W164","pi582247558.htm",22,"1331");
navigation[35] = new navElem(35,"R- Klasse  W251","pi1311297163.htm",22,"1334");
navigation[36] = new navElem(36,"SLK W171","pi420558658.htm",22,"1326");
navigation[37] = new navElem(37,"Sportcoupe, Vito / Viano , G-Modell","pi-1740379340.htm",22,"1335");
navigation[38] = new navElem(38,"SEAT","pi-509032768.htm",9,"124");
navigation[39] = new navElem(39,"Skoda","pi444667473.htm",9,"119");
navigation[40] = new navElem(40,"Volkswagen","pi-1466449230.htm",9,"112");
navigation[41] = new navElem(41,"Crafter","pi-1965684299.htm",40,"1400");
navigation[42] = new navElem(42,"Eos","pi-451775571.htm",40,"1391");
navigation[43] = new navElem(43,"Golf IV 4 / Bora","pi1550314351.htm",40,"1380");
navigation[44] = new navElem(44,"Golf V 5 / Golf V 5 Plus","pi-1937105788.htm",40,"1381");
navigation[45] = new navElem(45,"Golf VI 6","pi1457888053.htm",40,"1382");
navigation[46] = new navElem(46,"Jetta","pi-1983686180.htm",40,"1390");
navigation[47] = new navElem(47,"Passat 3B","pi336455250.htm",40,"1384");
navigation[48] = new navElem(48,"Passat 3BG","pi2111776875.htm",40,"1385");
navigation[49] = new navElem(49,"Passat 3C","pi-498451248.htm",40,"1386");
navigation[50] = new navElem(50,"Passat CC","pi-1649438575.htm",40,"1387");
navigation[51] = new navElem(51,"Polo 6R","pi-671810635.htm",40,"133");
navigation[52] = new navElem(52,"Scirocco","pi577487722.htm",40,"1392");
navigation[53] = new navElem(53,"Sharan","pi-1482375256.htm",40,"1393");
navigation[54] = new navElem(54,"T4","pi1708555743.htm",40,"1395");
navigation[55] = new navElem(55,"T5","pi-125142476.htm",40,"1396");
navigation[56] = new navElem(56,"Tiguan","pi505847945.htm",40,"1394");
navigation[57] = new navElem(57,"Touran ","pi-2097238146.htm",40,"1389");
navigation[58] = new navElem(58,"Touareg","pi-1558039771.htm",40,"1399");
navigation[59] = new navElem(59,"Navigations Software","pi-429855656.htm",9,"234");
navigation[60] = new navElem(60,"Audi","pi-1601057710.htm",59,"1410");
navigation[61] = new navElem(61,"BMW","pi833787499.htm",59,"1411");
navigation[62] = new navElem(62,"Mercedes-Benz","pi2025649534.htm",59,"1413");
navigation[63] = new navElem(63,"Seat","pi-1543303204.htm",59,"1414");
navigation[64] = new navElem(64,"Skoda","pi1070166445.htm",59,"1415");
navigation[65] = new navElem(65,"Volkswagen","pi-213347632.htm",59,"1412");
navigation[66] = new navElem(66,"<b>OEM PhatBox </b>","pi1074086251.htm",null,"4");
navigation[67] = new navElem(67,"<b>OEM Radios VW & AUDI</b>","pi1345671777.htm",null,"7");
navigation[68] = new navElem(68,"Audi","pi1590430742.htm",67,"223");
navigation[69] = new navElem(69,"Volkswagen","pi-1727195511.htm",67,"332");
navigation[70] = new navElem(70,"<b>OEM Ultraschall-Rückfahrhilfe</b>","pi1198367316.htm",null,"9");
navigation[71] = new navElem(71,"<b>OEM VW Bluetooth Adapter / Freisprechanlagen</b>","pi1096676224.htm",null,"152");
navigation[72] = new navElem(72,"<b>OEM VW Handyschalen / Adapter</b>","pi1208862508.htm",null,"1455");
navigation[73] = new navElem(73,"<b>Digitales Music Interface USB SD</b>","pi1213198514.htm",null,"11111");
navigation[74] = new navElem(74,"<b>Solisto Car Mp3-Player</b>","pi1141670971.htm",null,"78");
navigation[75] = new navElem(75,"Zubehör","pi403855262.htm",74,"555");
navigation[76] = new navElem(76,"<b>GATEWAY CarKits</b>","pi-469266912.htm",null,"144");
navigation[77] = new navElem(77,"Gateway 500","pi81773351.htm",76,"147");
navigation[78] = new navElem(78,"<b>Car-Multimedia</b>","pi75299450.htm",null,"6");
navigation[79] = new navElem(79,"TV-Tuner - Digital / Analog","pi-600932376.htm",78,"55");
navigation[80] = new navElem(80,"INTERFACE / ADAPTER / TV FREI","pi-716594471.htm",78,"201");
navigation[81] = new navElem(81,"Audi / Volkswagen","pi-1518009830.htm",80,"88");
navigation[82] = new navElem(82,"Mercedes Benz","pi482654867.htm",80,"89");
navigation[83] = new navElem(83,"Multimedia Bundles","pi2034594519.htm",78,"201-5");
navigation[84] = new navElem(84,"ZUBEHÖR","pi1079482785.htm",78,"500");
navigation[85] = new navElem(85,"<b>Zubehör</b>","pi1062338575.htm",null,"0");
navigation[86] = new navElem(86,"Klimabetätigung","pi812946195.htm",85,"211");
navigation[87] = new navElem(87,"GPS-Antennen","pi-1419762142.htm",85,"17");
navigation[88] = new navElem(88,"Steuerleitungen","pi-921676067.htm",85,"12");
navigation[89] = new navElem(89,"Einbausätze / Ablagefächer","pi740938458.htm",85,"13");
navigation[90] = new navElem(90,"TMC / Adapter","pi1263135827.htm",85,"14");
navigation[91] = new navElem(91,"Werkzeug","pi429000909.htm",85,"15");
navigation[92] = new navElem(92,"Magazin","pi-500240714.htm",85,"16");
navigation[93] = new navElem(93,"Ersatzteile","pi1220444002.htm",85,"1222");
navigation[94] = new navElem(94,"<b>Service / Anleitungen</b>","pi23524589.htm",null,"99");
navigation[95] = new navElem(95,"<b>VW Original Felgen</b>","pi1297372074.htm",null,"102");
navigation[96] = new navElem(96,"<b>VW Original Zubehör</b>","pi719544685.htm",null,"101");
navigation[97] = new navElem(97,"<b><font color=white>Dienstleistungen - Diebstahlschaden/ Wiederbeschaffung Navigationssysteme - Ersatzteilbeschaffung - </font></b>","pi1198002927.htm",null,"1436");
navigation[98] = new navElem(98,"<b>Sponsoring / Jugend Fußballmannschaften  </b>","pi1262512841.htm",null,"1212");

// 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"));


