//
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="11" height="14" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">' + "Zum Warenkorb</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\">Alles unter dem Sichelmond</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="11" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcat1st.gif" width="11" 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="11" height="14" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/bulletcat1st.gif" width="20" height="15" 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,"*Katalog-CD und Gutscheine* ","pi1140236127.htm",null,"1");
navigation[1] = new navElem(1,"*Neuheiten*","pi1142531386.htm",null,"0");
navigation[2] = new navElem(2,"Anhänger","pi1560619807.htm",1,"0-2");
navigation[3] = new navElem(3,"Armschmuck","pi1298688036.htm",1,"0-4");
navigation[4] = new navElem(4,"Ketten & Colliers","pi1192638550.htm",1,"0-1");
navigation[5] = new navElem(5,"Ohrschmuck","pi1801875060.htm",1,"0-3");
navigation[6] = new navElem(6,"Ringe","pi1166521000.htm",1,"0-5");
navigation[7] = new navElem(7,"Kostüme & Tanz-Bedarf","pi-99274587.htm",null,"3");
navigation[8] = new navElem(8,"Hüftgürtel","pi-843842284.htm",7,"3.3");
navigation[9] = new navElem(9,"Hüfttücher","pi-2108180417.htm",7,"3.2");
navigation[10] = new navElem(10,"Komplett-Kostüme","pi-1642377738.htm",7,"3.1");
navigation[11] = new navElem(11,"Oberteile","pi-158664350.htm",7,"3.5");
navigation[12] = new navElem(12,"Röcke, Schleier & Hosen","pi-1090292603.htm",7,"3.4");
navigation[13] = new navElem(13,"sonstiges","pi553378363.htm",7,"3.6");
navigation[14] = new navElem(14,"Musikinstrumente","pi-426348666.htm",null,"8");
navigation[15] = new navElem(15,"Schellen & sonstiges","pi-641189596.htm",14,"8.2");
navigation[16] = new navElem(16,"Tambourine & Fußrasseln","pi1948515983.htm",14,"8.1");
navigation[17] = new navElem(17,"Orientalisches Ambiente","pi-1443421941.htm",null,"4");
navigation[18] = new navElem(18,"Kerzenhalter, Kerzen und Zubehör","pi834096426.htm",17,"4.4");
navigation[19] = new navElem(19,"Kerzen und Zubehör","pi896231846.htm",18,"4.4.1");
navigation[20] = new navElem(20,"Kerzenhalter","pi-1874020817.htm",18,"4.4.2");
navigation[21] = new navElem(21,"Schatullen & Truhen","pi1095404890.htm",17,"4.5");
navigation[22] = new navElem(22,"Schreibwaren","pi-1993137124.htm",17,"4.7");
navigation[23] = new navElem(23,"Spiegel","pi1693290112.htm",17,"4.1");
navigation[24] = new navElem(24,"Statuen","pi503570462.htm",17,"4.2");
navigation[25] = new navElem(25,"Wohnaccessoires","pi-1640342760.htm",17,"4.6");
navigation[26] = new navElem(26,"Räucherwerk & ätherische Öle","pi1032466084.htm",null,"6");
navigation[27] = new navElem(27,"ätherische Öle & Duftlampen","pi-1122855235.htm",26,"6.3");
navigation[28] = new navElem(28,"Räucherstäbchen & Halter","pi-1612020948.htm",26,"6.2");
navigation[29] = new navElem(29,"Weihrauchmischungen & Gefäße","pi-1376629446.htm",26,"6.4");
navigation[30] = new navElem(30,"Schmuck","pi-1035379276.htm",null,"2");
navigation[31] = new navElem(31,"Anhänger","pi-27692800.htm",30,"2.1");
navigation[32] = new navElem(32,"Echt-Schmuck","pi947169124.htm",31,"2.1.1");
navigation[33] = new navElem(33,"Modeschmuck","pi-1612364651.htm",31,"2.1.2");
navigation[34] = new navElem(34,"Silberkettchen","pi1032032165.htm",31,"2.1.3");
navigation[35] = new navElem(35,"Armreifen und Handschmuck","pi1302311180.htm",30,"2.5");
navigation[36] = new navElem(36,"Echt-Schmuck","pi-2017746756.htm",35,"2.5.1");
navigation[37] = new navElem(37,"Modeschmuck","pi-245094131.htm",35,"2.5.2");
navigation[38] = new navElem(38,"Folklore & Tribal","pi122727161.htm",30,"2.10");
navigation[39] = new navElem(39,"Fußkettchen","pi853798679.htm",30,"2.4");
navigation[40] = new navElem(40,"Echtschmuck","pi1850135390.htm",39,"2.4.1");
navigation[41] = new navElem(41,"Modeschmuck","pi-2049336441.htm",39,"2.4.2");
navigation[42] = new navElem(42,"Halsreifen und -bänder","pi-1109672146.htm",30,"2.3");
navigation[43] = new navElem(43,"echter Glas-Schmuck","pi1142153835.htm",42,"2.3.3");
navigation[44] = new navElem(44,"Echt-Schmuck","pi426390960.htm",42,"2.3.1");
navigation[45] = new navElem(45,"Modeschmuck","pi-538472463.htm",42,"2.3.2");
navigation[46] = new navElem(46,"Ketten & Colliers","pi1363074305.htm",30,"2.2");
navigation[47] = new navElem(47,"Echt-Schmuck","pi321580082.htm",46,"2.2.1");
navigation[48] = new navElem(48,"Modeschmuck","pi-2126483253.htm",46,"2.2.2");
navigation[49] = new navElem(49,"Ohrringe","pi623044381.htm",30,"2.6");
navigation[50] = new navElem(50,"Echt-Schmuck","pi767354186.htm",49,"2.6.1");
navigation[51] = new navElem(51,"Modeschmuck","pi548719107.htm",49,"2.6.2");
navigation[52] = new navElem(52,"Ringe","pi-653873638.htm",30,"2.7");
navigation[53] = new navElem(53,"Schmuck-Sets","pi-1602328104.htm",30,"2.9");
navigation[54] = new navElem(54,"Strass","pi1678361542.htm",30,"2.11");
navigation[55] = new navElem(55,"Tiaras & Diademe","pi-1424492909.htm",30,"2.8");
navigation[56] = new navElem(56,"Echt-Schmuck","pi-553241464.htm",55,"2.8.1");
navigation[57] = new navElem(57,"Modeschmuck","pi1095330793.htm",55,"2.8.2");
navigation[58] = new navElem(58,"Wasserpfeifen/Shishas und Zubehör","pi1905575702.htm",null,"5");
navigation[59] = new navElem(59,"Dichtung und Ventile","pi409175046.htm",58,"5.4");
navigation[60] = new navElem(60,"Kohle und Gasbrenner","pi362518799.htm",58,"5.5");
navigation[61] = new navElem(61,"Tabak","pi15145154.htm",58,"5.2");
navigation[62] = new navElem(62,"Tabak, Köpfe, Siebe und Alufolie","pi1734799754.htm",58,"5.6");
navigation[63] = new navElem(63,"Wasserpfeifen/Shishas","pi1150029157.htm",58,"5.1");
navigation[64] = new navElem(64,"Zubehör","pi-1352817125.htm",58,"5.3");

// 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"));

