//
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/bulletcat1st.gif" width="18" height="13" alt="Bullet.gif" 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="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="18" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcatact.gif" width="18" height="13" 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="18" height="13" 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="18" height="13" 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,"Armbanduhren","pi1036872174.htm",null,"AArmb_allg");
navigation[1] = new navElem(1,"Almanus","pi-1147233066.htm",0,"Almanus");
navigation[2] = new navElem(2,"Aristo","pi1037898461.htm",0,"Aristo");
navigation[3] = new navElem(3,"Axcent","pi-855230027.htm",0,"axcent");
navigation[4] = new navElem(4,"Casio","pi1673621934.htm",0,"Casio");
navigation[5] = new navElem(5,"Sports Gear","pi-623652736.htm",4,"01Sports");
navigation[6] = new navElem(6,"Casio Funkuhren","pi-1312853798.htm",4,"Casio Funk");
navigation[7] = new navElem(7,"Oceanus by CASIO","pi1037782631.htm",4,"Oceanus");
navigation[8] = new navElem(8,"Citizen","pi1077611847.htm",0,"Citizen");
navigation[9] = new navElem(9,"ck-Watches","pi1068391535.htm",0,"cK-Watches");
navigation[10] = new navElem(10,"Davosa","pi1066200480.htm",0,"Davosa");
navigation[11] = new navElem(11,"Edox","pi-1962199274.htm",0,"Edox");
navigation[12] = new navElem(12,"Elysee","pi1025812010.htm",0,"Elysee");
navigation[13] = new navElem(13,"Fortis","pi-2084233400.htm",0,"Fortis");
navigation[14] = new navElem(14,"Glycine","pi-1772082752.htm",0,"Glycine");
navigation[15] = new navElem(15,"Hanhart","pi233537408.htm",0,"Hanhart");
navigation[16] = new navElem(16,"Hentschel","pi-1748546317.htm",0,"Hentschel");
navigation[17] = new navElem(17,"Jacob Jensen","pi1030435818.htm",0,"Jacob");
navigation[18] = new navElem(18,"Junghans","pi1035390345.htm",0,"Junghans");
navigation[19] = new navElem(19,"Lambretta","pi-1590676860.htm",0,"Lambretta");
navigation[20] = new navElem(20,"Maurice Lacroix","pi-1260680391.htm",0,"Maurice");
navigation[21] = new navElem(21,"Meistersinger","pi-1379848279.htm",0,"Meister");
navigation[22] = new navElem(22,"Mühle-Glashütte","pi1063273768.htm",0,"Mühl");
navigation[23] = new navElem(23,"Nautica","pi1036531493.htm",0,"Nautica");
navigation[24] = new navElem(24,"Norton","pi1026861551.htm",0,"Norton");
navigation[25] = new navElem(25,"Pacardt","pi1026990498.htm",0,"Pacardt");
navigation[26] = new navElem(26,"Poljot","pi-534304717.htm",0,"Poljot");
navigation[27] = new navElem(27,"Poljot International","pi-782966875.htm",0,"Poljot Int");
navigation[28] = new navElem(28,"Ratius","pi1036510733.htm",0,"Ratius");
navigation[29] = new navElem(29,"Swatch","pi1069194853.htm",0,"Swatch");
navigation[30] = new navElem(30,"Tissot","pi1055918054.htm",0,"Tissot");
navigation[31] = new navElem(31,"Uhrkraft","pi1082044791.htm",0,"Uhrkr");
navigation[32] = new navElem(32,"UTS","pi1045470849.htm",0,"UTS");
navigation[33] = new navElem(33,"Ventura","pi452273761.htm",0,"Ventura");
navigation[34] = new navElem(34,"Armbänder","pi1015012150.htm",null,"ABArmb");
navigation[35] = new navElem(35,"Faltschließenbänder","pi1603764635.htm",34,"1015");
navigation[36] = new navElem(36,"Kalbsleder glatt","pi2135838017.htm",34,"1025");
navigation[37] = new navElem(37,"Kalbsleder geprägt","pi-2056521106.htm",34,"1030");
navigation[38] = new navElem(38,"Echt Kroko","pi1819924823.htm",34,"1035");
navigation[39] = new navElem(39,"Echt Eidechse","pi930188035.htm",34,"1046");
navigation[40] = new navElem(40,"Echt Strauß","pi-1483676699.htm",34,"1047");
navigation[41] = new navElem(41,"Echt Haifisch","pi-1939535832.htm",34,"1048");
navigation[42] = new navElem(42,"Chronographenbänder","pi45936132.htm",34,"1055");
navigation[43] = new navElem(43,"Bänder von Uhrenherstellern","pi638784466.htm",34,"1065");
navigation[44] = new navElem(44,"Großuhrteile","pi1015012322.htm",null,"Großuhrt");
navigation[45] = new navElem(45,"Werke","pi2023411355.htm",44,"3035");
navigation[46] = new navElem(46,"Kinderuhren","pi1037181066.htm",null,"Kinder");
navigation[47] = new navElem(47,"Kuckucksuhren","pi1033119621.htm",null,"Kuckuck");
navigation[48] = new navElem(48,"Rally-Uhren","pi1054709098.htm",null,"Rally");
navigation[49] = new navElem(49,"Standuhren","pi994001981.htm",null,"Stand");
navigation[50] = new navElem(50,"Hermle","pi581548799.htm",49,"Hermlest");
navigation[51] = new navElem(51,"Tischuhren","pi1802734236.htm",null,"Tisch");
navigation[52] = new navElem(52,"Tischuhren-Hermle","pi1027067780.htm",51,"1508");
navigation[53] = new navElem(53,"Wanduhren","pi938621159.htm",null,"Wand");
navigation[54] = new navElem(54,"Hermle","pi1049195252.htm",53,"Hermle");
navigation[55] = new navElem(55,"Wiegand","pi177679156.htm",53,"Wiegand");
navigation[56] = new navElem(56,"Werkzeug","pi-1656278237.htm",null,"Werkzeug");
navigation[57] = new navElem(57,"Pinzetten","pi1015331004.htm",56,"3505");
navigation[58] = new navElem(58,"Schraubendreher","pi-910528349.htm",56,"3510");
navigation[59] = new navElem(59,"Uhrmacher-Zangen","pi817381032.htm",56,"3515");
navigation[60] = new navElem(60,"Gläser u.Gehäuse-WZ","pi2058220425.htm",56,"3520");
navigation[61] = new navElem(61,"Spezialwerkzeug","pi-828316394.htm",56,"3525");
navigation[62] = new navElem(62,"Allgemein","pi1014418909.htm",56,"3530");
navigation[63] = new navElem(63,"Maschinen","pi-624412141.htm",56,"3535");
navigation[64] = new navElem(64,"Uhrmacher-Set","pi-1793005395.htm",56,"Werkzeugse");
navigation[65] = new navElem(65,"Zubehör","pi-1005493407.htm",null,"Zubehö");
navigation[66] = new navElem(66,"Uhrenbeweger","pi1025619296.htm",65,"Z1");
navigation[67] = new navElem(67,"Sammlerboxen","pi1254321077.htm",65,"Z2");
navigation[68] = new navElem(68,"Sonderangebote","pi1075501336.htm",null,"ZZZ");
navigation[69] = new navElem(69,"Armbanduhren","pi-968917751.htm",68,"son-arm");

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

