//
function miniCart(){
var prdCount = 0, prdString = "", subTotal = (xmlConfig.cartSubTotal > 0)?xmlConfig.cartSubTotal:0;
var tmpVariants = "", strVariants = "";
var mbullet = '<img src="assets/images/bulletcat1st.gif" width="13" height="14" alt="Bullet.gif" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">';
	if(xmlOHeader.childNodes.length==0) subTotal = 0;
	for(var i=0;i<xmlOHeader.childNodes.length;i++){
		prdCount = prdCount+(parseInt(xmlOHeader.childNodes[i].QuantityAmount));
		};
	prdString += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"100%\">";
		if(prdCount > 0){
		prdString += "<tr>"
			+ "<td colspan=\"2\">"
				+ "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"100%\">"
						+ "<td align=\"right\" nowrap=\"true\" width=\"20\">#&nbsp;</td>"
						+ "<td><strong>Bezeichnung</strong></td>"
						+ "<td align=\"center\" width=\"40\" nowrap=\"true\"><strong>Preis</strong></td>"
					+ "</tr>";
				for(var i=0;i<xmlOHeader.childNodes.length;i++){
				tmpVariants = xmlOHeader.childNodes[i].getFirstItem("Internal").variants.split("@");
				if(tmpVariants.length>1){
					for(var j=0;j<tmpVariants.length-1;j++){
						tmpElement = tmpVariants[j].split(";");
						strVariants += "search" + j + "_EQ_" + tmpElement[1] + "_AND_";
						};
					strVariants += "{EOL}";
					};
					prdString += "<tr valign=\"top\">"
						+ "<td align=\"right\">" + xmlOHeader.childNodes[i].QuantityAmount + "&nbsp;</td>"
						+ "<td>"
							+ "<a href=\"" + xmlOHeader.childNodes[i].getFirstItem("Internal").address + "?defaultVariants=" + strVariants + "&categoryId=" + xmlOHeader.childNodes[i].getFirstItem("Internal").navIndex + "\">"
							+ xmlOHeader.childNodes[i].Name
						+ "</a></td>"
						+ "<td align=\"right\" nowrap=\"true\">" + (parseFloat(xmlOHeader.childNodes[i].PriceGrossLineTotalLC).toFixed(2)).toString().replace('.',',') + "</td>"
						+ "</tr>";
					};
	prdString += "</table><br>"	
			+ "</td>"
		+ "</tr>"
		+ "<tr>"
			+ "<td align=\"right\" nowrap=\"true\" width=\"20\"><strong>" + prdCount + "</strong>&nbsp;</td>"
			+ "<td align=\"right\"><strong>&nbsp;" + TFormatCurrency(subTotal, objPriCurrency) + "</strong><td>"
		+ "</tr>"
		+ "<tr align=\"right\">"
			+ "<td colspan=\"2\"><a class=\"WAGRUNAV\" href=\"orderform." + xmlConfig.fileExtension + "\">"
			+ mbullet + "<strong>Zum Bestellschein</strong></a>"
			+ "</td>"
		+ "</tr>";
	}
	else{
		prdString += "<tr>"
			+ "<td>"
			+ "<td>Ihr Bestellschein ist leer...</td>"
			+ "</tr>";
		};
	prdString += "</table>";
	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(start,end){
                var strHTML="";
                for(var i=start;i<Math.min(end+1,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,"Puzzle","pi1739330956.htm",null,"0");
navigation[1] = new navElem(1,"Knopfpuzzle","pi-167153845.htm",0,"1");
navigation[2] = new navElem(2,"Lagenpuzzle","pi1432744496.htm",0,"2");
navigation[3] = new navElem(3,"Bodenpuzzle","pi914535025.htm",0,"3");
navigation[4] = new navElem(4,"Spiele aus Holz","pi2073792925.htm",null,"4");
navigation[5] = new navElem(5,"Angelspiele","pi-1788107110.htm",null,"5");
navigation[6] = new navElem(6,"Bewegung","pi538617107.htm",null,"6");
navigation[7] = new navElem(7,"Baby & Kleinkind","pi-1161947560.htm",null,"7");
navigation[8] = new navElem(8,"Denkspiele","pi2038234489.htm",null,"8");
navigation[9] = new navElem(9,"Erforschen","pi1943503663.htm",null,"9");
navigation[10] = new navElem(10,"Drinnen & Draußen","pi1743995974.htm",null,"10");
navigation[11] = new navElem(11,"Geschicklichkeit","pi144303183.htm",null,"11");
navigation[12] = new navElem(12,"Holzbausteine","pi-1897128988.htm",null,"12");
navigation[13] = new navElem(13,"Kaufladen","pi-980435179.htm",null,"13");
navigation[14] = new navElem(14,"Konstruktion","pi-63867726.htm",null,"14");
navigation[15] = new navElem(15,"Lernspiele","pi680190942.htm",null,"15");
navigation[16] = new navElem(16,"Minispiele","pi178487815.htm",null,"16");
navigation[17] = new navElem(17,"Modellieren","pi1682974012.htm",null,"17");
navigation[18] = new navElem(18,"Motorik","pi-964004979.htm",null,"18");
navigation[19] = new navElem(19,"Verkehr","pi744947146.htm",null,"19");
navigation[20] = new navElem(20,"Wahrnehmung","pi1453201539.htm",null,"20");
navigation[21] = new navElem(21,"Sandspielzeug","pi-1615411297.htm",null,"21");
navigation[22] = new navElem(22,"Bücher","pi-1980197162.htm",null,"22");
navigation[23] = new navElem(23,"Handpuppen","pi-1413076713.htm",null,"23");
navigation[24] = new navElem(24,"Normale","pi1847979720.htm",23,"24");
navigation[25] = new navElem(25,"Große Handpuppen","pi1147793548.htm",23,"25");
navigation[26] = new navElem(26,"Set&#0039;s","pi-1682108259.htm",23,"26");
navigation[27] = new navElem(27,"Fingerpuppen","pi812265498.htm",null,"27");
navigation[28] = new navElem(28,"Handfingerpuppen","pi-295579501.htm",null,"28");
navigation[29] = new navElem(29,"Biegepuppen","pi1314241496.htm",null,"29");
navigation[30] = new navElem(30,"Anziehpuppen","pi-1982458631.htm",null,"30");
navigation[31] = new navElem(31,"Puppenhaus","pi-1296472634.htm",null,"31");
navigation[32] = new navElem(32,"Kuscheltiere","pi-957671679.htm",null,"32");
navigation[33] = new navElem(33,"Sonstiges","pi-1668348629.htm",null,"33");
navigation[34] = new navElem(34,"Papier","pi-129613097.htm",null,"34");
navigation[35] = new navElem(35,"Tonpapier","pi-2027492916.htm",34,"35");
navigation[36] = new navElem(36,"Fotokarton","pi786718941.htm",34,"36");
navigation[37] = new navElem(37,"Faltpapier","pi325817562.htm",34,"37");
navigation[38] = new navElem(38,"Blöcke","pi233877144.htm",34,"38");
navigation[39] = new navElem(39,"Krepppapier","pi1579892921.htm",34,"39");
navigation[40] = new navElem(40,"Motivkarton","pi-371795569.htm",34,"40");
navigation[41] = new navElem(41,"Musterkarton","pi-84232156.htm",34,"41");
navigation[42] = new navElem(42,"Seidenpapier","pi-1266502059.htm",34,"42");
navigation[43] = new navElem(43,"Transparentpapier","pi-687183118.htm",34,"43");
navigation[44] = new navElem(44,"Wellpappe","pi-1419102069.htm",34,"44");
navigation[45] = new navElem(45,"Farben","pi742254330.htm",null,"45");
navigation[46] = new navElem(46,"Leim","pi-1058654733.htm",null,"46");
navigation[47] = new navElem(47,"Stifte","pi-1162883656.htm",null,"47");
navigation[48] = new navElem(48,"Scheren & Messer","pi-1715832487.htm",null,"48");
navigation[49] = new navElem(49,"Knete","pi-401782106.htm",null,"49");
navigation[50] = new navElem(50,"Bast","pi-1494793425.htm",null,"50");
navigation[51] = new navElem(51,"Moosgummi","pi1036192068.htm",null,"51");
navigation[52] = new navElem(52,"Pfeifenputzer","pi312195317.htm",null,"52");
navigation[53] = new navElem(53,"Wackelaugen","pi1640734994.htm",null,"53");
navigation[54] = new navElem(54,"Flechtschnüre","pi-1912505301.htm",null,"54");
navigation[55] = new navElem(55,"Folien","pi-1080986224.htm",null,"55");
navigation[56] = new navElem(56,"Bastelfilz","pi-265221551.htm",null,"56");
navigation[57] = new navElem(57,"Wolle & Federn","pi119772734.htm",null,"57");
navigation[58] = new navElem(58,"Sonstiges","pi331160807.htm",null,"58");
navigation[59] = new navElem(59,"Gestalten","pi803391655.htm",null,"59");
navigation[60] = new navElem(60,"aus Naturholz","pi1135107470.htm",59,"60");
navigation[61] = new navElem(61,"aus Baumwolle","pi1176897015.htm",59,"61");
navigation[62] = new navElem(62,"Set&#0039;s","pi1399330115.htm",null,"68");
navigation[63] = new navElem(63,"Große","pi-1055252532.htm",null,"69");
navigation[64] = new navElem(64,"Mittlere","pi1630068445.htm",null,"70");
navigation[65] = new navElem(65,"Kleine","pi-223757606.htm",null,"71");
navigation[66] = new navElem(66,"Extrafahrzeuge","pi439727187.htm",null,"72");
navigation[67] = new navElem(67,"Dekoration","pi-592801051.htm",null,"73");
navigation[68] = new navElem(68,"Außenspielgeräte","pi171282498.htm",null,"74");
navigation[69] = new navElem(69,"Möbel","pi830842779.htm",null,"75");
navigation[70] = new navElem(70,"Sonderangebote","pi-388777920.htm",null,"76");

// 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"));

