//
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="13" 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="12" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcatact.gif" width="12" height="12" 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="12" height="12" 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="13" 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,"Absinthe","pi1062258797.htm",null,"1-1-0");
navigation[1] = new navElem(1,"Absinthe-Geschenksets&nbsp(11)","pi1068318089.htm",0,"1-1-0-1");
navigation[2] = new navElem(2,"Absinthe aus Tschechien allg.&nbsp(16)","pi1870997802.htm",0,"1-1-1");
navigation[3] = new navElem(3,"CAMI Absinthe aus CZ&nbsp(8)","pi904132707.htm",0,"1-1-2");
navigation[4] = new navElem(4,"L`OR Absinthe aus CZ&nbsp(15)","pi-2099658423.htm",0,"1-1-4");
navigation[5] = new navElem(5,"MARTIN SEBOR Absinthe aus CZ&nbsp(13)","pi-1275356312.htm",0,"1-1-3");
navigation[6] = new navElem(6,"HAVEL`S Absinthe aus CZ&nbsp(2)","pi1227788246.htm",0,"1-1-5");
navigation[7] = new navElem(7,"ZELENA MUZA Absinthe aus CZ&nbsp(3)","pi-102134625.htm",0,"1-1-6");
navigation[8] = new navElem(8,"FRUKO SCHULZ Absinthe aus CZ&nbsp(5)","pi254054900.htm",0,"1-1-7");
navigation[9] = new navElem(9,"Absinthe aus der SCHWEIZ&nbsp(13)","pi-1196267200.htm",0,"1-2-2");
navigation[10] = new navElem(10,"Absinthe aus DEUTSCHLAND&nbsp(14)","pi-773062591.htm",0,"1-2-3");
navigation[11] = new navElem(11,"Absinthe aus FRANKREICH&nbsp(34)","pi-1248412517.htm",0,"1-2-0");
navigation[12] = new navElem(12,"Absinthe aus SPANIEN&nbsp(16)","pi1032773605.htm",0,"1-1-8");
navigation[13] = new navElem(13,"Absinthe aus ÖSTERREICH&nbsp(3)","pi1870993730.htm",0,"1-1-9");
navigation[14] = new navElem(14,"Absinthe aus ANDORRA","pi1062330120.htm",0,"1-2-1");
navigation[15] = new navElem(15,"Absinthe aus BULGARIEN&nbsp(2)","pi894178719.htm",0,"1-2-4");
navigation[16] = new navElem(16,"Absinthe aus Italien&nbsp(1)","pi1090269707.htm",0,"1-2-5-1");
navigation[17] = new navElem(17,"Absinthe aus USA","pi1069344699.htm",0,"1-2-5");
navigation[18] = new navElem(18,"Absinthe aus Brasilien&nbsp(1)","pi1118770116.htm",0,"1-2-5-2");
navigation[19] = new navElem(19,"Absinthe über 20 mg/Kg Thujon&nbsp(19)","pi2046194030.htm",0,"1-2-6");
navigation[20] = new navElem(20,"Absinthe-Essenz&nbsp(2)","pi1096387616.htm",0,"1-2-6-1");
navigation[21] = new navElem(21,"Absinthe Zubehör","pi-1883585449.htm",null,"1-2-7");
navigation[22] = new navElem(22,"Absinthe Löffel&nbsp(23)","pi-2067612067.htm",21,"1-2-7-2");
navigation[23] = new navElem(23,"Absinthe-Gläser&nbsp(20)","pi-1292194484.htm",21,"1-2-7-1");
navigation[24] = new navElem(24,"Absinthe Karaffen&nbsp(7)","pi1993190924.htm",21,"1-2-7-3");
navigation[25] = new navElem(25,"Absinthe Fontaines&nbsp(8)","pi-746388390.htm",21,"1-2-7-5");
navigation[26] = new navElem(26,"Absinthe Bonques&nbsp(3)","pi-1947461741.htm",21,"1-2-7-4");
navigation[27] = new navElem(27,"Sonstiges Absinthe Zubehör&nbsp(15)","pi-1200578605.htm",21,"1-2-7-6");
navigation[28] = new navElem(28,"MINI-FLASCHEN&nbsp(21)","pi-1323062760.htm",null,"2-0");
navigation[29] = new navElem(29,"CANNABIS WODKA+WASSERPFEIFE&nbsp(4)","pi1008105017.htm",null,"3-0");
navigation[30] = new navElem(30,"KRÄUTERLIKÖR BECHEROVKA&nbsp(1)","pi-278266362.htm",null,"4-0");
navigation[31] = new navElem(31,"WODKA+RUM aus CZ&nbsp(5)","pi861604623.htm",null,"5-0");
navigation[32] = new navElem(32,"KRÄUTERSCHNÄPSE+HEILSCHNÄPSE aus CZ&nbsp(15)","pi-1951372380.htm",null,"6-0");
navigation[33] = new navElem(33,"HAVANA CLUB RUM aus CUBA&nbsp(5)","pi1757585378.htm",null,"7-0");

// 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"));

