//
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 += "<br><a class=\"WAGRUNAV\" href=\"orderform." + xmlConfig.fileExtension + "\">";
	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\">Produkt Katalog</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-1; 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="3" 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="14" 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" 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" 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,"Sanitär","pi-610777181.htm",null,"1");
navigation[1] = new navElem(1,"Armaturen","pi1061709405.htm",0,"001SA");
navigation[2] = new navElem(2,"Eckventile","pi-735715750.htm",1,"5Armaturen");
navigation[3] = new navElem(3,"Brausen","pi1071913574.htm",0,"002SA");
navigation[4] = new navElem(4,"Handbrausen","pi1179666415.htm",3,"1Brausen");
navigation[5] = new navElem(5,"Hausmarke","pi1071936609.htm",4,"1HBR");
navigation[6] = new navElem(6,"Hansgrohe","pi1861720846.htm",4,"2HBR");
navigation[7] = new navElem(7,"HANSA","pi-1623833688.htm",4,"3HBR");
navigation[8] = new navElem(8,"Kopfbrausen","pi-1352184907.htm",3,"2Brausen");
navigation[9] = new navElem(9,"Brausenschläuche","pi226320132.htm",3,"6Brausen");
navigation[10] = new navElem(10,"Brausenhalter","pi1008467312.htm",9,"5Brausen");
navigation[11] = new navElem(11,"Accessoires","pi1072770596.htm",3,"8Brausen");
navigation[12] = new navElem(12,"Duschpaneele","pi1086271220.htm",0,"003SA");
navigation[13] = new navElem(13,"Solardusche","pi1084036487.htm",12,"3Duschen");
navigation[14] = new navElem(14,"Badewannen","pi-32438778.htm",0,"004SA");
navigation[15] = new navElem(15,"Serie Bavaria","pi844666614.htm",14,"2BW");
navigation[16] = new navElem(16,"Badewannenzubehör","pi-1045966037.htm",14,"4BW");
navigation[17] = new navElem(17,"Keramik","pi-903390679.htm",0,"005SA");
navigation[18] = new navElem(18,"Waschbecken","pi1630252854.htm",17,"1KER_WB");
navigation[19] = new navElem(19,"WC Becken","pi-1818734465.htm",17,"2KER_WC");
navigation[20] = new navElem(20,"Diverses","pi-937605520.htm",19,"4WC");
navigation[21] = new navElem(21,"Ablagen","pi1993262789.htm",17,"4KER_Ablag");
navigation[22] = new navElem(22,"Serien komplett","pi-1037824314.htm",0,"006SA");
navigation[23] = new navElem(23,"Bavaria","pi1779300250.htm",22,"1SERIE");
navigation[24] = new navElem(24,"Clivia","pi-652444465.htm",22,"2SERIE");
navigation[25] = new navElem(25,"Spülkästen","pi1070261314.htm",0,"007SA");
navigation[26] = new navElem(26,"Ablauf-Systeme","pi-1043000871.htm",0,"008SA");
navigation[27] = new navElem(27,"Waschtisch & Bidet","pi-1527975469.htm",26,"1Abl");
navigation[28] = new navElem(28,"Badewanne & Dusche","pi1070058692.htm",26,"2Abl");
navigation[29] = new navElem(29,"Spültisch","pi1076090366.htm",26,"3Abl");
navigation[30] = new navElem(30,"Wasserzähler","pi1083692416.htm",0,"009SA");
navigation[31] = new navElem(31,"Kalkschutzgeräte","pi1089275119.htm",0,"10SA");
navigation[32] = new navElem(32,"Diverses","pi-679264163.htm",0,"11SA");
navigation[33] = new navElem(33,"Konsolen/Halterungen","pi1957303320.htm",32,"1_Diverses");
navigation[34] = new navElem(34,"Dichtungen/Kleinteile","pi-571271111.htm",32,"2_Diverses");
navigation[35] = new navElem(35,"Ersatzteile","pi1065007534.htm",0,"12SA");
navigation[36] = new navElem(36,"Spülkästen","pi-400581801.htm",35,"5ERSATZ");
navigation[37] = new navElem(37,"AP Spülkästen","pi-1780582324.htm",36,"Geberit1");
navigation[38] = new navElem(38,"UP Spülkästen","pi-818975395.htm",36,"Geberit2");
navigation[39] = new navElem(39,"Luftsprudler","pi1076748928.htm",35,"6ERSATZ");
navigation[40] = new navElem(40,"Heizung","pi-1050344504.htm",null,"2");
navigation[41] = new navElem(41,"Fühlerelemente","pi650765548.htm",40,"HZ2");
navigation[42] = new navElem(42,"Danfoss","pi1014143928.htm",41,"HZ2_1");
navigation[43] = new navElem(43,"Herz","pi1181645659.htm",41,"HZ2_4");
navigation[44] = new navElem(44,"GAMPPER","pi-900238252.htm",41,"HZ2_6");
navigation[45] = new navElem(45,"GIACOMINI","pi1181742700.htm",41,"HZ2_8");
navigation[46] = new navElem(46,"Sonderangebote<img src=assets/own/ausrufez.gif border=&#0034;0&#0034;>","pi1069863173.htm",null,"5");
navigation[47] = new navElem(47,"Montage-Service","pi1090316528.htm",null,"6");

// 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"));


