//
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/bulletcat1st.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\">Central Catalog</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/bulletcat1st.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/bulletcat1st.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,"Atlantic Salmon Flies Hairwings","pi1028882832.htm",null,"ACF");
navigation[1] = new navElem(1,"Brass Beads & Eyes","pi1645553233.htm",null,"BrassBeade");
navigation[2] = new navElem(2,"Bead, Coneheads","pi-43744706.htm",1,"beadcone");
navigation[3] = new navElem(3,"Misc. Eyes & Beads","pi-1322346265.htm",1,"MISCEYE");
navigation[4] = new navElem(4,"Mono, Lead Dumbell, & EZ-Eyes","pi-112170340.htm",1,"MONOLEAD");
navigation[5] = new navElem(5,"Mylar Eyes","pi-1377114771.htm",1,"mylaryes");
navigation[6] = new navElem(6,"Dry Flies","pi-1767226838.htm",null,"D");
navigation[7] = new navElem(7,"Attractors","pi-1411424925.htm",6,"A");
navigation[8] = new navElem(8,"Caddis","pi-472646366.htm",6,"DC");
navigation[9] = new navElem(9,"Thorax & Comparadun&#0039;s","pi-1914020760.htm",6,"DCP");
navigation[10] = new navElem(10,"Midges","pi-1825067447.htm",6,"DM");
navigation[11] = new navElem(11,"Parachutes","pi-861980458.htm",6,"DP");
navigation[12] = new navElem(12,"Terrestrials","pi-1936899681.htm",6,"DT");
navigation[13] = new navElem(13,"Traditional","pi713646836.htm",6,"DTR");
navigation[14] = new navElem(14,"Emergers","pi-502424347.htm",6,"Emerg");
navigation[15] = new navElem(15,"Spinners","pi2006602306.htm",6,"Spin");
navigation[16] = new navElem(16,"Stonefies Dry","pi1921499547.htm",6,"STF");
navigation[17] = new navElem(17,"Fly Fishing Accesory","pi-1181857216.htm",null,"FFA");
navigation[18] = new navElem(18,"Dressings Line & Fly","pi-789702313.htm",17,"Dressings");
navigation[19] = new navElem(19,"Fly Boxes","pi-2023842228.htm",17,"Fly Box");
navigation[20] = new navElem(20,"Fly Rods","pi-455468195.htm",17,"Fly Rod");
navigation[21] = new navElem(21,"Indicators & Weight","pi153830611.htm",17,"Indi.");
navigation[22] = new navElem(22,"Leader Accessories","pi-96099527.htm",17,"Leaderassc");
navigation[23] = new navElem(23,"Misc. Fly Fishing","pi871160952.htm",17,"misc fly");
navigation[24] = new navElem(24,"Reels","pi1318550692.htm",17,"Reel");
navigation[25] = new navElem(25,"Leaders","pi2096546674.htm",17,"Umpqua Lea");
navigation[26] = new navElem(26,"Fly Tying Hooks","pi-847722741.htm",null,"Fly hook");
navigation[27] = new navElem(27,"Misc. Hooks","pi1825496816.htm",26,"Brooch Pin");
navigation[28] = new navElem(28,"Hook Boxes for Storage","pi133734046.htm",26,"Hook Boxes");
navigation[29] = new navElem(29,"Mustad Hooks","pi-692726329.htm",26,"Mustad");
navigation[30] = new navElem(30,"Tiemco Hooks","pi-159650483.htm",26,"TMC");
navigation[31] = new navElem(31,"Fly Tying Kits","pi1027335306.htm",null,"Fly Tyingk");
navigation[32] = new navElem(32,"Fly Tying Natural Material","pi-2091177917.htm",null,"FlyNatural");
navigation[33] = new navElem(33,"Bird Skins","pi-17676856.htm",32,"BS");
navigation[34] = new navElem(34,"Dubbing & Furs","pi88601641.htm",32,"dUB");
navigation[35] = new navElem(35,"Marabou","pi-1874673354.htm",32,"MA");
navigation[36] = new navElem(36,"Peacock Feathers","pi349338239.htm",32,"Pea");
navigation[37] = new navElem(37,"Plumage","pi667787860.htm",32,"PL.");
navigation[38] = new navElem(38,"Pheasant Tails","pi-1342373691.htm",32,"PT");
navigation[39] = new navElem(39,"Biots & Quills","pi1449795746.htm",32,"Quills");
navigation[40] = new navElem(40,"Rabbit Strips","pi1815101344.htm",32,"Rabbitstri");
navigation[41] = new navElem(41,"Tails & Hair","pi142166139.htm",32,"T&H");
navigation[42] = new navElem(42,"Books & Videos","pi631566113.htm",null,"Flyty");
navigation[43] = new navElem(43,"Fly Tying Synthetics","pi-1340756274.htm",null,"FlyTying s");
navigation[44] = new navElem(44,"Mylar Tubing & Body Braid","pi-1671639497.htm",43,"Bod");
navigation[45] = new navElem(45,"Chenille","pi-1739216468.htm",43,"Chenil");
navigation[46] = new navElem(46,"Egg Balls","pi-864068803.htm",43,"Egg Balls");
navigation[47] = new navElem(47,"Flash Material","pi-1130637382.htm",43,"Flash");
navigation[48] = new navElem(48,"Fly Tying Glue & Epoxy","pi-139065421.htm",43,"Glue");
navigation[49] = new navElem(49,"Misc. Fly Tying","pi-1012257672.htm",43,"MFT");
navigation[50] = new navElem(50,"Synthetics","pi249405721.htm",43,"Syn");
navigation[51] = new navElem(51,"Thread & Body Material","pi1156695910.htm",43,"threa");
navigation[52] = new navElem(52,"Tinsel & Wire","pi-1289375505.htm",43,"TW");
navigation[53] = new navElem(53,"Foam flat, Poppers, Ant & Hopper Bodies","pi727110660.htm",null,"FoamTubing");
navigation[54] = new navElem(54,"Ant & Hopper Bodies","pi-1916871499.htm",53,"anthopper");
navigation[55] = new navElem(55,"Foam Sheets, Poppers & Tubing","pi-921212462.htm",53,"foam");
navigation[56] = new navElem(56,"Fly Tying Tools","pi1018185195.htm",null,"FTT");
navigation[57] = new navElem(57,"Hackle Dry & Wet","pi764243024.htm",null,"HackleDryw");
navigation[58] = new navElem(58,"Ewing Hackle","pi-1792284143.htm",57,"Ewing");
navigation[59] = new navElem(59,"Keough Hackle","pi-1673303298.htm",57,"Keough");
navigation[60] = new navElem(60,"Metz Hackle","pi1400504999.htm",57,"Metz");
navigation[61] = new navElem(61,"Misc. Saddles & Capes","pi-241925796.htm",57,"MiscCapes");
navigation[62] = new navElem(62,"Whiting Hackle","pi1850959149.htm",57,"Whiting");
navigation[63] = new navElem(63,"Streamers","pi2077177578.htm",null,"str");
navigation[64] = new navElem(64,"Emerald Shiners","pi-1757224157.htm",63,"Emerald");
navigation[65] = new navElem(65,"Bass, Pike & Large Trout","pi143875880.htm",63,"FB101");
navigation[66] = new navElem(66,"Muddlers (Marabou, wooly)","pi-345658871.htm",63,"mm");
navigation[67] = new navElem(67,"Attractor Streamers","pi-408771745.htm",63,"SA");
navigation[68] = new navElem(68,"Smelt Imitations","pi1227936933.htm",63,"SS");
navigation[69] = new navElem(69,"Long Shank Trolling Streamers","pi1826725634.htm",63,"TS");
navigation[70] = new navElem(70,"Wooly buggers","pi251969371.htm",63,"WB");
navigation[71] = new navElem(71,"Wonder Minnows","pi931226880.htm",63,"Wondmin");
navigation[72] = new navElem(72,"Saltwater Flies","pi1115472129.htm",null,"sw");
navigation[73] = new navElem(73,"Epoxy Minnows","pi-1063988434.htm",72,"140");
navigation[74] = new navElem(74,"Fishheads","pi-177966313.htm",72,"3");
navigation[75] = new navElem(75,"Angel Hair Baitfish","pi-187767540.htm",72,"AHBait");
navigation[76] = new navElem(76,"Braided Baitfish","pi-249099491.htm",72,"Braided ba");
navigation[77] = new navElem(77,"Jiggys & Clouser Minnows","pi1847132698.htm",72,"cl");
navigation[78] = new navElem(78,"Cone Head Deceivers","pi1455995539.htm",72,"Conedec");
navigation[79] = new navElem(79,"Bonefish-Tarpon-Barracuda","pi-1633100328.htm",72,"Cr");
navigation[80] = new navElem(80,"Crease Fly","pi-654373127.htm",72,"Crease");
navigation[81] = new navElem(81,"Enrico Style Baitfish","pi-309766202.htm",72,"Enrico");
navigation[82] = new navElem(82,"Flat Feather Wings","pi-1182772785.htm",72,"Flat Feath");
navigation[83] = new navElem(83,"Hair Heads","pi-1915856028.htm",72,"HH");
navigation[84] = new navElem(84,"Large Baitfish","pi945940629.htm",72,"Large Bait");
navigation[85] = new navElem(85,"Miscellaneous","pi-2060320753.htm",72,"M");
navigation[86] = new navElem(86,"Polarfibre Minnows","pi-596918222.htm",72,"Polarfibre");
navigation[87] = new navElem(87,"Shrimp","pi538817739.htm",72,"sh");
navigation[88] = new navElem(88,"Slinkyfibre Flies","pi2056680433.htm",72,"Slinkyfibr");
navigation[89] = new navElem(89,"Deceivers","pi-1076041890.htm",72,"sw100");
navigation[90] = new navElem(90,"Baitfish","pi-1288495225.htm",72,"SWB");
navigation[91] = new navElem(91,"Double Bunny Flies","pi-317729604.htm",72,"SWDB");
navigation[92] = new navElem(92,"Top Water","pi1743342861.htm",72,"Top Water");
navigation[93] = new navElem(93,"Nymphs","pi-1585694390.htm",null,"T");
navigation[94] = new navElem(94,"Caddis Nymphs","pi1590595075.htm",93,"c");
navigation[95] = new navElem(95,"Midge Nymphs","pi-274356088.htm",93,"Midge Nymp");
navigation[96] = new navElem(96,"Nymphs (General)","pi1871237097.htm",93,"N");
navigation[97] = new navElem(97,"Stonefly Nymphs","pi-1290280458.htm",93,"NS");
navigation[98] = new navElem(98,"Nymph Sets","pi532003903.htm",93,"Nymph sets");
navigation[99] = new navElem(99,"Umpqua Flies","pi-288181996.htm",null,"Umpqua");
navigation[100] = new navElem(100,"Bass Bugs","pi-1794053533.htm",99,"Bass Bugs");
navigation[101] = new navElem(101,"Dry Flies Umpqua","pi656480389.htm",99,"DryFliesUm");
navigation[102] = new navElem(102,"Nymphs Umpqua","pi-451359390.htm",99,"NymphUmpq");
navigation[103] = new navElem(103,"Saltwater Flies Umpqua","pi2086807099.htm",99,"SaltUmpq");
navigation[104] = new navElem(104,"Streamers Umpqua","pi-1285965216.htm",99,"Streamer u");
navigation[105] = new navElem(105,"Tandem Trolling Streamers","pi-1239645631.htm",99,"TandemFlie");
navigation[106] = new navElem(106,"Umpqua Fly Assortments","pi-600309023.htm",99,"Umpqua Fly");
navigation[107] = new navElem(107,"Wet Flies","pi464430990.htm",null,"wet fly");

// 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"));

