//
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/menuepfeil.gif" width="16" height="16" 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="16" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/menuepfeil_aktiv.gif" width="16" height="16" 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/menuepfeil.gif" width="16" height="16" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/menuepfeil.gif" width="16" height="16" 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,"fahrzeuge aktuell","pi1141724769.htm",null,"1");
navigation[1] = new navElem(1,"agila b","pi-1490361905.htm",0,"10-010");
navigation[2] = new navElem(2,"aerodynamik","pi192385074.htm",1,"10-010060");
navigation[3] = new navElem(3,"interieur","pi34686155.htm",1,"10-010080");
navigation[4] = new navElem(4,"astra h","pi-809715220.htm",0,"110-020");
navigation[5] = new navElem(5,"motor/auspuff","pi-1044801784.htm",4,"110-020020");
navigation[6] = new navElem(6,"fahrwerk/tieferlegung","pi1699789929.htm",4,"110-020050");
navigation[7] = new navElem(7,"aerodynamik","pi632779894.htm",4,"110-020060");
navigation[8] = new navElem(8,"interieur","pi-1017021249.htm",4,"110-020080");
navigation[9] = new navElem(9,"felgen","pi-1560901740.htm",4,"110-020090");
navigation[10] = new navElem(10,"kompletträder","pi606391557.htm",4,"110-020100");
navigation[11] = new navElem(11,"astra h caravan","pi-231295363.htm",0,"110-030");
navigation[12] = new navElem(12,"motor/auspuff","pi1391101922.htm",11,"110-030020");
navigation[13] = new navElem(13,"fahrwerk/tieferlegung","pi1473179323.htm",11,"110-030050");
navigation[14] = new navElem(14,"aerodynamik","pi-1583613728.htm",11,"110-030060");
navigation[15] = new navElem(15,"interieur","pi1644429153.htm",11,"110-030080");
navigation[16] = new navElem(16,"felgen","pi-2056975858.htm",11,"110-030090");
navigation[17] = new navElem(17,"kompletträder","pi-146057097.htm",11,"110-030100");
navigation[18] = new navElem(18,"astra gtc - opc","pi-92154637.htm",0,"110-040");
navigation[19] = new navElem(19,"motor/auspuff","pi880375532.htm",18,"110-040020");
navigation[20] = new navElem(20,"fahrwerk/tieferlegung","pi2033315709.htm",18,"110-040050");
navigation[21] = new navElem(21,"aerodynamik","pi1496409850.htm",18,"110-040060");
navigation[22] = new navElem(22,"interieur","pi1823716851.htm",18,"110-040080");
navigation[23] = new navElem(23,"felgen","pi-1899016776.htm",18,"110-040090");
navigation[24] = new navElem(24,"kompletträder","pi809761113.htm",18,"110-040100");
navigation[25] = new navElem(25,"astra twin top","pi1148882541.htm",0,"110-041");
navigation[26] = new navElem(26,"motor/auspuff","pi1606481706.htm",25,"110-041020");
navigation[27] = new navElem(27,"fahrwerk/tieferlegung","pi-1417990557.htm",25,"110-041050");
navigation[28] = new navElem(28,"aerodynamik","pi-1173087896.htm",25,"110-041060");
navigation[29] = new navElem(29,"interieur","pi375121737.htm",25,"110-041080");
navigation[30] = new navElem(30,"felgen","pi-1523368490.htm",25,"110-041090");
navigation[31] = new navElem(31,"kompletträder","pi-619699553.htm",25,"110-041100");
navigation[32] = new navElem(32,"astra j - astra j sports tourer","pi-1649668062.htm",0,"110-042");
navigation[33] = new navElem(33,"motor/auspuff","pi-1914575135.htm",32,"110-042020");
navigation[34] = new navElem(34,"tieferlegung","pi-1864125712.htm",32,"110-042050");
navigation[35] = new navElem(35,"aerodynamik","pi742220283.htm",32,"110-042060");
navigation[36] = new navElem(36,"interieur","pi-997082336.htm",32,"110-042080");
navigation[37] = new navElem(37,"felgen","pi-1547918175.htm",32,"110-042090");
navigation[38] = new navElem(38,"corsa d - opc","pi1176973582.htm",0,"110-050");
navigation[39] = new navElem(39,"motor/auspuff","pi141964151.htm",38,"110-050-02");
navigation[40] = new navElem(40,"fahrwerk/tieferlegung","pi2042885612.htm",38,"110-050-05");
navigation[41] = new navElem(41,"aerodynamik","pi1432633981.htm",38,"110-050-06");
navigation[42] = new navElem(42,"interieur","pi77331962.htm",38,"110-050-08");
navigation[43] = new navElem(43,"felgen","pi303710451.htm",38,"110-050-09");
navigation[44] = new navElem(44,"kompletträder","pi-2101887816.htm",38,"110-050-10");
navigation[45] = new navElem(45,"gt","pi1198133370.htm",0,"110-051");
navigation[46] = new navElem(46,"motor/auspuff","pi1710223769.htm",45,"12-051-010");
navigation[47] = new navElem(47,"fahrwerk/tieferlegung","pi351437171.htm",45,"12-051-050");
navigation[48] = new navElem(48,"aerodynamik","pi-324136136.htm",45,"12-051-060");
navigation[49] = new navElem(49,"felgen","pi-1243762471.htm",45,"12-051-090");
navigation[50] = new navElem(50,"kompletträder","pi-568652762.htm",45,"12-051-100");
navigation[51] = new navElem(51,"Insignia/Insignia SportsTourer","pi1238825012.htm",0,"110-052");
navigation[52] = new navElem(52,"kompletträder","pi-1807109248.htm",51,"110-052100");
navigation[53] = new navElem(53,"fahrwerk/tieferlegung","pi650664229.htm",51,"110-052-20");
navigation[54] = new navElem(54,"aerodynamik","pi563014018.htm",51,"110-052-60");
navigation[55] = new navElem(55,"interieur","pi-1472623231.htm",51,"110-052-80");
navigation[56] = new navElem(56,"felgen","pi-1570121765.htm",51,"110-052-90");
navigation[57] = new navElem(57,"meriva","pi307966041.htm",0,"110-060");
navigation[58] = new navElem(58,"motor/auspuff","pi220263824.htm",57,"110-060020");
navigation[59] = new navElem(59,"fahrwerk/tieferlegung","pi2137688657.htm",57,"110-060050");
navigation[60] = new navElem(60,"aerodynamik","pi-583068098.htm",57,"110-060060");
navigation[61] = new navElem(61,"interieur","pi1804770535.htm",57,"110-060080");
navigation[62] = new navElem(62,"felgen","pi-1736630628.htm",57,"110-060090");
navigation[63] = new navElem(63,"kompletträder","pi-763459219.htm",57,"110-060100");
navigation[64] = new navElem(64,"tigra twin top","pi1355099204.htm",0,"110-090");
navigation[65] = new navElem(65,"motor/auspuff","pi-894382482.htm",64,"110-090020");
navigation[66] = new navElem(66,"fahrwerk/tieferlegung","pi1879776599.htm",64,"110-090050");
navigation[67] = new navElem(67,"aerodynamik","pi-1861201332.htm",64,"110-090060");
navigation[68] = new navElem(68,"interieur","pi1087291229.htm",64,"110-090080");
navigation[69] = new navElem(69,"felgen","pi-360369830.htm",64,"110-090090");
navigation[70] = new navElem(70,"kompletträder","pi-129988397.htm",64,"110-090100");
navigation[71] = new navElem(71,"zafira b","pi622053520.htm",0,"110-130");
navigation[72] = new navElem(72,"motor/auspuff","pi-242363082.htm",71,"110-130020");
navigation[73] = new navElem(73,"fahrwerk/tieferlegung","pi-1560478081.htm",71,"110-130050");
navigation[74] = new navElem(74,"aerodynamik","pi1474221652.htm",71,"110-130060");
navigation[75] = new navElem(75,"interieur","pi-1749343035.htm",71,"110-130080");
navigation[76] = new navElem(76,"felgen","pi-416385886.htm",71,"110-130090");
navigation[77] = new navElem(77,"kompletträder","pi-562819973.htm",71,"110-130100");
navigation[78] = new navElem(78,"Accessoires","pi1244614801.htm",0,"110-140");
navigation[79] = new navElem(79,"Artikel","pi1187387868.htm",78,"110-140-9");
navigation[80] = new navElem(80,"fahrzeuge classics","pi1697862926.htm",null,"2");
navigation[81] = new navElem(81,"astra g cabrio","pi20286439.htm",80,"020-030");
navigation[82] = new navElem(82,"motor/auspuff","pi1846347780.htm",81,"220-030020");
navigation[83] = new navElem(83,"fahrwerk/tieferlegung","pi-92405579.htm",81,"220-030050");
navigation[84] = new navElem(84,"aerodynamik","pi-1593262638.htm",81,"220-030060");
navigation[85] = new navElem(85,"interieur","pi60033515.htm",81,"220-030080");
navigation[86] = new navElem(86,"felgen","pi-978395056.htm",81,"220-030090");
navigation[87] = new navElem(87,"kompletträder","pi1631931921.htm",81,"220-030100");
navigation[88] = new navElem(88,"astra f","pi-1632919215.htm",80,"220-010");
navigation[89] = new navElem(89,"motor/auspuff","pi1432138656.htm",88,"220-010020");
navigation[90] = new navElem(90,"fahrwerk/tieferlegung","pi313348897.htm",88,"220-010050");
navigation[91] = new navElem(91,"aerodynamik","pi-462994738.htm",88,"220-010060");
navigation[92] = new navElem(92,"interieur","pi430690871.htm",88,"220-010080");
navigation[93] = new navElem(93,"felgen","pi-1664000596.htm",88,"220-010090");
navigation[94] = new navElem(94,"kompletträder","pi-1175060675.htm",88,"220-010100");
navigation[95] = new navElem(95,"astra g","pi-1772478146.htm",80,"220-020");
navigation[96] = new navElem(96,"motor/auspuff","pi298757050.htm",95,"220-020020");
navigation[97] = new navElem(97,"fahrwerk/tieferlegung","pi-1675801677.htm",95,"220-020050");
navigation[98] = new navElem(98,"aerodynamik","pi1894326392.htm",95,"220-020060");
navigation[99] = new navElem(99,"interieur","pi304514329.htm",95,"220-020080");
navigation[100] = new navElem(100,"felgen","pi1436146534.htm",95,"220-020090");
navigation[101] = new navElem(101,"kompletträder","pi-1565969169.htm",95,"220-020100");
navigation[102] = new navElem(102,"astra g coupe","pi148578716.htm",80,"220-040");
navigation[103] = new navElem(103,"motor/auspuff","pi1284636414.htm",102,"220-040020");
navigation[104] = new navElem(104,"fahrwerk/tieferlegung","pi-364771673.htm",102,"220-040050");
navigation[105] = new navElem(105,"aerodynamik","pi643118428.htm",102,"220-040060");
navigation[106] = new navElem(106,"interieur","pi-706016979.htm",102,"220-040080");
navigation[107] = new navElem(107,"felgen","pi-288421142.htm",102,"220-040090");
navigation[108] = new navElem(108,"kompletträder","pi-1498208477.htm",102,"220-040100");
navigation[109] = new navElem(109,"corsa c","pi1810153656.htm",80,"220-061");
navigation[110] = new navElem(110,"motor/auspuff","pi-415708506.htm",109,"110-050020");
navigation[111] = new navElem(111,"fahrwerk/tieferlegung","pi-1769159889.htm",109,"110-050050");
navigation[112] = new navElem(112,"aerodynamik","pi249203012.htm",109,"110-050060");
navigation[113] = new navElem(113,"interieur","pi-256034571.htm",109,"110-050080");
navigation[114] = new navElem(114,"felgen","pi-2035343086.htm",109,"110-050090");
navigation[115] = new navElem(115,"kompletträder","pi1862204459.htm",109,"110-050100");
navigation[116] = new navElem(116,"tigra","pi-1894533162.htm",80,"220-100");
navigation[117] = new navElem(117,"motor/auspuff","pi-1590518352.htm",116,"220-100020");
navigation[118] = new navElem(118,"fahrwerk/tieferlegung","pi-879634447.htm",116,"220-100050");
navigation[119] = new navElem(119,"aerodynamik","pi-672826530.htm",116,"220-100060");
navigation[120] = new navElem(120,"interieur","pi-1582488697.htm",116,"220-100080");
navigation[121] = new navElem(121,"felgen","pi2015004860.htm",116,"220-100090");
navigation[122] = new navElem(122,"kompletträder","pi1988292877.htm",116,"220-100100");
navigation[123] = new navElem(123,"vectra b","pi622957727.htm",80,"220-110");
navigation[124] = new navElem(124,"motor/auspuff","pi1003883850.htm",123,"220-110020");
navigation[125] = new navElem(125,"fahrwerk/tieferlegung","pi890294787.htm",123,"220-110050");
navigation[126] = new navElem(126,"aerodynamik","pi576953480.htm",123,"220-110060");
navigation[127] = new navElem(127,"interieur","pi69514217.htm",123,"220-110080");
navigation[128] = new navElem(128,"felgen","pi-514394634.htm",123,"220-110090");
navigation[129] = new navElem(129,"kompletträder","pi-322682817.htm",123,"220-110100");
navigation[130] = new navElem(130,"vectra c","pi359522293.htm",80,"220-111");
navigation[131] = new navElem(131,"interieur","pi910394383.htm",130,"110-10080");
navigation[132] = new navElem(132,"kompletträder","pi1620665557.htm",130,"220-111100");
navigation[133] = new navElem(133,"motor/auspuff","pi-200958184.htm",130,"220-11120");
navigation[134] = new navElem(134,"fahrwerk/tieferlegung","pi1072465721.htm",130,"220-11150");
navigation[135] = new navElem(135,"aerodynamik","pi793836294.htm",130,"220-11160");
navigation[136] = new navElem(136,"felgen","pi725856420.htm",130,"220-11190");
navigation[137] = new navElem(137,"vectra gts","pi1875278866.htm",80,"220-112");
navigation[138] = new navElem(138,"kompletträder","pi-2033460793.htm",137,"220-112100");
navigation[139] = new navElem(139,"motor/auspuff","pi-1748101262.htm",137,"220-11220");
navigation[140] = new navElem(140,"fahrwerk/tieferlegung","pi-87389429.htm",137,"220-11250");
navigation[141] = new navElem(141,"aerodynamik","pi-632925456.htm",137,"220-11260");
navigation[142] = new navElem(142,"interieur","pi-1730137039.htm",137,"220-11280");
navigation[143] = new navElem(143,"felgen","pi630010526.htm",137,"220-11290");
navigation[144] = new navElem(144,"vectra caravan","pi601619243.htm",80,"220-113");
navigation[145] = new navElem(145,"kompletträder","pi-1398810583.htm",144,"220-113100");
navigation[146] = new navElem(146,"motor/auspuff","pi-1505881604.htm",144,"220-11320");
navigation[147] = new navElem(147,"fahrwerk/tieferlegung","pi-1877896883.htm",144,"220-11350");
navigation[148] = new navElem(148,"aerodynamik","pi-1377716086.htm",144,"220-11360");
navigation[149] = new navElem(149,"interieur","pi1291414595.htm",144,"220-11380");
navigation[150] = new navElem(150,"felgen","pi-1596180024.htm",144,"220-11390");
navigation[151] = new navElem(151,"signum","pi1085765030.htm",80,"220-114");
navigation[152] = new navElem(152,"kompletträder","pi1422247327.htm",151,"220-114100");
navigation[153] = new navElem(153,"motor/auspuff","pi-1443490262.htm",151,"220-11420");
navigation[154] = new navElem(154,"fahrwerk/tieferlegung","pi816554339.htm",151,"220-11450");
navigation[155] = new navElem(155,"aerodynamik","pi1793740904.htm",151,"220-11460");
navigation[156] = new navElem(156,"interieur","pi1634570825.htm",151,"220-11480");
navigation[157] = new navElem(157,"felgen","pi1995459798.htm",151,"220-11490");
navigation[158] = new navElem(158,"Accessoires","pi1244618813.htm",80,"220-140");
navigation[159] = new navElem(159,"Artikel","pi957003962.htm",158,"220-140-9");

// 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"));


