//
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/bullet.gif" width="14" height="14" 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="0" >';
		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="14" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcatact.gif" width="14" height="14" 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="14" height="14" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/bulletcat1stcls.gif" width="14" height="14" 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,"Ontario Knife Company 2009","pi1235139866.htm",null,"100");
navigation[1] = new navElem(1,"Blackhawk Knife 2009","pi1236423580.htm",null,"101");
navigation[2] = new navElem(2,"EICKHORN-Solingen 2009","pi1237209021.htm",null,"102");
navigation[3] = new navElem(3,"BÖKER-Solingen 2009 & 2011","pi1238064156.htm",null,"103");
navigation[4] = new navElem(4,"WENGER Schweizer Küchenmesser","pi-262165201.htm",null,"110");
navigation[5] = new navElem(5,"Citadel-Messer-handgeschmiedet","pi1290089512.htm",null,"111");
navigation[6] = new navElem(6,"Sonderangebote & Restposten","pi1263909823.htm",null,"122");
navigation[7] = new navElem(7,"FKMD SPECIALTY KNIVES","pi1257859959.htm",null,"125");
navigation[8] = new navElem(8,"MESSER & EDELSTEINE","pi709905629.htm",null,"133");
navigation[9] = new navElem(9,"Edelstein-Gemstone","pi1308388877.htm",8,"134");
navigation[10] = new navElem(10,"BÖKER-Solingen Manufaktur Damast","pi1244451989.htm",null,"155");
navigation[11] = new navElem(11,"KÜCHENHELFER BÖKER SOLINGEN ","pi1298628347.htm",10,"157");
navigation[12] = new navElem(12,"Damast und VG-10 Stahl Küchenmesser","pi-511704872.htm",null,"156");
navigation[13] = new navElem(13,"Brieföffner und Geschenkset","pi1316607853.htm",null,"166");
navigation[14] = new navElem(14,"MUELA neu 2011","pi-250663554.htm",null,"178");
navigation[15] = new navElem(15,"MEYERCO Texas USA","pi1320143064.htm",null,"191");
navigation[16] = new navElem(16,"Rettungsmesser & Ausrüstung","pi-635355554.htm",null,"20");
navigation[17] = new navElem(17,"KERSHOW KNIVES USA","pi1324985859.htm",null,"200");
navigation[18] = new navElem(18,"Überlebensmesser","pi-630717508.htm",null,"21");
navigation[19] = new navElem(19,"Jagdmesser","pi-1883338493.htm",null,"22");
navigation[20] = new navElem(20,"Freizeitmesser, Wurfmesser & Tools","pi-447297656.htm",null,"23");
navigation[21] = new navElem(21,"Wurfmesser","pi1076253357.htm",20,"Wurfmesser");
navigation[22] = new navElem(22,"Militärmesser","pi-2121973015.htm",null,"24");
navigation[23] = new navElem(23,"Einsatzmesser-Neuheiten 2009","pi1242035533.htm",22,"115");
navigation[24] = new navElem(24,"Fahrtenmesser & Outdoormesser","pi1953720127.htm",null,"25");
navigation[25] = new navElem(25,"Laguiolemesser aus Frankreich","pi-70533100.htm",null,"26");
navigation[26] = new navElem(26,"Sammlermesser","pi1300465753.htm",null,"27");
navigation[27] = new navElem(27,"Mini-Taschenmesser","pi2029114849.htm",null,"28");
navigation[28] = new navElem(28,"Feststellbare-Taschenmesser","pi-1208274602.htm",null,"30");
navigation[29] = new navElem(29,"Springmesser","pi1983418068.htm",null,"31");
navigation[30] = new navElem(30,"Einhandtaschenmesser","pi-745665353.htm",null,"32");
navigation[31] = new navElem(31,"Jagdtaschenmesser","pi1648304207.htm",null,"33");
navigation[32] = new navElem(32,"Bowiemesser","pi-130992080.htm",null,"34");
navigation[33] = new navElem(33,"Design-Einhandtaschenmesser","pi-303989876.htm",null,"35");
navigation[34] = new navElem(34,"Elegante-Einhandtaschenmesser","pi1316646165.htm",null,"36");
navigation[35] = new navElem(35,"Skinnermesser","pi-471036671.htm",null,"37");
navigation[36] = new navElem(36,"Tauchermesser","pi-1836863698.htm",null,"38");
navigation[37] = new navElem(37,"Beile und Äxte","pi-355563198.htm",null,"39");
navigation[38] = new navElem(38,"Macheten & Haumesser","pi1482960961.htm",null,"40");
navigation[39] = new navElem(39,"Kampfmesser","pi-424907671.htm",null,"41");
navigation[40] = new navElem(40,"Dolche","pi-1083738142.htm",null,"42");
navigation[41] = new navElem(41,"High-Tech-Messer","pi-337905483.htm",null,"43");
navigation[42] = new navElem(42,"Küchen & Kochmesser","pi-889826638.htm",null,"44");
navigation[43] = new navElem(43,"Smith & Wesson","pi-421803883.htm",null,"45");
navigation[44] = new navElem(44,"LINTON-Messer","pi1088590832.htm",null,"46");
navigation[45] = new navElem(45,"Messer Neuheiten","pi-1425200119.htm",null,"47");
navigation[46] = new navElem(46,"MANTIS USA","pi413433228.htm",45,"199");
navigation[47] = new navElem(47,"Messer Neuheiten 2008 & 2012","pi1140260305.htm",45,"58");
navigation[48] = new navElem(48,"Küchenmesser Neuheiten ","pi1886134113.htm",null,"48");
navigation[49] = new navElem(49,"Cera-Titan Solingen","pi-260924169.htm",48,"112");
navigation[50] = new navElem(50,"Neuheiten Japanische Kochmesser ","pi-579371209.htm",48,"49");
navigation[51] = new navElem(51,"Sakai-Seki-Linie","pi-1230507501.htm",50,"50");
navigation[52] = new navElem(52,"Traditionelle-Linie ","pi-334181880.htm",50,"51");
navigation[53] = new navElem(53,"YADAMA Damastküchenmesser ","pi1159433546.htm",50,"65");
navigation[54] = new navElem(54,"CRKT-Messer ","pi1671844059.htm",null,"52");
navigation[55] = new navElem(55,"CRKT INOX Phone case","pi-1796622447.htm",54,"180");
navigation[56] = new navElem(56,"Schweizer Taschenmesser","pi-907724993.htm",null,"53");
navigation[57] = new navElem(57,"WENGER SWISS WATCH","pi1137507061.htm",56,"61");
navigation[58] = new navElem(58,"Tiermotivmesser ab 2006 & 2010","pi1957884579.htm",null,"54");
navigation[59] = new navElem(59,"LEATHERMAN","pi1195645630.htm",null,"55");
navigation[60] = new navElem(60,"Opinel","pi1131106616.htm",null,"56");
navigation[61] = new navElem(61,"US SPECIALS 2008 & 2010","pi-832356166.htm",null,"57");
navigation[62] = new navElem(62,"Tops Knives USA","pi-2002180217.htm",61,"177");
navigation[63] = new navElem(63,"REMINGTON","pi399147261.htm",61,"60");
navigation[64] = new navElem(64,"Marttiini Finland","pi1133793741.htm",null,"59");
navigation[65] = new navElem(65,"HARTKOPF-SOLINGEN","pi1185648554.htm",null,"77");
navigation[66] = new navElem(66,"PUMA-2008 & 2011","pi-1764277102.htm",null,"78");
navigation[67] = new navElem(67,"KYOCERA- Keramik","pi-1297111936.htm",null,"80");
navigation[68] = new navElem(68,"KA-BAR Knives 2009","pi-1734118216.htm",null,"85");
navigation[69] = new navElem(69,"Stilvolles aus Italien","pi-1180246177.htm",null,"89");
navigation[70] = new navElem(70,"Sommelier-Messer ","pi-2046391269.htm",69,"79");
navigation[71] = new navElem(71,"Armbrüste & Ersatzteile","pi1075384294.htm",null,"Armbrüste");
navigation[72] = new navElem(72,"Speedlock","pi-1479461708.htm",null,"Böker");
navigation[73] = new navElem(73,"Damastmesser","pi505412517.htm",null,"Böker Dick");
navigation[74] = new navElem(74,"Bumerang","pi1075113385.htm",null,"Bumerang");
navigation[75] = new navElem(75,"XXL-Messer und Deko-Waffen","pi1077884988.htm",null,"Deko");
navigation[76] = new navElem(76,"Japanmesser","pi2012576258.htm",null,"Dick");
navigation[77] = new navElem(77,"Fantasy","pi1074246726.htm",null,"Fantasy");
navigation[78] = new navElem(78,"MOKI-Messer","pi1078999110.htm",null,"Moki");
navigation[79] = new navElem(79,"OPTIMA-Messersystem","pi1084448128.htm",null,"OPTI");
navigation[80] = new navElem(80,"SOG-Messer","pi45641601.htm",null,"SOG");
navigation[81] = new navElem(81,"Zubehör-Etui und Schärfen","pi-1358019717.htm",null,"Zubehör");
navigation[82] = new navElem(82,"Kleine Stahlkunde","pi1410131839.htm",81,"62");
navigation[83] = new navElem(83,"Jagd-Zubehör","pi1071675302.htm",81,"Jagd");

// 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"));


