//
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 = false;
		this.categoryId = categoryId;
		};
// navigation
var navigation = new Array();
//
navigation[0] = new navElem(0,"BETA Motorräder","pi-881750530.htm",null,"A");
navigation[1] = new navElem(1,"BETA Online Ersatzteilbestellung","pi-1314303486.htm",null,"B");
navigation[2] = new navElem(2,"BETA Ersatzteile","pi1263993109.htm",1,"3.1");
navigation[3] = new navElem(3,"BETA RR4T Spezial- und Zubehörteile","pi-1013306822.htm",null,"C");
navigation[4] = new navElem(4,"RR 250/400/450/525 4T 2005-2009","pi1108738412.htm",3,"C1");
navigation[5] = new navElem(5,"BETA Original Werksteile","pi1326550340.htm",4,"C11");
navigation[6] = new navElem(6,"Wartung und Inspektion","pi-1476334347.htm",4,"C12");
navigation[7] = new navElem(7,"Fahrwerk, Kupplung und Bremsen","pi-1857174254.htm",4,"C13");
navigation[8] = new navElem(8,"Antrieb","pi-734408661.htm",4,"C14");
navigation[9] = new navElem(9,"Sonstige Teile","pi-1292879472.htm",4,"C15");
navigation[10] = new navElem(10,"RR 350/400/450/498/520 4T ab 2010","pi1279280614.htm",3,"C2");
navigation[11] = new navElem(11,"BETA Original Werksteile","pi-1502712544.htm",10,"C21");
navigation[12] = new navElem(12,"Wartung und Inspektion","pi527691425.htm",10,"C22");
navigation[13] = new navElem(13,"Fahrwerk, Kupplung und Bremsen","pi-217737138.htm",10,"C23");
navigation[14] = new navElem(14,"Antrieb","pi-867051081.htm",10,"C24");
navigation[15] = new navElem(15,"Sonstige Teile","pi-1324503953.htm",10,"C25");
navigation[16] = new navElem(16,"BETA ALP 125/200/4.0 Spezial- und Zubehörteile","pi-796293069.htm",null,"D");
navigation[17] = new navElem(17,"Alp 125/200","pi-1574615043.htm",16,"D1");
navigation[18] = new navElem(18,"BETA Original Werksteile","pi1326910971.htm",17,"D11");
navigation[19] = new navElem(19,"Wartung und Inspektion","pi716183546.htm",17,"D12");
navigation[20] = new navElem(20,"Fahrwerk, Kupplung und Bremsen","pi579636134.htm",17,"D13");
navigation[21] = new navElem(21,"Antrieb","pi-1347623012.htm",17,"D14");
navigation[22] = new navElem(22,"Geländeeinsatz und Optik","pi-2102133149.htm",17,"D16");
navigation[23] = new navElem(23,"Alp 4.0","pi1801153171.htm",16,"D2");
navigation[24] = new navElem(24,"BETA Original Werksteile","pi1191088793.htm",23,"D21");
navigation[25] = new navElem(25,"Wartung und Inspektion","pi1531891326.htm",23,"D22");
navigation[26] = new navElem(26,"Fahrwerk, Kupplung und Bremsen","pi2076665512.htm",23,"D23");
navigation[27] = new navElem(27,"Antrieb","pi1908091522.htm",23,"D24");
navigation[28] = new navElem(28,"Auspuff, Motor und Vergaser","pi131485847.htm",23,"D25");
navigation[29] = new navElem(29,"Geländeeinsatz und Optik","pi-41979885.htm",23,"D26");
navigation[30] = new navElem(30,"Lenker","pi1153937941.htm",23,"D27");
navigation[31] = new navElem(31,"BETA M4/Motard 4.0 Spezial- und Zubehörteile","pi-1404103271.htm",null,"E");
navigation[32] = new navElem(32,"BETA Original Werksteile","pi1326914875.htm",31,"E1");
navigation[33] = new navElem(33,"Wartung und Inspektion","pi-71964163.htm",31,"E2");
navigation[34] = new navElem(34,"Fahrwerk und Bremsen","pi2015635887.htm",31,"E3");
navigation[35] = new navElem(35,"Antrieb","pi1970078581.htm",31,"E4");
navigation[36] = new navElem(36,"Auspuff, Motor und Vergaser","pi29508112.htm",31,"E5");
navigation[37] = new navElem(37,"BETA URBAN 125/200 Spezial- und Zubehörteile","pi-2041920776.htm",null,"F");
navigation[38] = new navElem(38,"BETA Original Werksteile","pi-1404474437.htm",37,"F1");
navigation[39] = new navElem(39,"BETA RR 125 Spezial- und Zubehörteile","pi-2138160666.htm",null,"G");
navigation[40] = new navElem(40,"BETA Trial Spezial- und Zubehörteile","pi-474597009.htm",null,"H");
navigation[41] = new navElem(41,"BETA Bekleidung & Accessiors","pi1140711841.htm",null,"I");
navigation[42] = new navElem(42,"BETA Endurobekleidung","pi261574478.htm",41,"8.1");
navigation[43] = new navElem(43,"BETA Freizeitbekleidung und Accessoirs","pi2086208695.htm",41,"8.2");
navigation[44] = new navElem(44,"BETA Trialbekleidung","pi-1529345952.htm",41,"8.3");
navigation[45] = new navElem(45,"BETA Team-Equipement","pi1394590330.htm",41,"8.4");
navigation[46] = new navElem(46,"Endurobekleidung und Fahrerausstattung","pi1234273949.htm",null,"J");
navigation[47] = new navElem(47,"Protektoren und Neck Braces","pi1238596875.htm",null,"K");
navigation[48] = new navElem(48,"Endurozubehör","pi1234540350.htm",null,"L");
navigation[49] = new navElem(49,"Rallye und Navigation","pi1109082522.htm",null,"M");
navigation[50] = new navElem(50,"MD-Roadbookhalter","pi-825639774.htm",49,"M1");
navigation[51] = new navElem(51,"Touratech Roadbookhalter","pi393196667.htm",49,"M2");
navigation[52] = new navElem(52,"ICO-Tripmaster","pi1921596320.htm",49,"M3");
navigation[53] = new navElem(53,"Touratech Motorradcomputer","pi900807457.htm",49,"M4");
navigation[54] = new navElem(54,"Rallye-Vorbauten","pi-1686071452.htm",49,"M5");
navigation[55] = new navElem(55,"Rallyeparts","pi-1029802859.htm",49,"M6");
navigation[56] = new navElem(56,"GPS Navigation","pi-241290249.htm",49,"M7");
navigation[57] = new navElem(57,"Werkzeug, Öle, Pflege- und Schmiermittel","pi1536919452.htm",null,"N");
navigation[58] = new navElem(58,"Motoröle","pi-1696324627.htm",57,"N1");
navigation[59] = new navElem(59,"Getriebeöle","pi1285635754.htm",57,"N2");
navigation[60] = new navElem(60,"Gabelöle","pi790937571.htm",57,"N3");
navigation[61] = new navElem(61,"Hydraulische Kupplungsflüssigkeiten","pi396078312.htm",57,"N4");
navigation[62] = new navElem(62,"Kettenpflege","pi-1246374711.htm",57,"N5");
navigation[63] = new navElem(63,"Luftfilteröle- und Reiniger","pi1398996310.htm",57,"N6");
navigation[64] = new navElem(64,"Kühlflüssigkeiten","pi-1082012641.htm",57,"N7");
navigation[65] = new navElem(65,"Werkzeuge","pi-245610669.htm",57,"N8");
navigation[66] = new navElem(66,"Reifen und Schläuche","pi1327845159.htm",null,"O");
navigation[67] = new navElem(67,"Gebrauchtmotorräder","pi1119626734.htm",null,"P");
navigation[68] = new navElem(68,"Einzelstücke und Schnäppchen","pi1317682660.htm",null,"Q");
navigation[69] = new navElem(69,"fennek-tours specials","pi-461910089.htm",null,"R");
navigation[70] = new navElem(70,"Gutscheine","pi-409582697.htm",null,"S");
navigation[71] = new navElem(71,"KTM Ersatzteilservice","pi1395559057.htm",null,"T");

// 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"));


