//
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="15" height="15" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">' + "Zum Warenkorb</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="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="14" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcat1stcls.gif" width="14" 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="14" 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="14" 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,"Unterputzgehäuse VARIO","pi1131711851.htm",null,"UPV");
navigation[1] = new navElem(1,"Einsatzbereich 1","pi1096495277.htm",0,"UPV1");
navigation[2] = new navElem(2,"Einsatzbereich 2","pi-184353686.htm",0,"UPV2");
navigation[3] = new navElem(3,"Einsatzbereich 3","pi1221434019.htm",0,"UPV3");
navigation[4] = new navElem(4,"Einsatzbereich 4","pi1053991080.htm",0,"UPV4");
navigation[5] = new navElem(5,"Zubehör","pi1904875286.htm",0,"UPVZ");
navigation[6] = new navElem(6,"Zweitraum Absaugung","pi-578563361.htm",5,"UPVZ1");
navigation[7] = new navElem(7,"Montagezubehör","pi-60789964.htm",5,"UPVZ2");
navigation[8] = new navElem(8,"Schiebestutzen","pi-968650715.htm",5,"UPVZ3");
navigation[9] = new navElem(9,"Aufputzgehäuse VARIO","pi374013392.htm",null,"APV");
navigation[10] = new navElem(10,"Einsatzbereich 1","pi-1650355070.htm",9,"APV1");
navigation[11] = new navElem(11,"Einsatzbereich 2","pi-145496357.htm",9,"APV2");
navigation[12] = new navElem(12,"Lüftereinsätze VARIO","pi-1355317871.htm",null,"LEV");
navigation[13] = new navElem(13,"1 Leistungsstufe","pi-1964484992.htm",12,"LEV1");
navigation[14] = new navElem(14,"2 Leistungsstufen","pi1217279105.htm",12,"LEV2");
navigation[15] = new navElem(15,"3 Leistungsstufen","pi-546627410.htm",12,"LEV3");
navigation[16] = new navElem(16,"4 Leistungsstufen","pi-894365033.htm",12,"LEV4");
navigation[17] = new navElem(17,"Zubehör","pi-1433145716.htm",12,"LEVZ");
navigation[18] = new navElem(18,"Ersatzfilter","pi-883771747.htm",12,"LEVEF");
navigation[19] = new navElem(19,"Brandschutz","pi-154052482.htm",null,"BS");
navigation[20] = new navElem(20,"MBS T-Stück","pi1675306906.htm",19,"BST");
navigation[21] = new navElem(21,"MBS Kreuz-Stück","pi-677752301.htm",19,"BSK");
navigation[22] = new navElem(22,"Brandschutzklappe","pi-241336488.htm",19,"BSKL");
navigation[23] = new navElem(23,"Deckenschott","pi387478137.htm",19,"BSDS");
navigation[24] = new navElem(24,"Zulufteinrichtung","pi-1580350937.htm",null,"ZLE");
navigation[25] = new navElem(25,"Ersatzteile Vorläufermodelle","pi1415195356.htm",null,"ETV");
navigation[26] = new navElem(26,"Lüfterserie G-4","pi124048710.htm",25,"ETVG4");
navigation[27] = new navElem(27,"Lüftereinsätze","pi1544388760.htm",26,"ETVG4LE");
navigation[28] = new navElem(28,"1 Leistungsstufe","pi1684391793.htm",27,"ETVG4LE1");
navigation[29] = new navElem(29,"2 Leistungsstufen","pi2119406814.htm",27,"ETVG4LE2");
navigation[30] = new navElem(30,"Lüftermotor","pi1473667407.htm",26,"ETVG4LM");
navigation[31] = new navElem(31,"1 Leistungsstufe","pi-1376739577.htm",30,"ETVG4LM1");
navigation[32] = new navElem(32,"2 Leistungsstufen","pi-1595130308.htm",30,"ETVG4LM2");
navigation[33] = new navElem(33,"Steuerungen für Lüfter","pi349967588.htm",26,"ETVG4SL");
navigation[34] = new navElem(34,"in Verbindung mit Lüfter","pi-328148851.htm",33,"ETVG4SL1");
navigation[35] = new navElem(35,"1 Leistungsstufe","pi-455146109.htm",34,"6311");
navigation[36] = new navElem(36,"2 Leistungsstufen","pi-1410881016.htm",34,"6312");
navigation[37] = new navElem(37,"Zubehör","pi712279061.htm",26,"ETVG4Z");
navigation[38] = new navElem(38,"Anbauteile, Filterträger, Ansaugdeckel","pi-1409766465.htm",37,"ETVG4Z1");
navigation[39] = new navElem(39,"für Gehäuse ab Bj. Mitte 96","pi432261780.htm",37,"ETVG4Z2");
navigation[40] = new navElem(40,"für Gehäuse bis Bj. Mitte 96","pi1477820307.htm",37,"ETVG4Z3");
navigation[41] = new navElem(41,"Umrüstsatz","pi812356613.htm",37,"ETVG4Z4");
navigation[42] = new navElem(42,"Ersatzfilter","pi-769293598.htm",26,"ETVG4E");
navigation[43] = new navElem(43,"Lüfterserie M-1-R und M-3-R","pi-386941877.htm",25,"ETVM1");
navigation[44] = new navElem(44,"Zubehör","pi1326627941.htm",43,"ETVM1Z");
navigation[45] = new navElem(45,"Ersatzfilter","pi-1681007678.htm",43,"ETVM1E");
navigation[46] = new navElem(46,"Lüfterserie GLK (1980 - 1984)","pi823098160.htm",25,"ETVGLK");
navigation[47] = new navElem(47,"Zubehör","pi1140102381.htm",46,"ETVGLKZ");
navigation[48] = new navElem(48,"Ersatzfilter","pi168500138.htm",46,"ETVGLKE");

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

