//
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="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/bulletcatact.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/bulletcat1stcls.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/bulletcat1st.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 = true;
		this.categoryId = categoryId;
		};
// navigation
var navigation = new Array();
//
navigation[0] = new navElem(0,"Kürbiskernöl","pi1025420102.htm",null,"1");
navigation[1] = new navElem(1,"Kürbisknabberkerne ","pi1025336119.htm",null,"2");
navigation[2] = new navElem(2,"Schokolade - handgeschöpft","pi1177830563.htm",null,"145");
navigation[3] = new navElem(3,"Kürbiskernpesto","pi-1395995351.htm",null,"156");
navigation[4] = new navElem(4,"Chutney","pi-104396699.htm",null,"198");
navigation[5] = new navElem(5,"Kürbismarmeladen","pi-1964169165.htm",null,"134");
navigation[6] = new navElem(6,"Kernölkosmetik","pi1124183111.htm",null,"107");
navigation[7] = new navElem(7,"Liköre","pi698926484.htm",null,"29");
navigation[8] = new navElem(8,"Essig","pi1656091414.htm",null,"27");
navigation[9] = new navElem(9,"Essig-Öl-Kombinationen","pi691466948.htm",null,"6");
navigation[10] = new navElem(10,"Öle","pi1208789324.htm",null,"167");
navigation[11] = new navElem(11,"Kürbisknabbergebäck","pi1227528066.htm",null,"56");
navigation[12] = new navElem(12,"Essig-Kisterl","pi-958437338.htm",null,"169");
navigation[13] = new navElem(13,"Öl-Kisterl","pi1214840025.htm",null,"168");
navigation[14] = new navElem(14,"Kisterl mit einer Flasche","pi1155188132.htm",13,"118");
navigation[15] = new navElem(15,"Kisterl mit zwei Flaschen","pi961236108.htm",13,"115");
navigation[16] = new navElem(16,"Kisterl mit drei Flaschen","pi537017501.htm",13,"116");
navigation[17] = new navElem(17,"Genusspakete","pi1226578255.htm",null,"174");
navigation[18] = new navElem(18,"Geschenkskörbe, Geschenkskartons","pi892141436.htm",null,"122");
navigation[19] = new navElem(19,"Geschenk - Holzkassetten ","pi1152378610.htm",18,"112");
navigation[20] = new navElem(20,"Holzkassette - mittel","pi1192973184.htm",19,"157");
navigation[21] = new navElem(21,"Holzkassette - groß","pi2095239172.htm",19,"158");
navigation[22] = new navElem(22,"Geschenkkassetten","pi-1093574487.htm",18,"62");
navigation[23] = new navElem(23,"Geschenkkörbe","pi963793101.htm",18,"123");
navigation[24] = new navElem(24,"kleiner Korb aus Karton","pi-2092468016.htm",23,"126");
navigation[25] = new navElem(25,"kleiner Korb","pi1178955088.htm",23,"148");
navigation[26] = new navElem(26,"mittlerer Korb","pi2120881937.htm",23,"149");
navigation[27] = new navElem(27,"Kleine Geschenke - Probiersets","pi1110628178.htm",18,"58");
navigation[28] = new navElem(28,"Schatzkiste","pi1225974806.htm",null,"173");
navigation[29] = new navElem(29,"Kürbis - salzig","pi-174907180.htm",null,"133");
navigation[30] = new navElem(30,"Kürbiskernkräutersalz","pi1172063287.htm",29,"136");
navigation[31] = new navElem(31,"Kürbiskernmehl","pi1740728236.htm",29,"137");
navigation[32] = new navElem(32,"Kürbisbier","pi1046523626.htm",null,"32");
navigation[33] = new navElem(33,"Hausnudeln","pi1044807845.htm",null,"31");
navigation[34] = new navElem(34,"Steirische Weine","pi-1682030831.htm",null,"19");
navigation[35] = new navElem(35,"Schilcher Weine","pi1955795191.htm",34,"150");
navigation[36] = new navElem(36,"Schilcher-gleichgepresst","pi1253661060.htm",35,"44");
navigation[37] = new navElem(37,"Schilcher-Qualitätswein","pi1979798581.htm",35,"45");
navigation[38] = new navElem(38,"Schilcher-Kabinett","pi1085987320.htm",35,"40");
navigation[39] = new navElem(39,"Schilcher-Spätlese","pi1057393137.htm",35,"35");
navigation[40] = new navElem(40,"Schilcher-Rotweinausbau","pi1661942895.htm",35,"43");
navigation[41] = new navElem(41,"Schilcher-Auslese","pi-424861543.htm",35,"41");
navigation[42] = new navElem(42,"Steirische Weißweine","pi1238885740.htm",34,"151");
navigation[43] = new navElem(43,"Welschriesling","pi745221298.htm",42,"52");
navigation[44] = new navElem(44,"Weißburgunder - Pinot blanc","pi1086520854.htm",42,"48");
navigation[45] = new navElem(45,"Muskateller","pi-1626993257.htm",42,"49");
navigation[46] = new navElem(46,"Morillon - Chardonnay","pi-14566321.htm",42,"51");
navigation[47] = new navElem(47,"Grauburgunder","pi112151957.htm",42,"65");
navigation[48] = new navElem(48,"Rotwein aus der Steiermark","pi438270330.htm",34,"153");
navigation[49] = new navElem(49,"Blauer Portugieser/Blauer Zweigelt - Cuvee","pi-289923780.htm",48,"54");
navigation[50] = new navElem(50,"Blauer Wildbacher/Blauer Zweigelt - Cuvee","pi-2086597747.htm",48,"55");
navigation[51] = new navElem(51,"Blauer Zweigelt","pi1960729095.htm",48,"53");
navigation[52] = new navElem(52,"Sekt aus der Steiermark","pi840063997.htm",34,"152");
navigation[53] = new navElem(53,"Schilcherfrizzante","pi1741636938.htm",52,"47");
navigation[54] = new navElem(54,"Sekt","pi1086418929.htm",52,"46");
navigation[55] = new navElem(55,"Edelbrände","pi1043049359.htm",null,"28");
navigation[56] = new navElem(56,"Prosit Neujahr","pi1229964641.htm",null,"175");
navigation[57] = new navElem(57,"Honig","pi-804288890.htm",null,"60");
navigation[58] = new navElem(58,"Kräutertee","pi1109154436.htm",null,"57");
navigation[59] = new navElem(59,"Natursäfte","pi1042886121.htm",null,"26");
navigation[60] = new navElem(60,"Handarbeiten in Kreuzstich","pi1075196401.htm",null,"39");
navigation[61] = new navElem(61,"Pflanzenölseifen","pi1124627575.htm",null,"109");
navigation[62] = new navElem(62,"Geschenkkartons für alle Anlässe","pi1262170921.htm",null,"182");
navigation[63] = new navElem(63,"Geschenkkarton - klein","pi1178886444.htm",62,"147");
navigation[64] = new navElem(64,"Geschenkpackungen","pi1195659976.htm",62,"159");
navigation[65] = new navElem(65,"Geschenkkartons für alle Anlässe","pi612199817.htm",62,"66");
navigation[66] = new navElem(66,"Geschenkkarton -  8 €","pi1373999821.htm",65,"104");
navigation[67] = new navElem(67,"Geschenkkarton -  9 €","pi-1654655531.htm",65,"98");
navigation[68] = new navElem(68,"Geschenkkarton - 10 €","pi-1883941098.htm",65,"67");
navigation[69] = new navElem(69,"Geschenkkarton - 11 €","pi111022815.htm",65,"68");
navigation[70] = new navElem(70,"Geschenkkarton - 12 €","pi-880956620.htm",65,"69");
navigation[71] = new navElem(71,"Geschenkkarton - 13 €","pi1978126373.htm",65,"70");
navigation[72] = new navElem(72,"Geschenkkarton - 14 €","pi251712642.htm",65,"71");
navigation[73] = new navElem(73,"Geschenkkarton - 15 €","pi1868601141.htm",65,"72");
navigation[74] = new navElem(74,"Geschenkkarton - 16 €","pi-535547310.htm",65,"73");
navigation[75] = new navElem(75,"Geschenkkarton - 17 €","pi54690923.htm",65,"74");
navigation[76] = new navElem(76,"Geschenkkarton - 18 €","pi-1721145136.htm",65,"75");
navigation[77] = new navElem(77,"Geschenkkarton - 19 €","pi-810398575.htm",65,"76");
navigation[78] = new navElem(78,"Geschenkkarton - 20 €","pi-1033782402.htm",65,"77");
navigation[79] = new navElem(79,"Geschenkkarton - 21 €","pi-484366041.htm",65,"78");
navigation[80] = new navElem(80,"Geschenkkarton - 22 €","pi2123187676.htm",65,"79");
navigation[81] = new navElem(81,"Geschenkkarton - 23 €","pi1452863405.htm",65,"80");
navigation[82] = new navElem(82,"Geschenkkarton - 24 €","pi-361263254.htm",65,"81");
navigation[83] = new navElem(83,"Geschenkkarton - 25 €","pi-1190145381.htm",65,"82");
navigation[84] = new navElem(84,"Geschenkkarton - 26 €","pi-452107423.htm",65,"84");
navigation[85] = new navElem(85,"Geschenkkarton - 27 €","pi-2091074668.htm",65,"83");
navigation[86] = new navElem(86,"Geschenkkarton - 28 €","pi-780318188.htm",65,"85");
navigation[87] = new navElem(87,"Geschenkkarton - 30 €","pi1256904579.htm",65,"179");
navigation[88] = new navElem(88,"Geschenkkarton - 31 €","pi678105916.htm",65,"203");
navigation[89] = new navElem(89,"Geschenkkarton - 32 €","pi-1765481985.htm",65,"86");
navigation[90] = new navElem(90,"Geschenkkarton - 33 €","pi-723724390.htm",65,"204");
navigation[91] = new navElem(91,"Geschenkkarton - 34 €","pi677827540.htm",65,"87");
navigation[92] = new navElem(92,"Geschenkkarton - 35 €","pi-1039475286.htm",65,"205");
navigation[93] = new navElem(93,"Geschenkkarton - 36 €","pi1987993006.htm",65,"146");
navigation[94] = new navElem(94,"Geschenkkarton - 38 €","pi-2110464585.htm",65,"94");
navigation[95] = new navElem(95,"Geschenkkarton - 39 €","pi724337362.htm",65,"88");
navigation[96] = new navElem(96,"Geschenkkarton - 40 €","pi1329679302.htm",65,"206");
navigation[97] = new navElem(97,"Geschenkkarton - 41 €","pi452996410.htm",65,"95");
navigation[98] = new navElem(98,"Geschenkkarton - 43 €","pi-92850997.htm",65,"180");
navigation[99] = new navElem(99,"Geschenkkarton - 49 €","pi-729416622.htm",65,"90");
navigation[100] = new navElem(100,"Geschenkkarton - 50 €","pi1025438873.htm",65,"96");
navigation[101] = new navElem(101,"Geschenkkarton - 55 €","pi-2014293343.htm",65,"93");
navigation[102] = new navElem(102,"Geschenkkarton - 62 €","pi-1627075534.htm",65,"92");
navigation[103] = new navElem(103,"Geschenkkarton - 63 €","pi2105667324.htm",65,"181");
navigation[104] = new navElem(104,"Rezepte","pi1171886042.htm",null,"129");
navigation[105] = new navElem(105,"Walnussöl - Rezepte","pi347507836.htm",104,"130");
navigation[106] = new navElem(106,"Kürbiskernöl - Rezepte","pi666221494.htm",104,"131");
navigation[107] = new navElem(107,"Leinsamenöl - Rezepte","pi2122866165.htm",104,"141");
navigation[108] = new navElem(108,"Haselnussöl - Rezepte","pi-1114681138.htm",104,"142");
navigation[109] = new navElem(109,"Mandelöl - Rezepte","pi1174822423.htm",104,"143");
navigation[110] = new navElem(110,"Sesamöl - Rezepte","pi-1033462577.htm",104,"144");
navigation[111] = new navElem(111,"Weihnachtliche Geschenksvariationen ","pi1048432306.htm",null,"33");

// 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"));


