//
function miniCart(){
var prdCount = 0, prdString = "", subTotal = (xmlConfig.cartSubTotal > 0)?xmlConfig.cartSubTotal:0;
var tmpVariants = "", strVariants = "";
var mbullet = '<img src="assets/images/bullet.gif" width="13" height="10" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">';
	if(xmlOHeader.childNodes.length==0) subTotal = 0;
	for(var i=0;i<xmlOHeader.childNodes.length;i++){
		prdCount = prdCount+(parseInt(xmlOHeader.childNodes[i].QuantityAmount));
		};
	prdString += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"100%\">";
		if(prdCount > 0){
		prdString += "<tr>"
			+ "<td colspan=\"2\">"
				+ "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"100%\">"
						+ "<td align=\"right\" nowrap=\"true\" width=\"20\">#&nbsp;</td>"
						+ "<td><strong>Bezeichnung</strong></td>"
						+ "<td align=\"center\" width=\"40\" nowrap=\"true\"><strong>Preis</strong></td>"
					+ "</tr>";
				for(var i=0;i<xmlOHeader.childNodes.length;i++){
				tmpVariants = xmlOHeader.childNodes[i].getFirstItem("Internal").variants.split("@");
				if(tmpVariants.length>1){
					for(var j=0;j<tmpVariants.length-1;j++){
						tmpElement = tmpVariants[j].split(";");
						strVariants += "search" + j + "_EQ_" + tmpElement[1] + "_AND_";
						};
					strVariants += "{EOL}";
					};
					prdString += "<tr valign=\"top\">"
						+ "<td align=\"right\">" + xmlOHeader.childNodes[i].QuantityAmount + "&nbsp;</td>"
						+ "<td>"
							+ "<a href=\"" + xmlOHeader.childNodes[i].getFirstItem("Internal").address + "?defaultVariants=" + strVariants + "&categoryId=" + xmlOHeader.childNodes[i].getFirstItem("Internal").navIndex + "\">"
							+ xmlOHeader.childNodes[i].Name
						+ "</a></td>"
						+ "<td align=\"right\" nowrap=\"true\">" + (parseFloat(xmlOHeader.childNodes[i].PriceGrossLineTotalLC).toFixed(2)).toString().replace('.',',') + "</td>"
						+ "</tr>";
					};
	prdString += "</table><br>"	
			+ "</td>"
		+ "</tr>"
		+ "<tr>"
			+ "<td align=\"right\" nowrap=\"true\" width=\"20\"><strong>" + prdCount + "</strong>&nbsp;</td>"
			+ "<td align=\"right\"><strong>&nbsp;" + TFormatCurrency(subTotal, objPriCurrency) + "</strong><td>"
		+ "</tr>"
		+ "<tr align=\"right\">"
			+ "<td colspan=\"2\"><a class=\"WAGRUNAV\" href=\"orderform." + xmlConfig.fileExtension + "\">"
			+ mbullet + "<strong>Zum Bestellschein</strong></a>"
			+ "</td>"
		+ "</tr>";
	}
	else{
		prdString += "<tr>"
			+ "<td>"
			+ "<td>Ihr Bestellschein ist leer...</td>"
			+ "</tr>";
		};
	prdString += "</table>";
	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/bulletcat1st.gif" width="13" height="10" 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,"Kompletträder","pi-1456837009.htm",null,"126");
navigation[1] = new navElem(1,"Eastern Bikes","pi-21540884.htm",0,"126-179");
navigation[2] = new navElem(2,"Eastern Bikes - MTB","pi2035637367.htm",1,"126-179-2");
navigation[3] = new navElem(3,"Eastern Bikes - BMX","pi1160488927.htm",1,"126-179-1");
navigation[4] = new navElem(4,"GT USA","pi-2143876380.htm",0,"126-133");
navigation[5] = new navElem(5,"GT USA - Allround","pi-642657311.htm",4,"126-133-6");
navigation[6] = new navElem(6,"GT USA - X Country | All Mountain","pi1109272898.htm",4,"126-133-2");
navigation[7] = new navElem(7,"GT USA - Downhill | Freeride | Dirt","pi-1939004540.htm",4,"126-133-1");
navigation[8] = new navElem(8,"GT USA - BMX","pi-65748409.htm",4,"126-133-5");
navigation[9] = new navElem(9,"Mongoose","pi-1617349257.htm",0,"126-188");
navigation[10] = new navElem(10,"Mongoose - All Mountain | Enduro","pi-173589910.htm",9,"126-188-2");
navigation[11] = new navElem(11,"Mongoose - Downhill | Freeride | Dirt","pi1220880045.htm",9,"126-188-1");
navigation[12] = new navElem(12,"Mongoose - BMX","pi1969258659.htm",9,"126-188-3");
navigation[13] = new navElem(13,"Morewood","pi1257448573.htm",0,"126-176");
navigation[14] = new navElem(14,"NOX Cycles","pi510136066.htm",0,"126-134");
navigation[15] = new navElem(15,"NOX Cycles - X Country | All Mountain","pi1115013653.htm",14,"126-134-1");
navigation[16] = new navElem(16,"NOX Cycles - Downhill | Freeride | Dirt","pi1464990642.htm",14,"126-134-2");
navigation[17] = new navElem(17,"Schwinn","pi2011602290.htm",0,"126-195");
navigation[18] = new navElem(18,"Schwinn - Cruiser","pi-411166453.htm",17,"126-195-1");
navigation[19] = new navElem(19,"Schwinn - Fixies","pi1198147824.htm",17,"126-195-2");
navigation[20] = new navElem(20,"We The People","pi-1422128481.htm",0,"126-189");
navigation[21] = new navElem(21,"Rahmen","pi-1706277783.htm",null,"101");
navigation[22] = new navElem(22,"GT","pi361568841.htm",21,"101-133");
navigation[23] = new navElem(23,"Morewood","pi-1667794313.htm",21,"101-176");
navigation[24] = new navElem(24,"NOX Cycles","pi-303710476.htm",21,"101-134");
navigation[25] = new navElem(25,"Transition Bikes","pi-710688058.htm",21,"101-196");
navigation[26] = new navElem(26,"Gabeln","pi1914592374.htm",null,"102");
navigation[27] = new navElem(27,"DMR","pi1431261698.htm",26,"102-171");
navigation[28] = new navElem(28,"Fox Forx","pi1188083310.htm",26,"102-149");
navigation[29] = new navElem(29,"Marzocchi - Downhill | Freeride | Dirt","pi970966877.htm",26,"102-164-1");
navigation[30] = new navElem(30,"Marzocchi - Cross Country | All Mountain | Allround","pi-1807569072.htm",26,"102-164-2");
navigation[31] = new navElem(31,"Naben","pi-1940410476.htm",null,"104");
navigation[32] = new navElem(32,"Chris King","pi-1330382212.htm",31,"104-172");
navigation[33] = new navElem(33,"DT Swiss","pi-1715887673.htm",31,"104-108");
navigation[34] = new navElem(34,"NOX Cycles","pi830289211.htm",31,"104-134");
navigation[35] = new navElem(35,"Point","pi1121229133.htm",31,"104-140");
navigation[36] = new navElem(36,"Ringlé","pi1398415498.htm",31,"104-110");
navigation[37] = new navElem(37,"Shock Therapy","pi531292616.htm",31,"104-148");
navigation[38] = new navElem(38,"White Industries","pi-1164133066.htm",31,"104-153");
navigation[39] = new navElem(39,"Bereifung","pi47181794.htm",null,"106");
navigation[40] = new navElem(40,"Continental","pi-1373110700.htm",39,"106-114");
navigation[41] = new navElem(41,"IRC","pi-1745118665.htm",39,"106-125");
navigation[42] = new navElem(42,"Point","pi-1489021829.htm",39,"106-140");
navigation[43] = new navElem(43,"Maxxis","pi1137204128.htm",39,"106-107");
navigation[44] = new navElem(44,"Schwalbe","pi2052795086.htm",39,"106-120");
navigation[45] = new navElem(45,"Bremsen","pi1586640571.htm",null,"107");
navigation[46] = new navElem(46,"Avid","pi2122810796.htm",45,"107-124");
navigation[47] = new navElem(47,"Avid - Disc","pi250283837.htm",45,"107-124D");
navigation[48] = new navElem(48,"Formula - Disc","pi18947474.htm",45,"107-185");
navigation[49] = new navElem(49,"Hayes - Disc","pi-717646925.htm",45,"107-137");
navigation[50] = new navElem(50,"Bremshebel","pi1151312096.htm",null,"108");
navigation[51] = new navElem(51,"Avid","pi1639712949.htm",50,"108-124");
navigation[52] = new navElem(52,"Steuersätze","pi1087991022.htm",null,"125");
navigation[53] = new navElem(53,"Alutech","pi634391544.htm",52,"125-112");
navigation[54] = new navElem(54,"Chris King","pi833659524.htm",52,"125-172");
navigation[55] = new navElem(55,"FSA","pi-745145897.htm",52,"125-116");
navigation[56] = new navElem(56,"NOX Cycles","pi-1808138880.htm",52,"125-134");
navigation[57] = new navElem(57,"Sunline","pi-531210970.htm",52,"125-193");
navigation[58] = new navElem(58,"Vorbauten","pi1385727841.htm",null,"109");
navigation[59] = new navElem(59,"FSA","pi-711847635.htm",58,"109-116");
navigation[60] = new navElem(60,"Kore USA","pi-1715176836.htm",58,"109-192");
navigation[61] = new navElem(61,"NOX cycles","pi-262442262.htm",58,"109-134");
navigation[62] = new navElem(62,"Point","pi298938147.htm",58,"109-140");
navigation[63] = new navElem(63,"Shock Therapy","pi1296504329.htm",58,"109-148");
navigation[64] = new navElem(64,"Sunline","pi2013719911.htm",58,"109-193");
navigation[65] = new navElem(65,"Titec","pi-2004159082.htm",58,"109-122");
navigation[66] = new navElem(66,"Truvativ","pi-795742369.htm",58,"109-131");
navigation[67] = new navElem(67,"Lenker","pi1102115342.htm",null,"110");
navigation[68] = new navElem(68,"Kore USA","pi-982451547.htm",67,"110-192");
navigation[69] = new navElem(69,"NOX cycles","pi83329280.htm",67,"110-134");
navigation[70] = new navElem(70,"Shock Therapy","pi-730251497.htm",67,"110-148");
navigation[71] = new navElem(71,"Sunline","pi1447943939.htm",67,"110-193");
navigation[72] = new navElem(72,"Syncros","pi-1414786789.htm",67,"110-191");
navigation[73] = new navElem(73,"Titec","pi-625032948.htm",67,"110-122");
navigation[74] = new navElem(74,"Truvativ","pi-604457187.htm",67,"110-131");
navigation[75] = new navElem(75,"Stützen","pi71802604.htm",null,"112");
navigation[76] = new navElem(76,"Kore USA","pi-207475271.htm",75,"112-192");
navigation[77] = new navElem(77,"NOX cycles","pi-93567568.htm",75,"112-134");
navigation[78] = new navElem(78,"Titec","pi1297572702.htm",75,"112-122");
navigation[79] = new navElem(79,"Truvativ","pi-1658655865.htm",75,"112-131");
navigation[80] = new navElem(80,"Sättel","pi945747837.htm",null,"113");
navigation[81] = new navElem(81,"Kore USA","pi1258390197.htm",80,"113-192");
navigation[82] = new navElem(82,"NOX cycles","pi-820826328.htm",80,"113-134");
navigation[83] = new navElem(83,"Innenlager","pi1766575866.htm",null,"114");
navigation[84] = new navElem(84,"SR Suntour","pi-1045414935.htm",83,"114-146");
navigation[85] = new navElem(85,"Truvativ","pi-1894916618.htm",83,"114-131");
navigation[86] = new navElem(86,"Kurbeln","pi-87556621.htm",null,"115");
navigation[87] = new navElem(87,"FSA","pi2046248069.htm",86,"115-116");
navigation[88] = new navElem(88,"Shock Therapy","pi-1760550002.htm",86,"115-148");
navigation[89] = new navElem(89,"SR Suntour","pi-1421356041.htm",86,"115-146");
navigation[90] = new navElem(90,"Truvativ","pi248523884.htm",86,"115-131");
navigation[91] = new navElem(91,"Kettenführungen","pi-1055918664.htm",null,"116");
navigation[92] = new navElem(92,"FSA","pi1943891482.htm",91,"116-116");
navigation[93] = new navElem(93,"MRP","pi2043341171.htm",91,"116-109");
navigation[94] = new navElem(94,"Point","pi338189112.htm",91,"116-140");
navigation[95] = new navElem(95,"Truvativ","pi-2096342823.htm",91,"116-131");
navigation[96] = new navElem(96,"Pedale","pi479297881.htm",null,"117");
navigation[97] = new navElem(97,"Atomlab","pi1637494447.htm",96,"117-141");
navigation[98] = new navElem(98,"DMR","pi2056826838.htm",96,"117-171");
navigation[99] = new navElem(99,"Eastern Bikes","pi58736286.htm",96,"117-179");
navigation[100] = new navElem(100,"Kore USA","pi-304244020.htm",96,"117-192");
navigation[101] = new navElem(101,"NOX Cycles","pi1693278250.htm",96,"117-134");
navigation[102] = new navElem(102,"Point","pi-1301249390.htm",96,"117-140");
navigation[103] = new navElem(103,"Sunline","pi-605519094.htm",96,"117-193");
navigation[104] = new navElem(104,"Truvativ","pi-1114234965.htm",96,"117-131");
navigation[105] = new navElem(105,"Ketten/Kettenspanner","pi420065958.htm",null,"118");
navigation[106] = new navElem(106,"SRAM","pi-1586210351.htm",105,"118-118");
navigation[107] = new navElem(107,"Kassetten","pi146115375.htm",null,"119");
navigation[108] = new navElem(108,"SRAM","pi-1619068825.htm",107,"119-118");
navigation[109] = new navElem(109,"Shifter","pi-1011502780.htm",null,"120");
navigation[110] = new navElem(110,"SRAM","pi-1614786323.htm",109,"120-118");
navigation[111] = new navElem(111,"Schaltwerke","pi-1590476555.htm",null,"121");
navigation[112] = new navElem(112,"SRAM","pi997242083.htm",111,"121-118");
navigation[113] = new navElem(113,"Zubehör","pi-1259090374.htm",111,"121-999");
navigation[114] = new navElem(114,"Umwerfer","pi1527059351.htm",null,"130");
navigation[115] = new navElem(115,"SRAM","pi413835165.htm",114,"129-118");
navigation[116] = new navElem(116,"Bekleidung","pi-1767995118.htm",null,"122");
navigation[117] = new navElem(117,"Race Face","pi-1030235020.htm",116,"122-139");
navigation[118] = new navElem(118,"Royal Racing","pi1724583714.htm",116,"122-194");
navigation[119] = new navElem(119,"Jerseys","pi533345531.htm",118,"122-194-01");
navigation[120] = new navElem(120,"Hosen","pi-639315424.htm",118,"122-194-02");
navigation[121] = new navElem(121,"Jackets","pi-905859167.htm",118,"122-194-03");
navigation[122] = new navElem(122,"Caps und Accessories","pi-1990818482.htm",118,"122-194-04");
navigation[123] = new navElem(123,"Shirts","pi762938039.htm",118,"122-194-05");
navigation[124] = new navElem(124,"Troy Lee Designs","pi-1856446775.htm",116,"122-175");
navigation[125] = new navElem(125,"Handschuhe","pi1110192149.htm",124,"122-175-01");
navigation[126] = new navElem(126,"Helme","pi1161093766.htm",124,"122-175-07");
navigation[127] = new navElem(127,"Jerseys","pi-1321774670.htm",124,"122-175-02");
navigation[128] = new navElem(128,"Hosen","pi1285507147.htm",124,"122-175-03");
navigation[129] = new navElem(129,"Protektoren","pi1857230640.htm",124,"122-175-04");
navigation[130] = new navElem(130,"Sonstiges","pi1536200926.htm",124,"122-175-06");
navigation[131] = new navElem(131,"Casual Wear","pi944780145.htm",130,"122-175-05");
navigation[132] = new navElem(132,"Sonstige","pi215058715.htm",116,"122-999");
navigation[133] = new navElem(133,"Werkzeug","pi1401177131.htm",null,"123");
navigation[134] = new navElem(134,"Pocket Tools","pi-1575003945.htm",133,"123-01");
navigation[135] = new navElem(135,"DVDs","pi-653937626.htm",null,"129");

// 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"));

