//
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\">Produktgruppen</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,"Hundeboxen","pi1124965634.htm",null,"1");
navigation[1] = new navElem(1,"Mass-Einzelboxen&nbsp(1)","pi216115038.htm",0,"EB");
navigation[2] = new navElem(2,"Mass-Doppelboxen&nbsp(1)","pi-2121736313.htm",0,"DB");
navigation[3] = new navElem(3,"Optionen-Hundeboxen&nbsp(10)","pi-1409266173.htm",0,"BOXOPT");
navigation[4] = new navElem(4,"Occasions-Boxen&nbsp(3)","pi1125996519.htm",0,"OccBox");
navigation[5] = new navElem(5,"Flexi-Boxen&nbsp(1)","pi1177513578.htm",0,"WT-SB-1");
navigation[6] = new navElem(6,"Hecktürverriegelung&nbsp(3)","pi1207573362.htm",null,"HTV");
navigation[7] = new navElem(7,"Hundeanhänger","pi-1158388389.htm",null,"2");
navigation[8] = new navElem(8,"Occasionen","pi-538837604.htm",7,"OccHaeng");
navigation[9] = new navElem(9,"Thermo-Standard&nbsp(8)","pi1124985264.htm",7,"ThSt");
navigation[10] = new navElem(10,"Thermo-Campeon&nbsp(5)","pi657069939.htm",7,"TH-CP");
navigation[11] = new navElem(11,"Royal&nbsp(13)","pi1125046720.htm",7,"Royal");
navigation[12] = new navElem(12,"Komfort de Luxe","pi-640002578.htm",7,"Thermo KdL");
navigation[13] = new navElem(13,"Optionen-Anhänger&nbsp(7)","pi1026886925.htm",7,"AZ");
navigation[14] = new navElem(14,"Ersatzteile","pi776796490.htm",7,"AHET");
navigation[15] = new navElem(15,"Aufkleber&nbsp(3)","pi1177772999.htm",14,"Aufkleber");
navigation[16] = new navElem(16,"Staukasten&nbsp(3)","pi-781364228.htm",14,"Staukasten");
navigation[17] = new navElem(17,"Räder&nbsp(6)","pi481045325.htm",14,"Räder");
navigation[18] = new navElem(18,"Reling&nbsp(7)","pi-882193782.htm",14,"Reling");
navigation[19] = new navElem(19,"Belüftung&nbsp(8)","pi608015939.htm",14,"Belüftung");
navigation[20] = new navElem(20,"Beleuchtung","pi898866120.htm",14,"Licht");
navigation[21] = new navElem(21,"Beleuchtung Thermo Max","pi317198889.htm",14,"Max-Licht");
navigation[22] = new navElem(22,"Beleuchtung Thermo Max Spezial","pi1348208438.htm",14,"Licht Spez");
navigation[23] = new navElem(23,"Ersatzteile Zubehör&nbsp(35)","pi237488255.htm",14,"ET Zubehör");
navigation[24] = new navElem(24,"Elektrik-Zubehör","pi534796372.htm",14,"ET Elektri");
navigation[25] = new navElem(25,"Verlängerung um je 10 cm&nbsp(2)","pi-1697972539.htm",14,"Lang");
navigation[26] = new navElem(26,"Erhöhung um je 10 cm&nbsp(3)","pi785630882.htm",14,"ET Hoch");
navigation[27] = new navElem(27,"Agility","pi1069912832.htm",null,"3");
navigation[28] = new navElem(28,"Einzelgeräte&nbsp(24)","pi-904597801.htm",27,"EG");
navigation[29] = new navElem(29,"Kombinationen&nbsp(1)","pi1451420893.htm",27,"ABundles");
navigation[30] = new navElem(30,"Gummibeschichtungen&nbsp(1)","pi-1684639149.htm",27,"Gummi");
navigation[31] = new navElem(31,"Ersatzteile&nbsp(9)","pi386082252.htm",27,"AET");
navigation[32] = new navElem(32,"Diverses&nbsp(4)","pi1959630116.htm",27,"Diverses");
navigation[33] = new navElem(33,"Flyball&nbsp(2)","pi2081566938.htm",null,"Flyball");
navigation[34] = new navElem(34,"Obedience&nbsp(2)","pi-724453484.htm",null,"Obedience");
navigation[35] = new navElem(35,"Schutzhund&nbsp(11)","pi2009913089.htm",null,"4");
navigation[36] = new navElem(36,"Sonderaufbauten","pi-201006343.htm",null,"SAB");
navigation[37] = new navElem(37,"Kataloge&nbsp(3)","pi1125935824.htm",null,"KAT");
navigation[38] = new navElem(38,"Hundehütten&nbsp(1)","pi1180442650.htm",null,"WT-HH");
navigation[39] = new navElem(39,"Hundezwinger","http://www.hunde-zwinger.com",null,"WT-HZ");

// 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"));


