//
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="20" height="12" 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="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="19" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcatact.gif" width="19" 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="19" 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="19" 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,"Autositze","pi1110206195.htm",null,"EA20");
navigation[1] = new navElem(1,"Autositz Gruppe 0+ (0-12 kg)","pi-700468813.htm",0,"0+");
navigation[2] = new navElem(2,"Concord INTENSE","pi-585291184.htm",1,"562");
navigation[3] = new navElem(3,"Concord ION ","pi1757968338.htm",1,"ret");
navigation[4] = new navElem(4,"Autositz Gruppe 0+/I (0-18kg)","pi1222479015.htm",0,"0+I");
navigation[5] = new navElem(5,"Autositz Gruppe I (9-18kg)","pi-2077956339.htm",0,"I");
navigation[6] = new navElem(6,"Autositz Gruppe II/III (15-36kg)","pi704218687.htm",0,"II/III");
navigation[7] = new navElem(7,"Autositz Booster/Sitzerhöhungen","pi-1453981972.htm",6,"boostre");
navigation[8] = new navElem(8,"Concord Gruppe II/III (16-36kg)","pi2087893187.htm",6,"Concord1");
navigation[9] = new navElem(9,"Sunshine Kids Gruppe II/III (16-36kg)","pi-950488157.htm",6,"345");
navigation[10] = new navElem(10,"Autositz Zubehör","pi269146297.htm",0,"AU");
navigation[11] = new navElem(11,"Bertini Produkte","pi1279268830.htm",null,"Bertini");
navigation[12] = new navElem(12,"Concord - alle Produkte","pi1216975006.htm",null,"concord");
navigation[13] = new navElem(13,"Autositz Gruppe 0+ (0-12kg)","pi1217259125.htm",12,"0+ Concord");
navigation[14] = new navElem(14,"INTENSE","pi-40096489.htm",13,"56z");
navigation[15] = new navElem(15,"ION ","pi-139028724.htm",13,"4444");
navigation[16] = new navElem(16,"Autositz Gruppe 0+/I (0-18kg)","pi-470115513.htm",12,"0+/I Conco");
navigation[17] = new navElem(17,"Autositz Gruppe I (9-18kg)","pi2132932828.htm",12,"I concord");
navigation[18] = new navElem(18,"Autositz Gruppe II/III (15-36kg)","pi-603517299.htm",12,"II/III Con");
navigation[19] = new navElem(19,"Autositz Zubehör","pi-164603422.htm",12,"Con_zub");
navigation[20] = new navElem(20,"Sportbuggies Fusion+Neo","pi-1960857517.htm",12,"fusion");
navigation[21] = new navElem(21,"Zubehör für Sportbuggies NEO und FUSION","pi577411038.htm",12,"zubeh-bugg");
navigation[22] = new navElem(22,"Disney Baby","pi1171364348.htm",null,"DB1");
navigation[23] = new navElem(23,"Eichhorn Fußsäcke","pi1373584823.htm",null,"EZ11");
navigation[24] = new navElem(24,"Ersatzteile","pi1130487292.htm",null,"EE20");
navigation[25] = new navElem(25,"Kinderwagen Zubehör","pi710483604.htm",null,"EZ20");
navigation[26] = new navElem(26,"Eichhorn Feste Tragetasche","pi819838737.htm",25,"EZ4");
navigation[27] = new navElem(27,"Fellfußsack","pi37324363.htm",25,"EZ8");
navigation[28] = new navElem(28,"Softtragenest","pi1396238150.htm",25,"EZ6");
navigation[29] = new navElem(29,"Sonstiges","pi-1509445166.htm",25,"Z905");
navigation[30] = new navElem(30,"Thermofußsack","pi-1270248625.htm",25,"EZ5");
navigation[31] = new navElem(31,"Wickeltasche","pi-516995150.htm",25,"EZ1");
navigation[32] = new navElem(32,"Kombi Kinderwagen","pi1078494543.htm",null,"N1");
navigation[33] = new navElem(33,"Kunstleder","pi-1394715377.htm",32,"N10");
navigation[34] = new navElem(34,"Korb Kinderwagen","pi1078224727.htm",null,"E20");
navigation[35] = new navElem(35,"Echtleder","pi1113914728.htm",34,"E1");
navigation[36] = new navElem(36,"Kunstleder","pi-230630381.htm",34,"E3");
navigation[37] = new navElem(37,"Stoff","pi1663834522.htm",34,"E2");
navigation[38] = new navElem(38,"Sonderangebote","pi1111585892.htm",null,"IGC1");
navigation[39] = new navElem(39,"Spielgeräte Hochstühle Betten","pi1166695127.htm",null,"SP1");
navigation[40] = new navElem(40,"Sportwagen + Buggys","pi1446176965.htm",null,"BU1");
navigation[41] = new navElem(41,"SunshineKids Autositze","pi-2133304487.htm",null,"sun");
navigation[42] = new navElem(42,"Zwillingskinderwagen","pi622346415.htm",null,"Z10");

// 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"));

