//
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 += "Amount of Products:<strong>&nbsp;" + prdCount + "</strong><br>";
	prdString += "Subtotal:<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="14" alt="Bullet.gif" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">' + "Go to the Orderform</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\">Categories</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,"Baseball","pi1086205934.htm",null,"0");
navigation[1] = new navElem(1,"Field & Field Maintenance","pi-2140465617.htm",0,"0-4");
navigation[2] = new navElem(2,"Helmets","pi-171341952.htm",0,"0-3");
navigation[3] = new navElem(3,"Masks","pi1087348098.htm",0,"0-1");
navigation[4] = new navElem(4,"Protection","pi1115782107.htm",0,"0-2");
navigation[5] = new navElem(5,"Basketball","pi1086269912.htm",null,"1");
navigation[6] = new navElem(6,"Backboards","pi311923529.htm",5,"1-4");
navigation[7] = new navElem(7,"Goals","pi-916854515.htm",5,"1-1");
navigation[8] = new navElem(8,"Nets","pi1089914284.htm",5,"1-3");
navigation[9] = new navElem(9,"Rims","pi1087244125.htm",5,"1-2");
navigation[10] = new navElem(10,"Books & Videos","pi1597139705.htm",null,"2");
navigation[11] = new navElem(11,"Baseball/Softball","pi-1310849422.htm",10,"2-2");
navigation[12] = new navElem(12,"Basketball","pi1492479957.htm",10,"2-1");
navigation[13] = new navElem(13,"Football","pi-1605267957.htm",10,"2-3");
navigation[14] = new navElem(14,"Soccer","pi-4990480.htm",10,"2-4");
navigation[15] = new navElem(15,"Track & Field","pi1416294193.htm",10,"2-5");
navigation[16] = new navElem(16,"Volleyball","pi-2131619426.htm",10,"2-6");
navigation[17] = new navElem(17,"Wrestling","pi-136246073.htm",10,"2-7");
navigation[18] = new navElem(18,"Equipment/Laundry/Ball Bags","pi1347847889.htm",null,"3");
navigation[19] = new navElem(19,"Football","pi-1461690180.htm",null,"4");
navigation[20] = new navElem(20,"Dummies","pi1710476206.htm",19,"13-2");
navigation[21] = new navElem(21,"Indicators","pi-1407751295.htm",19,"13-1");
navigation[22] = new navElem(22,"Kicking Tees","pi-94821993.htm",19,"13-3");
navigation[23] = new navElem(23,"Official&#0039;s Accessories","pi-929525364.htm",19,"13-4");
navigation[24] = new navElem(24,"Pylons & Field Markers","pi-1365474662.htm",19,"13-6");
navigation[25] = new navElem(25,"Sideline Markers","pi-57320035.htm",19,"13-5");
navigation[26] = new navElem(26,"Gym Equipment","pi1087311416.htm",null,"5");
navigation[27] = new navElem(27,"Physical Education","pi-1455914042.htm",null,"6");
navigation[28] = new navElem(28,"Score Tables","pi416484815.htm",null,"7");
navigation[29] = new navElem(29,"Scoring Equipment","pi-1539217564.htm",null,"8");
navigation[30] = new navElem(30,"Seating","pi-2023553899.htm",null,"9");
navigation[31] = new navElem(31,"Soccer","pi-1094341582.htm",null,"10");
navigation[32] = new navElem(32,"Sports Medicine","pi-1275842357.htm",null,"11");
navigation[33] = new navElem(33,"Analgesics","pi-2135932214.htm",32,"8-1");
navigation[34] = new navElem(34,"Athletic Hydration","pi1358929419.htm",32,"8-7");
navigation[35] = new navElem(35,"Braces & Supports","pi-1867940799.htm",32,"8-5");
navigation[36] = new navElem(36,"Cold Therapy","pi257562136.htm",32,"8-6");
navigation[37] = new navElem(37,"Taping & Wrapping","pi998062467.htm",32,"8-2");
navigation[38] = new navElem(38,"Training Kits","pi736842741.htm",32,"8-4");
navigation[39] = new navElem(39,"Training Room Supplies","pi-1029993395.htm",32,"8-8");
navigation[40] = new navElem(40,"Wound & Foot Care","pi141479432.htm",32,"8-3");
navigation[41] = new navElem(41,"Sportswear","pi-2122123856.htm",null,"12");
navigation[42] = new navElem(42,"Track & Field","pi1757499377.htm",null,"13");
navigation[43] = new navElem(43,"Field","pi-607234319.htm",42,"10-4");
navigation[44] = new navElem(44,"High Jump","pi947363787.htm",42,"10-2");
navigation[45] = new navElem(45,"Pole Vault","pi2064856882.htm",42,"10-1");
navigation[46] = new navElem(46,"Track","pi-1571325776.htm",42,"10-3");
navigation[47] = new navElem(47,"Volleyball","pi520983390.htm",null,"14");
navigation[48] = new navElem(48,"Accessories","pi741123554.htm",47,"11-6");
navigation[49] = new navElem(49,"Floor Sleeves","pi923994428.htm",47,"11-4");
navigation[50] = new navElem(50,"Net Systems","pi1498632569.htm",47,"11-1");
navigation[51] = new navElem(51,"Nets","pi1110343652.htm",47,"11-2");
navigation[52] = new navElem(52,"Padding","pi-322915735.htm",47,"11-5");
navigation[53] = new navElem(53,"Referee Stands","pi-1845025973.htm",47,"11-3");
navigation[54] = new navElem(54,"Wrestling","pi692673415.htm",null,"15");

// 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"));

