//
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\">Equipment 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/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,"All Liquidations","pi1154922748.htm",null,"All Liq");
navigation[1] = new navElem(1,"Ductile Iron Foundry","pi250001290.htm",0,"Duct Iron ");
navigation[2] = new navElem(2,"All Parts","pi1089235898.htm",null,"Parts");
navigation[3] = new navElem(3,"Gear Reducers","pi2098562105.htm",2,"gear reduc");
navigation[4] = new navElem(4,"Muller Parts","pi-1197488643.htm",2,"mull part");
navigation[5] = new navElem(5,"Vibratory Conveyor Parts","pi1128364346.htm",2,"vib con ");
navigation[6] = new navElem(6,"Ball Mill","pi-1398757044.htm",null,"Ball Mill");
navigation[7] = new navElem(7,"Blast Equipment","pi1039298388.htm",null,"Blast");
navigation[8] = new navElem(8,"Foundry/ Forge","pi-1478198450.htm",7,"Blast Con");
navigation[9] = new navElem(9,"Structural","pi1339512864.htm",7,"Blast STR");
navigation[10] = new navElem(10,"Unloading Conveyors","pi190742414.htm",7,"Unload Con");
navigation[11] = new navElem(11,"Compressors/ Dryers","pi-871560006.htm",null,"Air Comp");
navigation[12] = new navElem(12,"Conveyors/ Elevators","pi-1544130198.htm",null,"Conv");
navigation[13] = new navElem(13,"Aerators","pi1154920086.htm",12,"Aera");
navigation[14] = new navElem(14,"Belt","pi-2127098765.htm",12,"Conv BF");
navigation[15] = new navElem(15,"Bucket Elevators","pi1404577778.htm",12,"Conv BE");
navigation[16] = new navElem(16,"Hunter Feed","pi1131163474.htm",12,"Hnt Feed");
navigation[17] = new navElem(17,"Magnetic","pi-1053613376.htm",12,"Conv Mag");
navigation[18] = new navElem(18,"Overhead Chain","pi1056054847.htm",12,"Chain");
navigation[19] = new navElem(19,"Roller Gravity","pi640057775.htm",12,"Conv RG");
navigation[20] = new navElem(20,"Roller Powered","pi-1912076860.htm",12,"Conv RP");
navigation[21] = new navElem(21,"Systems","pi202375245.htm",12,"Conv Sys");
navigation[22] = new navElem(22,"Transfer Car","pi862059328.htm",12,"Tran Car");
navigation[23] = new navElem(23,"Transporters","pi-1853670896.htm",12,"Conv Pnue");
navigation[24] = new navElem(24,"Turn Table","pi-1611355583.htm",12,"Tur Tbl");
navigation[25] = new navElem(25,"Vibratory Conveyors","pi58799065.htm",12,"Conv O");
navigation[26] = new navElem(26,"Vibratory Conveyor Parts","pi1374448435.htm",25,"vib conv");
navigation[27] = new navElem(27,"Core Equipment","pi79113123.htm",null,"Cor");
navigation[28] = new navElem(28,"Auto Sand Delivery","pi-1252740646.htm",27,"Cor SD");
navigation[29] = new navElem(29,"Batch Mixers","pi-1406329005.htm",27,"Cor BM");
navigation[30] = new navElem(30,"Cold Box","pi124579518.htm",27,"Cor CB");
navigation[31] = new navElem(31,"Gassing/ Scrubber","pi1026599708.htm",27,"Cor CB G");
navigation[32] = new navElem(32,"Packed Tower Scrubbers","pi1184088585.htm",27,"core proce");
navigation[33] = new navElem(33,"Shell/ Hot Box","pi-1507546265.htm",27,"Cor S");
navigation[34] = new navElem(34,"Wire Straightener","pi1211900651.htm",27,"WS");
navigation[35] = new navElem(35,"Cranes and Hoists","pi1596399016.htm",null,"Crane");
navigation[36] = new navElem(36,"Bridge Cranes","pi916789541.htm",35,"Bridge");
navigation[37] = new navElem(37,"Casting Handler","pi1108003256.htm",35,"cast han");
navigation[38] = new navElem(38,"Hoists","pi-795568165.htm",35,"Hoist");
navigation[39] = new navElem(39,"Jib Cranes","pi1071425922.htm",35,"Jib");
navigation[40] = new navElem(40,"Dryer","pi1194806638.htm",null,"drykln");
navigation[41] = new navElem(41,"Dust Collectors","pi1470356640.htm",null,"Dust Col");
navigation[42] = new navElem(42,"Blowers","pi-1351125793.htm",41,"Dust B");
navigation[43] = new navElem(43,"Cartridge","pi-1476032479.htm",41,"Dust C");
navigation[44] = new navElem(44,"Pulse Jet","pi-1534684210.htm",41,"Dust P");
navigation[45] = new navElem(45,"Shaker/ Rev Air","pi1106448183.htm",41,"Dust S");
navigation[46] = new navElem(46,"Wet Scrubbers","pi853770518.htm",41,"Dust W");
navigation[47] = new navElem(47,"Finishing Equipment","pi1833360406.htm",null,"Grind");
navigation[48] = new navElem(48,"Abrasive Cut Off Saws","pi1321595383.htm",47,"abrs ct of");
navigation[49] = new navElem(49,"Band Saws","pi-1695583636.htm",47,"Band");
navigation[50] = new navElem(50,"Saws","pi-1815643762.htm",47,"Saws");
navigation[51] = new navElem(51,"Stand Grinder","pi-360550341.htm",47,"Stand ");
navigation[52] = new navElem(52,"Swing Frame ","pi-1853703072.htm",47,"Swng Frme");
navigation[53] = new navElem(53,"Forklifts/Material Handling","pi-1283687280.htm",null,"Fork");
navigation[54] = new navElem(54,"Dumpsters","pi1091456858.htm",53,"dumpsters");
navigation[55] = new navElem(55,"Fork Lifts","pi-432624090.htm",53,"fork lfts");
navigation[56] = new navElem(56,"Gear Reducers","pi-301770323.htm",null,"gear redcr");
navigation[57] = new navElem(57,"Generators/Turbines","pi965845789.htm",null,"gen trb");
navigation[58] = new navElem(58,"Heat Treat","pi441283456.htm",null,"Heat Treat");
navigation[59] = new navElem(59,"Inspection Equipment","pi547082.htm",null,"Insp");
navigation[60] = new navElem(60,"Hardness Tester","pi1055782329.htm",59,"Hard");
navigation[61] = new navElem(61,"Layout Machines","pi-531247544.htm",59,"Insp LO");
navigation[62] = new navElem(62,"Magnaflux Machines","pi301376195.htm",59,"Insp Mag");
navigation[63] = new navElem(63,"Measuring Equipment","pi-1335233879.htm",59,"Insp Met");
navigation[64] = new navElem(64,"Ultrasonic Testers","pi1340308918.htm",59,"Insp UL");
navigation[65] = new navElem(65,"Xray","pi170875921.htm",59,"Xray");
navigation[66] = new navElem(66,"Kiln","pi-1274556070.htm",null,"Kiln");
navigation[67] = new navElem(67,"Laboratory Equipment","pi364686201.htm",null,"Lab");
navigation[68] = new navElem(68,"Chemical Analysis","pi-728347371.htm",67,"Lab Met");
navigation[69] = new navElem(69,"Metalographic/ Sample Prep","pi-1787241914.htm",67,"Lab M");
navigation[70] = new navElem(70,"Physical Testing","pi1770234340.htm",67,"Lab Phys");
navigation[71] = new navElem(71,"Sand Testing","pi-1915141553.htm",67,"Lab San");
navigation[72] = new navElem(72,"Scales and Balances","pi1303496091.htm",67,"Scales");
navigation[73] = new navElem(73,"Ladle Heater","pi1650642024.htm",null,"Lad Heat");
navigation[74] = new navElem(74,"Ladles","pi-890589877.htm",null,"Lad");
navigation[75] = new navElem(75,"Automatic Pouring","pi1100973237.htm",74,"autopour");
navigation[76] = new navElem(76,"Bottom Pour","pi-1106523109.htm",74,"Lad BPV");
navigation[77] = new navElem(77,"Cylindrical Ladles","pi-1714182936.htm",74,"Lad HVB");
navigation[78] = new navElem(78,"Ductile Iron","pi-650398378.htm",74,"Lad Duc");
navigation[79] = new navElem(79,"Ladle Heater","pi1353079506.htm",74,"Ladle Heat");
navigation[80] = new navElem(80,"Lip Pour","pi-252283222.htm",74,"Lad LPVB");
navigation[81] = new navElem(81,"Tea Pot","pi-1133558939.htm",74,"Lad TPV");
navigation[82] = new navElem(82,"Magnet","pi-254912529.htm",null,"Mag");
navigation[83] = new navElem(83,"Melting and Transformers","pi8726153.htm",null,"Fur");
navigation[84] = new navElem(84,"Arc","pi1053813084.htm",83,"Arc F");
navigation[85] = new navElem(85,"Arc Transformer","pi1630842157.htm",83,"Arc T");
navigation[86] = new navElem(86,"Cooling Tower","pi1168073389.htm",83,"Fur TwrC");
navigation[87] = new navElem(87,"Heat Exchanger","pi1246384522.htm",83,"H EX");
navigation[88] = new navElem(88,"Induction","pi-697508980.htm",83,"Induc");
navigation[89] = new navElem(89,"Non Ferrous","pi-961141997.htm",83,"Non F E");
navigation[90] = new navElem(90,"Preheater","pi968319312.htm",83,"Preheat");
navigation[91] = new navElem(91,"Pumps","pi1261771939.htm",83,"Fur RP");
navigation[92] = new navElem(92,"Scrap Magnets","pi1706058972.htm",83,"Fur M");
navigation[93] = new navElem(93,"Stand By Generators","pi1253041989.htm",83,"Fur Gen");
navigation[94] = new navElem(94,"Vibrators","pi1113022284.htm",83,"Vib");
navigation[95] = new navElem(95,"Molding Equipment","pi-1632511952.htm",null,"Mold");
navigation[96] = new navElem(96,"Automatic","pi-914481039.htm",95,"Mold A");
navigation[97] = new navElem(97,"Conventional","pi1670461918.htm",95,"Mold C");
navigation[98] = new navElem(98,"Conveyor Lines","pi-2109393125.htm",95,"Conv Line");
navigation[99] = new navElem(99,"Permanent","pi-1380538616.htm",95,"Perm");
navigation[100] = new navElem(100,"Powder Feeder","pi1130808768.htm",95,"Pwdr Feed");
navigation[101] = new navElem(101,"Rollover","pi1110418625.htm",95,"rollover");
navigation[102] = new navElem(102,"Shell","pi1202415173.htm",95,"mold shell");
navigation[103] = new navElem(103,"Motors","pi1039368830.htm",null,"Mot");
navigation[104] = new navElem(104,"Mullers/ Gearboxes","pi-1677418489.htm",null,"Mul");
navigation[105] = new navElem(105,"Gearboxes","pi-846675571.htm",104,"Gear");
navigation[106] = new navElem(106,"Muller Parts","pi-1021229396.htm",104,"mull parts");
navigation[107] = new navElem(107,"Mullers","pi-1286182084.htm",104,"Muller");
navigation[108] = new navElem(108,"No Bake","pi-1958930813.htm",null,"No B");
navigation[109] = new navElem(109,"Batch Mixer","pi-1799164816.htm",108,"NB Batch");
navigation[110] = new navElem(110,"Compaction Tables","pi-684352575.htm",108,"No B CT");
navigation[111] = new navElem(111,"Continuous Mixers","pi-617016867.htm",108,"No B Mix");
navigation[112] = new navElem(112,"Drying Ovens","pi-375666962.htm",108,"No B DO");
navigation[113] = new navElem(113,"Heaters/ Coolers","pi945455759.htm",108,"No B SC");
navigation[114] = new navElem(114,"Loops and Turntables","pi-1701065769.htm",108,"No B L");
navigation[115] = new navElem(115,"Magnetic Separators","pi2100463445.htm",108,"No B MS");
navigation[116] = new navElem(116,"Mold Coating/ Mixing","pi1137906584.htm",108,"No B Coat");
navigation[117] = new navElem(117,"Mold Handlers","pi2109014457.htm",108,"No B MH");
navigation[118] = new navElem(118,"Powder Feeder","pi-1546977808.htm",108,"Pdr Feed");
navigation[119] = new navElem(119,"Reclaim","pi1235059590.htm",108,"No B R Sys");
navigation[120] = new navElem(120,"Pattern Shop","pi-848388865.htm",null,"Pat");
navigation[121] = new navElem(121,"Powder Coat and Paint","pi1096068166.htm",null,"powd-pnt");
navigation[122] = new navElem(122,"Process Equipment","pi-232450388.htm",null,"Pro");
navigation[123] = new navElem(123,"Agitators","pi-525482367.htm",122,"Pro Ag");
navigation[124] = new navElem(124,"Belt Filter","pi1032663446.htm",122,"blt filt");
navigation[125] = new navElem(125,"Evaporation","pi-1545700513.htm",122,"evap");
navigation[126] = new navElem(126,"Fertilizer Plant","pi-1942983515.htm",122,"fert plnt");
navigation[127] = new navElem(127,"Filter Press","pi-307033676.htm",122,"filt pres");
navigation[128] = new navElem(128,"MAP Plant","pi-698394878.htm",122,"map plnt");
navigation[129] = new navElem(129,"Merrick Feeder","pi-1922164901.htm",122,"merr feed");
navigation[130] = new navElem(130,"Packed Tower Scrubbers","pi-1613542633.htm",122,"pk twr scr");
navigation[131] = new navElem(131,"Pug Mill","pi1169947090.htm",122,"Pug Mill");
navigation[132] = new navElem(132,"Pumps","pi719043249.htm",122,"Pump");
navigation[133] = new navElem(133,"Carbon Steel","pi-553860025.htm",132,"C Pumps");
navigation[134] = new navElem(134,"Packaged w/ Controls","pi965102204.htm",132,"Pkg Pump");
navigation[135] = new navElem(135,"Stainless","pi-375728354.htm",132,"SS Pump");
navigation[136] = new navElem(136,"Spray Dryer","pi353754368.htm",122,"spry dry");
navigation[137] = new navElem(137,"Tanks","pi682991234.htm",122,"Pro SST");
navigation[138] = new navElem(138,"Alloy Tanks","pi-1721378559.htm",137,"alloy tnk");
navigation[139] = new navElem(139,"Carbon Steel Tanks","pi1931348782.htm",137,"carb tnk");
navigation[140] = new navElem(140,"Rollovers","pi-1808071562.htm",null,"Rol");
navigation[141] = new navElem(141,"Sand Cooler","pi1128016020.htm",null,"Sandcool");
navigation[142] = new navElem(142,"Shakeouts/ Screens","pi1028069346.htm",null,"Sha");
navigation[143] = new navElem(143,"Silos and Bins","pi-1284227397.htm",null,"Silo");
navigation[144] = new navElem(144,"Sand Tank","pi879534508.htm",143,"Snd Tnk");
navigation[145] = new navElem(145,"Vibra Bin Bottoms","pi1875084237.htm",143,"Silo Vib");
navigation[146] = new navElem(146,"Transporter","pi1054501567.htm",null,"P Trans");
navigation[147] = new navElem(147,"Vacuums","pi1133185248.htm",null,"Vac");
navigation[148] = new navElem(148,"Welders","pi1074700356.htm",null,"Weld");

// 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"));

