//
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/bulletcat1st.gif" width="13" height="14" alt="Bullet.gif" 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="1" >';
		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" alt="BulletCatAct.gif" 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" alt="BulletCat1stCls.gif" 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" alt="BulletCat1st.gif" 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,"Tennis","pi1093185227.htm",null,"150");
navigation[1] = new navElem(1,"Besaitungsmaschinen","pi-808754786.htm",0,"1");
navigation[2] = new navElem(2,"Tennisbälle","pi-114409902.htm",0,"10");
navigation[3] = new navElem(3,"Dunlop","pi592819758.htm",2,"11");
navigation[4] = new navElem(4,"Penn","pi1564367383.htm",2,"12");
navigation[5] = new navElem(5,"Tretorn","pi-1146716148.htm",2,"13");
navigation[6] = new navElem(6,"Babolat","pi1515145757.htm",2,"14");
navigation[7] = new navElem(7,"Head","pi1177944700.htm",2,"166");
navigation[8] = new navElem(8,"Wilson","pi851969475.htm",2,"34");
navigation[9] = new navElem(9,"Tennisschuhe","pi-1823059147.htm",0,"15");
navigation[10] = new navElem(10,"Damen","pi1093470537.htm",9,"16");
navigation[11] = new navElem(11,"Herren","pi-1870514218.htm",9,"17");
navigation[12] = new navElem(12,"Junior","pi-753606209.htm",9,"86");
navigation[13] = new navElem(13,"Indoor","pi482671592.htm",9,"88");
navigation[14] = new navElem(14,"Tennissocken","pi1093302838.htm",0,"18");
navigation[15] = new navElem(15,"Tennissaiten","pi1218658626.htm",0,"19");
navigation[16] = new navElem(16,"Sets","pi-137116517.htm",15,"20");
navigation[17] = new navElem(17,"Kirschbaum","pi1123440525.htm",16,"60");
navigation[18] = new navElem(18,"Signum Pro","pi-97119798.htm",16,"62");
navigation[19] = new navElem(19,"Iso-Speed","pi1124116707.htm",16,"63");
navigation[20] = new navElem(20,"Wilson","pi-1879270269.htm",16,"64");
navigation[21] = new navElem(21,"Luxilon","pi1156606564.htm",16,"65");
navigation[22] = new navElem(22,"Babolat","pi365245704.htm",16,"66");
navigation[23] = new navElem(23,"Pacific","pi458195561.htm",16,"67");
navigation[24] = new navElem(24,"Tecnifibre","pi1755261966.htm",16,"68");
navigation[25] = new navElem(25,"Polyfibre","pi1173036666.htm",16,"69");
navigation[26] = new navElem(26,"Head","pi1174131608.htm",16,"70");
navigation[27] = new navElem(27,"Prince","pi2069807545.htm",16,"71");
navigation[28] = new navElem(28,"Weiss Cannon®","pi1283545849.htm",16,"73");
navigation[29] = new navElem(29,"MSV","pi1283538165.htm",16,"75");
navigation[30] = new navElem(30,"Rollen","pi849137984.htm",15,"21");
navigation[31] = new navElem(31,"Kirschbaum Tennissaiten","pi-2078919352.htm",30,"35");
navigation[32] = new navElem(32,"Signum Pro","pi1863027156.htm",30,"36");
navigation[33] = new navElem(33,"Iso-Speed","pi1124109918.htm",30,"37");
navigation[34] = new navElem(34,"Polyfibre","pi-164352001.htm",30,"38");
navigation[35] = new navElem(35,"Babolat","pi365301161.htm",30,"39");
navigation[36] = new navElem(36,"Head","pi870036037.htm",30,"40");
navigation[37] = new navElem(37,"Luxilon","pi2013811746.htm",30,"41");
navigation[38] = new navElem(38,"Wilson","pi-1588183882.htm",30,"42");
navigation[39] = new navElem(39,"Tecnifibre","pi-1913489459.htm",30,"80");
navigation[40] = new navElem(40,"Prince","pi1156620632.htm",30,"81");
navigation[41] = new navElem(41,"Pacific","pi1819282161.htm",30,"84");
navigation[42] = new navElem(42,"Weiss Cannon®","pi1235328843.htm",30,"85");
navigation[43] = new navElem(43,"MSV","pi-1882435817.htm",30,"87");
navigation[44] = new navElem(44,"Dunlop","pi-1812739006.htm",30,"89");
navigation[45] = new navElem(45,"Taschen","pi1182802062.htm",0,"3");
navigation[46] = new navElem(46,"Tenniszubehör","pi1113775412.htm",0,"45");
navigation[47] = new navElem(47,"Griffbänder","pi686904962.htm",46,"46");
navigation[48] = new navElem(48,"Dämpfer","pi-1666907941.htm",46,"47");
navigation[49] = new navElem(49,"BallHolder","pi1183066381.htm",46,"48");
navigation[50] = new navElem(50,"Sonstiges","pi-142219136.htm",46,"49");
navigation[51] = new navElem(51,"Messgeräte","pi1208542289.htm",46,"50");
navigation[52] = new navElem(52,"Accessoires","pi234929639.htm",46,"52");
navigation[53] = new navElem(53,"Rackets","pi-744578965.htm",0,"5");
navigation[54] = new navElem(54,"Yonex","pi581490044.htm",53,"32");
navigation[55] = new navElem(55,"Prince","pi-1166348595.htm",53,"33");
navigation[56] = new navElem(56,"Pro Kennex","pi-556277879.htm",53,"51");
navigation[57] = new navElem(57,"Völkl","pi-609353428.htm",53,"53");
navigation[58] = new navElem(58,"Tecnifibre","pi988974501.htm",53,"54");
navigation[59] = new navElem(59,"Testschläger","pi9696627.htm",53,"57");
navigation[60] = new navElem(60,"Tester - Abverkauf","pi1253355918.htm",53,"58");
navigation[61] = new navElem(61,"Fischer","pi1638120637.htm",53,"59");
navigation[62] = new navElem(62,"Babolat","pi1093227010.htm",53,"6");
navigation[63] = new navElem(63,"Wilson","pi-1972292005.htm",53,"7");
navigation[64] = new navElem(64,"Dunlop","pi477908992.htm",53,"8");
navigation[65] = new navElem(65,"Head","pi-1313206271.htm",53,"9");
navigation[66] = new navElem(66,"Running","pi1093342172.htm",null,"151");
navigation[67] = new navElem(67,"Nike","pi14620402.htm",66,"28");
navigation[68] = new navElem(68,"Asics","pi408188043.htm",66,"29");
navigation[69] = new navElem(69,"Adidas","pi1194162501.htm",66,"30");
navigation[70] = new navElem(70,"Fußball","pi1113688644.htm",null,"152");
navigation[71] = new navElem(71,"Adidas","pi-1973525003.htm",70,"27");
navigation[72] = new navElem(72,"Bike","pi209861731.htm",null,"153");
navigation[73] = new navElem(73,"Hemden","pi-1629122712.htm",72,"23");
navigation[74] = new navElem(74,"Basketball","pi1123191659.htm",null,"155");
navigation[75] = new navElem(75,"Squash","pi-1614145853.htm",null,"156");
navigation[76] = new navElem(76,"Squashschläger","pi1189280155.htm",75,"170");
navigation[77] = new navElem(77,"Wilson Squashschläger","pi1843340847.htm",76,"270");
navigation[78] = new navElem(78,"Dunlop Squashschläger","pi-1387794364.htm",76,"275");
navigation[79] = new navElem(79,"Unsquashable Squashschläger","pi-729656331.htm",76,"280");
navigation[80] = new navElem(80,"Prince Squashschläger","pi1721163794.htm",76,"285");
navigation[81] = new navElem(81,"Squashsaiten","pi-1359097234.htm",75,"185");
navigation[82] = new navElem(82,"Squashbälle","pi-1020473001.htm",75,"200");
navigation[83] = new navElem(83,"Badminton","pi-927387064.htm",null,"157");
navigation[84] = new navElem(84,"Badmintonschläger","pi1974793804.htm",83,"210");
navigation[85] = new navElem(85,"Badmintonsaiten","pi1561826141.htm",83,"230");
navigation[86] = new navElem(86,"Badmintonbälle","pi1372222810.htm",83,"250");
navigation[87] = new navElem(87,"Tischtennis","pi781330114.htm",null,"158");
navigation[88] = new navElem(88,"Lifestyle","pi-2025976555.htm",null,"159");
navigation[89] = new navElem(89,"Trekking","pi1128720304.htm",null,"175");
navigation[90] = new navElem(90,"FLEXI-BAR","pi1159991469.htm",null,"186");
navigation[91] = new navElem(91,"Wassersport","pi1160143632.htm",null,"188");
navigation[92] = new navElem(92,"Speedminton®","pi1109378984.htm",null,"189");
navigation[93] = new navElem(93,"Schnäppchen","pi-87927600.htm",null,"190");
navigation[94] = new navElem(94,"Medizinische Produkte","pi1174499060.htm",null,"195");

// 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"));


