//
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="10" 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="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,"Informationen","pi1595236373.htm",null,"Systeme");
navigation[1] = new navElem(1,"Laborserie X10","pi1059567418.htm",null,"X10-25");
navigation[2] = new navElem(2,"Dispergieren","pi1071758006.htm",1,"Disp25");
navigation[3] = new navElem(3,"Schäfte mit Generatoren","pi1118307398.htm",2,"X10Schaft");
navigation[4] = new navElem(4,"Dispergierschaft 6 mm","pi519483670.htm",3,"3906");
navigation[5] = new navElem(5,"Dispergierschaft 10 mm","pi592756514.htm",3,"3910");
navigation[6] = new navElem(6,"Dispergierschaft 18 mm","pi1059744687.htm",3,"3934");
navigation[7] = new navElem(7,"Dispergierschaft 20 mm","pi-134993980.htm",3,"3936");
navigation[8] = new navElem(8,"Dispergierschaft 25 mm","pi245699957.htm",3,"3933");
navigation[9] = new navElem(9,"Mischen und Dispergieren","pi-1477618177.htm",1,"Misch20");
navigation[10] = new navElem(10,"Dispergieren (6 - 25 mm)","pi-912834192.htm",9,"Disp750");
navigation[11] = new navElem(11,"Dispergieren (30 mm)","pi-1198791790.htm",9,"393602");
navigation[12] = new navElem(12,"Mischen","pi-1450431317.htm",9,"393601");
navigation[13] = new navElem(13,"Schäfte ohne Generator","pi-2048535237.htm",1,"Schaft");
navigation[14] = new navElem(14,"Generatoren","pi132149553.htm",13,"Gener1025");
navigation[15] = new navElem(15,"Zubehör","pi1062054558.htm",1,"X10Zubeh");
navigation[16] = new navElem(16,"Laborserie X40","pi-182890189.htm",null,"X40");
navigation[17] = new navElem(17,"Antriebe","pi1106819266.htm",16,"KomplX40");
navigation[18] = new navElem(18,"Schaft 40T","pi-1659114849.htm",16,"Schft40T");
navigation[19] = new navElem(19,"Mischköpfe","pi-3207358.htm",18,"Kopf40T");
navigation[20] = new navElem(20,"Dispergierköpfe","pi1072076943.htm",18,"Disp40");
navigation[21] = new navElem(21,"Dissolverscheiben","pi-668991929.htm",18,"Dis40");
navigation[22] = new navElem(22,"Schaft 41G","pi130051557.htm",16,"Schaft40G");
navigation[23] = new navElem(23,"Mischköpfe","pi94042779.htm",22,"Kopf41G");
navigation[24] = new navElem(24,"Dispergierköpfe","pi-1722865910.htm",22,"Disp41");
navigation[25] = new navElem(25,"Dissolverscheiben","pi545052867.htm",22,"Dis41");
navigation[26] = new navElem(26,"Inline Dispergierwerkzeug","pi-1189033129.htm",16,"Z42Inline");
navigation[27] = new navElem(27,"Schaft LDT-RG","pi705892345.htm",16,"SchaftLDT");
navigation[28] = new navElem(28,"Mischköpfe","pi-455275934.htm",27,"KopfLDT");
navigation[29] = new navElem(29,"Dissolverscheiben","pi1017553942.htm",27,"DissLDT");
navigation[30] = new navElem(30,"Schaft Y-MD-RG","pi1390838488.htm",16,"SchaftYMD");
navigation[31] = new navElem(31,"Mischköpfe","pi-538403843.htm",30,"MischMD");
navigation[32] = new navElem(32,"Dissolverscheiben","pi-719670606.htm",30,"DissMD");
navigation[33] = new navElem(33,"Zubehör","pi-358470968.htm",16,"Zub40");
navigation[34] = new navElem(34,"Pilotserie X50","pi1646729208.htm",null,"X50");
navigation[35] = new navElem(35,"Antriebe","pi-180959717.htm",34,"KomplX50");
navigation[36] = new navElem(36,"Schaft LDT-1","pi-1829218871.htm",34,"SchaftX50");
navigation[37] = new navElem(37,"Leitstrahlmischköpfe","pi1134206627.htm",36,"KopfLSM");
navigation[38] = new navElem(38,"Dispermixköpfe","pi-2039196504.htm",36,"Disperm50");
navigation[39] = new navElem(39,"Dispergierköpfe","pi142725513.htm",36,"DispegX50");
navigation[40] = new navElem(40,"Dissolverscheiben","pi-1564780415.htm",36,"DissolvX50");
navigation[41] = new navElem(41,"Schaft LDT-1 Hygiene","pi1267610650.htm",34,"SchaftX50H");
navigation[42] = new navElem(42,"Leitstrahlmischköpfe","pi-186521351.htm",41,"LSM-H");
navigation[43] = new navElem(43,"Dispermixköpfe","pi608545222.htm",41,"Disp-H");
navigation[44] = new navElem(44,"Dispergierköpfe","pi172407759.htm",41,"X-H");
navigation[45] = new navElem(45,"Dissolverscheiben","pi-2081751708.htm",41,"Dis-H");
navigation[46] = new navElem(46,"Oringsätze für Generatoren","pi1294246280.htm",41,"Oring-H");
navigation[47] = new navElem(47,"Schaft Y-MD","pi1913872467.htm",34,"X50YMD");
navigation[48] = new navElem(48,"Leitstrahlmischköpfe","pi-1772950762.htm",47,"LSM-YMD");
navigation[49] = new navElem(49,"Dissolverscheiben","pi-1018620193.htm",47,"DissolYMD");
navigation[50] = new navElem(50,"Schäfte mit Mischkopf","pi-720524764.htm",34,"X50Generat");
navigation[51] = new navElem(51,"Inline Dispergiersystem","pi1096018350.htm",34,"X50Z66");
navigation[52] = new navElem(52,"Steuerungen","pi939108950.htm",34,"FUX50");
navigation[53] = new navElem(53,"Zubehör","pi-872795141.htm",34,"ZubX50");
navigation[54] = new navElem(54,"Fahrbare Stative","pi1280472562.htm",34,"Stative");

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

