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