//
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,"Air Pistols: Co2 and Spring","pi922088765.htm",null,"AAP");
navigation[1] = new navElem(1,"Ammunition","pi-744964077.htm",0,"APAMM");
navigation[2] = new navElem(2,"Powerlets","pi1933257969.htm",0,"CO2POWER");
navigation[3] = new navElem(3,"Air Rifles: Spring, Gas and Precharged","pi1045490604.htm",null,"AAR");
navigation[4] = new navElem(4,"Ammunition","pi1170402754.htm",3,"ARAM");
navigation[5] = new navElem(5,"Scopes and Mounts","pi-418881024.htm",3,"SCOPES");
navigation[6] = new navElem(6,"Airsoft Accessories","pi2116811110.htm",null,"AAS");
navigation[7] = new navElem(7,"Batteries & Chargers","pi2085489545.htm",6,"BAAT");
navigation[8] = new navElem(8,"Eye Protection","pi1695559341.htm",6,"EYES");
navigation[9] = new navElem(9,"Gas","pi509147778.htm",6,"GASSS");
navigation[10] = new navElem(10,"Airsoft: Electric operated models","pi1427166611.htm",null,"AEG");
navigation[11] = new navElem(11,"Ammunition","pi1686467188.htm",10,"AEGAMMO");
navigation[12] = new navElem(12,"Batteries & Chargers","pi-1715325069.htm",10,"BATTC");
navigation[13] = new navElem(13,"Airsoft: Gas operated models (gas blowback)","pi-658937532.htm",null,"AGB");
navigation[14] = new navElem(14,"Ammunition","pi1415991744.htm",13,"GBAMMO");
navigation[15] = new navElem(15,"Gas","pi-1416601990.htm",13,"GBBG");
navigation[16] = new navElem(16,"Airsoft: Gas operated models (non-blowback)","pi-1376425702.htm",null,"AGN");
navigation[17] = new navElem(17,"Ammunition","pi-381069723.htm",16,"NBBAMMO");
navigation[18] = new navElem(18,"Gas","pi-445451011.htm",16,"NBBG");
navigation[19] = new navElem(19,"Airsoft: Spring operated pistols","pi-644375336.htm",null,"ASP");
navigation[20] = new navElem(20,"Ammunition","pi2137955414.htm",19,"ASAMMO");
navigation[21] = new navElem(21,"Airsoft: Spring operated rifles & shotguns","pi1663631634.htm",null,"ASR");
navigation[22] = new navElem(22,"Ammunition","pi-1956636901.htm",21,"SPRAMM");
navigation[23] = new navElem(23,"Ammunition & Gas/Co2","pi1046687397.htm",null,"AMMU");
navigation[24] = new navElem(24,"Blanks","pi1421564721.htm",23,"blank");
navigation[25] = new navElem(25,"Gas","pi1622350805.htm",23,"Gas");
navigation[26] = new navElem(26,"Inert Ammo","pi-877470909.htm",23,"inert");
navigation[27] = new navElem(27,"Badges and Patches","pi1057322006.htm",null,"BAD");
navigation[28] = new navElem(28,"Bashas","pi634114890.htm",null,"BASHA");
navigation[29] = new navElem(29,"Batons, Coshes and Nunchaku","pi-2004884105.htm",null,"BAT");
navigation[30] = new navElem(30,"Belts","pi705300581.htm",null,"BELT");
navigation[31] = new navElem(31,"Bergens, Rucksacks and Kitbags","pi1051696049.htm",null,"BAG");
navigation[32] = new navElem(32,"Kit Bags","pi33514526.htm",31,"KBAG");
navigation[33] = new navElem(33,"Bivi Bags","pi620108826.htm",null,"BIVI");
navigation[34] = new navElem(34,"Blankfirers","pi-330163177.htm",null,"BF");
navigation[35] = new navElem(35,"Blanks","pi1657802806.htm",34,"blanks");
navigation[36] = new navElem(36,"Bodywarmers and Survival Vests","pi-1846173219.htm",null,"BDW");
navigation[37] = new navElem(37,"Boiler suits, Coveralls & Flightsuits","pi-662156966.htm",null,"COV");
navigation[38] = new navElem(38,"Books and Literature","pi1163070592.htm",null,"BOOK");
navigation[39] = new navElem(39,"Bottles, Cups and Accessories","pi1400127633.htm",null,"BOT");
navigation[40] = new navElem(40,"Camouflage Uniform sets","pi-963907674.htm",null,"CAMOS");
navigation[41] = new navElem(41,"Camouflage Jackets","pi-497028688.htm",40,"CAMJAK");
navigation[42] = new navElem(42,"Camouflage Trousers","pi-1874310754.htm",40,"CAMTRS");
navigation[43] = new navElem(43,"Camping Equipment","pi1903963987.htm",null,"CP");
navigation[44] = new navElem(44,"Cookware","pi544700402.htm",43,"CPCOOK");
navigation[45] = new navElem(45,"Insect Nets and Repellent","pi1464932181.htm",43,"CPIS");
navigation[46] = new navElem(46,"Lighting and Firemaking","pi-851213941.htm",43,"CPLF");
navigation[47] = new navElem(47,"Medical Equipment","pi1668493518.htm",43,"FAD");
navigation[48] = new navElem(48,"Sleeping Equipment","pi1740127524.htm",43,"CPSLP");
navigation[49] = new navElem(49,"Catalogues","pi1046079161.htm",null,"CATA");
navigation[50] = new navElem(50,"Catapults","pi2012057208.htm",null,"CAT");
navigation[51] = new navElem(51,"Catapult Ammunition & Powerbands","pi-850341247.htm",50,"CATAMM");
navigation[52] = new navElem(52,"Cold-Weather clothing","pi1200502722.htm",null,"THERM");
navigation[53] = new navElem(53,"Cold Weather Accessories","pi-1614455186.htm",52,"CGLO");
navigation[54] = new navElem(54,"Cookware and Cooking Equipment","pi2067346376.htm",null,"COOK");
navigation[55] = new navElem(55,"Cups","pi1056018093.htm",54,"CUPS");
navigation[56] = new navElem(56,"Deact Pistols","pi-2117015110.htm",null,"DCP");
navigation[57] = new navElem(57,"Deactivated Revolvers","pi-1020582772.htm",56,"REVOL");
navigation[58] = new navElem(58,"Deact Rifles","pi-801754701.htm",null,"DCR");
navigation[59] = new navElem(59,"Deactivated Machine Guns","pi-1381765881.htm",58,"MACHGUN");
navigation[60] = new navElem(60,"Deactivated Sub-Machine Guns","pi763714374.htm",58,"SUBGUN");
navigation[61] = new navElem(61,"Desert Equipment","pi832092309.htm",null,"DESERT");
navigation[62] = new navElem(62,"Headwear and netting","pi-1625724674.htm",61,"HDSC");
navigation[63] = new navElem(63,"Webbing and Vests","pi-1335549943.htm",61,"DESLBE");
navigation[64] = new navElem(64,"Equipment Care and Cleaning Products","pi-82254952.htm",null,"CARE");
navigation[65] = new navElem(65,"Nikwax Goods","pi1058000631.htm",64,"NIK");
navigation[66] = new navElem(66,"Eyewear","pi-1365054812.htm",null,"EYE");
navigation[67] = new navElem(67,"Full Face Masks","pi-2039310635.htm",66,"FUF");
navigation[68] = new navElem(68,"Facepaint and Remover","pi1195632177.htm",null,"CAPO");
navigation[69] = new navElem(69,"Firemaking Equipment and Lighters","pi1768200302.htm",null,"FIRE");
navigation[70] = new navElem(70,"First Aid & Medical Kit","pi1055929056.htm",null,"FA");
navigation[71] = new navElem(71,"Flags","pi-523219121.htm",null,"FLAG");
navigation[72] = new navElem(72,"Footwear","pi-1208664830.htm",null,"BOOT");
navigation[73] = new navElem(73,"Boot Care equipment & Accessories","pi1546155218.htm",72,"CARMA");
navigation[74] = new navElem(74,"Shoes & Trainers","pi-1988742400.htm",72,"SHOTR");
navigation[75] = new navElem(75,"Socks & Gaiters","pi2114997714.htm",72,"SOCK");
navigation[76] = new navElem(76,"Wellington Boots","pi1634436443.htm",72,"WEL");
navigation[77] = new navElem(77,"Gloves","pi1054987159.htm",null,"GLO");
navigation[78] = new navElem(78,"Gun Cleaning and Maintenance","pi-1234550729.htm",null,"GCM");
navigation[79] = new navElem(79,"Hammocks","pi913872847.htm",null,"HAM");
navigation[80] = new navElem(80,"Hand and Leg Cuffs","pi578905858.htm",null,"CUFF");
navigation[81] = new navElem(81,"Headwear","pi-1084781241.htm",null,"HEAD");
navigation[82] = new navElem(82,"Beret and Cap Badges","pi-2118525896.htm",81,"CAPB");
navigation[83] = new navElem(83,"Helmets & Covers","pi2047975292.htm",81,"HELM");
navigation[84] = new navElem(84,"Jackets","pi1055234764.htm",null,"JAC");
navigation[85] = new navElem(85,"Cold-Weather Jackets","pi1872305070.htm",84,"JCOL");
navigation[86] = new navElem(86,"Waterproof Jackets","pi282381031.htm",84,"WJAC");
navigation[87] = new navElem(87,"Kids Camo","pi-651906121.htm",null,"KIDS");
navigation[88] = new navElem(88,"Knives and Tools","pi663584240.htm",null,"KNI");
navigation[89] = new navElem(89,"Sharpening Equipment and Honing Oil","pi1051180273.htm",88,"SHARP");
navigation[90] = new navElem(90,"Medals","pi-1164663087.htm",null,"MED");
navigation[91] = new navElem(91,"Mini Electric Airsoft","pi1045568462.htm",null,"MINI");
navigation[92] = new navElem(92,"Ammunition","pi764738854.htm",91,"MINAMMO");
navigation[93] = new navElem(93,"Mosquito nets and Insect Repellant","pi-2122910486.htm",null,"MOS");
navigation[94] = new navElem(94,"Navigation Equipment","pi1050313577.htm",null,"NAV");
navigation[95] = new navElem(95,"Map Cases","pi-1265231380.htm",94,"MAPCASE");
navigation[96] = new navElem(96,"NBC protection","pi-1957922065.htm",null,"NBC");
navigation[97] = new navElem(97,"Gas Masks","pi1051607201.htm",96,"GMASKS");
navigation[98] = new navElem(98,"NBC Suits","pi1441923662.htm",96,"NBCSUI");
navigation[99] = new navElem(99,"Respirator Filters","pi387742647.htm",96,"RESSIEF");
navigation[100] = new navElem(100,"Notepads & Stationary","pi1059569015.htm",null,"STAT");
navigation[101] = new navElem(101,"Pouches","pi1059041234.htm",null,"PCH");
navigation[102] = new navElem(102,"Webbing Pouches","pi-351759381.htm",101,"WEBPOC");
navigation[103] = new navElem(103,"Rations and Food","pi254756691.htm",null,"FOOD");
navigation[104] = new navElem(104,"Replica Guns","pi-926819559.htm",null,"REP");
navigation[105] = new navElem(105,"Replica Grenades","pi-2128101368.htm",104,"REPGR");
navigation[106] = new navElem(106,"Rifle Cases","pi1056360100.htm",null,"RIFCAS");
navigation[107] = new navElem(107,"Scopes, NVGs, Binos","pi1048158082.htm",null,"SCO");
navigation[108] = new navElem(108,"Binoculars & Misc.","pi405016411.htm",107,"BINO");
navigation[109] = new navElem(109,"Mounts","pi-1670223004.htm",107,"MOUN");
navigation[110] = new navElem(110,"Night Vision Equipment","pi-1864356094.htm",107,"NVG");
navigation[111] = new navElem(111,"Red Dot Sights","pi-1915500986.htm",107,"RDS");
navigation[112] = new navElem(112,"Shirts","pi-1018148105.htm",null,"SHI");
navigation[113] = new navElem(113,"Signalling Equipment","pi1490463882.htm",null,"SIG");
navigation[114] = new navElem(114,"Sleeping Bags & Equipment","pi1055756664.htm",null,"SLP");
navigation[115] = new navElem(115,"Sleeping Accessories","pi519666383.htm",114,"SLA");
navigation[116] = new navElem(116,"Stash bags, Stuff bags and Bergen Liners","pi1843040697.htm",null,"STASH");
navigation[117] = new navElem(117,"Superflauge","pi1037697498.htm",null,"SUP");
navigation[118] = new navElem(118,"Survival Kits and Accessories","pi-1806917913.htm",null,"SURV");
navigation[119] = new navElem(119,"Tactical Equipment","pi1048240853.htm",null,"TAC");
navigation[120] = new navElem(120,"Body Armour","pi-1698127194.htm",119,"BOD");
navigation[121] = new navElem(121,"Holsters","pi-307645905.htm",119,"HOLST");
navigation[122] = new navElem(122,"Pouches","pi-1767173754.htm",119,"TWEB");
navigation[123] = new navElem(123,"Weapon Accessories","pi-38794150.htm",119,"WEAPONACC");
navigation[124] = new navElem(124,"Torches, Spotlights, Gunlights & Accessories","pi2106012080.htm",null,"TORC");
navigation[125] = new navElem(125,"Lamping and Spotlights","pi-1893100676.htm",124,"SPOTL");
navigation[126] = new navElem(126,"Maglite Accessories","pi1054568196.htm",124,"MAGACC");
navigation[127] = new navElem(127,"Weapon Lights","pi426441514.htm",124,"TACL");
navigation[128] = new navElem(128,"Trousers","pi508690039.htm",null,"TRS");
navigation[129] = new navElem(129,"Waterproof Trousers","pi576026436.htm",128,"TRSW");
navigation[130] = new navElem(130,"T-Shirts","pi1053507538.htm",null,"TSH");
navigation[131] = new navElem(131,"Washing and Shaving Kits","pi-2045431885.htm",null,"WASH");
navigation[132] = new navElem(132,"Watches and Accessories","pi1497010831.htm",null,"WATCH");
navigation[133] = new navElem(133,"Waterproofs","pi1052234329.htm",null,"WAT");
navigation[134] = new navElem(134,"Others","pi-1410498787.htm",133,"WOTHER");
navigation[135] = new navElem(135,"Ponchos","pi-557181362.htm",133,"PON");
navigation[136] = new navElem(136,"Webbing","pi-2010671011.htm",null,"WEB");
navigation[137] = new navElem(137,"Workwear","pi-1991210685.htm",null,"WORK");
navigation[138] = new navElem(138,"WW2 Memorabilia, Clothing and Weaponry","pi1050400023.htm",null,"WW2");
navigation[139] = new navElem(139,"WW2 Badges, Medals, Patches and Insignia","pi334391076.htm",138,"WW2BAD");
navigation[140] = new navElem(140,"WW2 Pistols","pi-1882374976.htm",138,"WW2PIS");
navigation[141] = new navElem(141,"WW2 Rifles, Sub-Machine guns and Machine Guns","pi-367663957.htm",138,"WW2RIF");

// 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"));

