//
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="13" height="14" 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="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,"Neu im Shop","pi1068127609.htm",null,"01");
navigation[1] = new navElem(1,"Stoffe nach Designer","pi-1934698547.htm",null,"1");
navigation[2] = new navElem(2,"Kaffe Fassett","pi530716355.htm",1,"11");
navigation[3] = new navElem(3,"Streifen","pi1066063002.htm",2,"111");
navigation[4] = new navElem(4,"Narrow Stripe","pi1041533283.htm",3,"1114");
navigation[5] = new navElem(5,"Blue & White Stripe ","pi637072513.htm",3,"1116");
navigation[6] = new navElem(6,"Rowan Stripe","pi-25401833.htm",3,"1118");
navigation[7] = new navElem(7,"Haze Stripe","pi1156822990.htm",3,"1119");
navigation[8] = new navElem(8,"Karos","pi-1647226298.htm",2,"112");
navigation[9] = new navElem(9,"Broad Check","pi-2127144369.htm",8,"1121");
navigation[10] = new navElem(10,"Narrow Check","pi329301392.htm",8,"1122");
navigation[11] = new navElem(11,"kleine Stoffdrucke","pi1794792497.htm",2,"113");
navigation[12] = new navElem(12,"Flower Dot","pi1218962084.htm",11,"11-87");
navigation[13] = new navElem(13,"Roman Glass","pi-1810482530.htm",11,"11-GP01");
navigation[14] = new navElem(14,"Buttons","pi-1041686835.htm",11,"11GP101");
navigation[15] = new navElem(15,"Paperweight","pi-1850295638.htm",11,"11-GP20");
navigation[16] = new navElem(16,"Spools","pi1652856150.htm",11,"11-GP34");
navigation[17] = new navElem(17,"Islands","pi-523732492.htm",11,"11-GP49");
navigation[18] = new navElem(18,"Clover","pi1277045546.htm",11,"11-GP73");
navigation[19] = new navElem(19,"Millefiore","pi1230018700.htm",11,"11-GP92");
navigation[20] = new navElem(20,"Spots","pi1869102742.htm",11,"GP70");
navigation[21] = new navElem(21,"Aboriginal","pi-465363197.htm",11,"GP71");
navigation[22] = new navElem(22,"Star Flower","pi1215273322.htm",11,"GP88");
navigation[23] = new navElem(23,"florale Drucke","pi2105445812.htm",2,"114");
navigation[24] = new navElem(24,"Silhouette","pi1207388562.htm",23,"11-77");
navigation[25] = new navElem(25,"Stencil","pi1269210949.htm",23,"11-79");
navigation[26] = new navElem(26,"Persian Vase","pi1262520820.htm",23,"11-GP100");
navigation[27] = new navElem(27,"Gothic","pi29503341.htm",23,"11-GP102");
navigation[28] = new navElem(28,"Suzani","pi121838975.htm",23,"11-GP105");
navigation[29] = new navElem(29,"Embroidered Shawl","pi-2120763583.htm",23,"11-GP106");
navigation[30] = new navElem(30,"Sprays","pi282046373.htm",23,"11-GP107");
navigation[31] = new navElem(31,"Rustic Floral","pi1747882925.htm",23,"11-GP108");
navigation[32] = new navElem(32,"Plink","pi-2043548658.htm",23,"11-GP109");
navigation[33] = new navElem(33,"Cogs","pi1616527913.htm",23,"11-GP110");
navigation[34] = new navElem(34,"Rosette","pi1269775875.htm",23,"11-GP112");
navigation[35] = new navElem(35,"Lotus Leaf","pi1933825094.htm",23,"11-GP29");
navigation[36] = new navElem(36,"Fan Flower","pi587363463.htm",23,"11-GP36");
navigation[37] = new navElem(37,"Burnt Wood Rose","pi1309697328.htm",23,"11-GP47");
navigation[38] = new navElem(38,"Auricula","pi1319688313.htm",23,"11-GP52");
navigation[39] = new navElem(39,"Dahlia Blooms","pi-751409021.htm",23,"11-GP54");
navigation[40] = new navElem(40,"Floating Flowers","pi1161410221.htm",23,"11-GP56");
navigation[41] = new navElem(41,"Guinea Flowers","pi-159718782.htm",23,"11-GP59");
navigation[42] = new navElem(42,"Paisly Jungle","pi1588382867.htm",23,"11-GP60");
navigation[43] = new navElem(43,"Verbena","pi-2086032513.htm",23,"11-GP61");
navigation[44] = new navElem(44,"Potentilla","pi1472748730.htm",23,"11-GP64");
navigation[45] = new navElem(45,"Pinking Flower","pi1187977087.htm",23,"11-GP66");
navigation[46] = new navElem(46,"Persimmon","pi1462553354.htm",23,"11-GP74");
navigation[47] = new navElem(47,"Lichen","pi-1289456152.htm",23,"11-GP76");
navigation[48] = new navElem(48,"Daisy","pi-1963158138.htm",23,"11-GP80");
navigation[49] = new navElem(49,"Turkish Delight","pi349730684.htm",23,"11-GP81");
navigation[50] = new navElem(50,"Stencil Carnation","pi-154325785.htm",23,"11-GP82");
navigation[51] = new navElem(51,"Dancing Leaves","pi1572908619.htm",23,"11-GP83");
navigation[52] = new navElem(52,"Asian Circles","pi2123889790.htm",23,"11-GP89");
navigation[53] = new navElem(53,"Big Blooms","pi-1166648250.htm",23,"11GP-91");
navigation[54] = new navElem(54,"Lake Blossoms","pi1273491159.htm",23,"11GP93");
navigation[55] = new navElem(55,"Cabbage Patch","pi-1639540362.htm",23,"11-GP94");
navigation[56] = new navElem(56,"Russian Rose","pi819993832.htm",23,"11-GP95");
navigation[57] = new navElem(57,"Henna","pi-692323012.htm",23,"11-GP96");
navigation[58] = new navElem(58,"Bubble Flower","pi-419970068.htm",23,"11-GP97");
navigation[59] = new navElem(59,"Wood Ear","pi1635854161.htm",23,"11-GP99");
navigation[60] = new navElem(60,"Brokade Floral","pi1193365556.htm",23,"GP68");
navigation[61] = new navElem(61,"Bekah","pi1199201299.htm",23,"GP69");
navigation[62] = new navElem(62,"Streifendrucke","pi1856492320.htm",2,"115");
navigation[63] = new navElem(63,"Chevron Stripes","pi-539215685.htm",62,"11-GP90-OC");
navigation[64] = new navElem(64,"Mirage Stripe","pi-68965718.htm",62,"GP104");
navigation[65] = new navElem(65,"Organic Stripe","pi1664015521.htm",62,"GP21");
navigation[66] = new navElem(66,"Swiggle Stripe","pi1286958670.htm",62,"GP22");
navigation[67] = new navElem(67,"Jungle Stripe","pi-1219019502.htm",62,"GP65");
navigation[68] = new navElem(68,"Ikat-Gewebe","pi1087737591.htm",2,"117");
navigation[69] = new navElem(69,"Checkerboard","pi1857817452.htm",68,"DIC");
navigation[70] = new navElem(70,"Wash","pi863506298.htm",68,"SIW");
navigation[71] = new navElem(71,"Multicolor","pi1594410154.htm",2,"118");
navigation[72] = new navElem(72,"Beach Balls","pi-306491933.htm",71,"11-GP37");
navigation[73] = new navElem(73,"Targets","pi-1825522713.htm",71,"11-GP67");
navigation[74] = new navElem(74,"Clouds","pi1327156523.htm",71,"11-GP86");
navigation[75] = new navElem(75,"Rowan","pi-168159122.htm",1,"11A");
navigation[76] = new navElem(76,"Chicken Scratch","pi1684610903.htm",75,"RO-MO5");
navigation[77] = new navElem(77,"Jinny Beyer","pi823712809.htm",1,"12");
navigation[78] = new navElem(78,"Amy Butler","pi1178036647.htm",1,"13");
navigation[79] = new navElem(79,"Debbie Mumm","pi1064218385.htm",1,"14");
navigation[80] = new navElem(80,"Gardener&#0039;s Journal","pi1065020679.htm",79,"141");
navigation[81] = new navElem(81,"Classic Collection","pi-128977860.htm",79,"142");
navigation[82] = new navElem(82,"Printconcepts","pi1067370603.htm",1,"15");
navigation[83] = new navElem(83,"Sonstige","pi-1880658373.htm",1,"16");
navigation[84] = new navElem(84,"Moda","pi1202045684.htm",1,"17");
navigation[85] = new navElem(85,"Odyssea","pi276707905.htm",84,"3218");
navigation[86] = new navElem(86,"Martinique","pi1864092480.htm",84,"400");
navigation[87] = new navElem(87,"Anna Maria Horner","pi1268554501.htm",1,"AH");
navigation[88] = new navElem(88,"Heather Baily","pi-661443422.htm",1,"HB");
navigation[89] = new navElem(89,"Tutorials","pi1267118827.htm",null,"10");
navigation[90] = new navElem(90,"Tipps und Tricks","pi-713698434.htm",89,"10-1");
navigation[91] = new navElem(91,"Blöcke genau erklärt","pi-981511031.htm",89,"10-2");
navigation[92] = new navElem(92,"Farblehre","pi-1858888916.htm",89,"10-3");
navigation[93] = new navElem(93,"Stoffe nach Farben","pi-252076925.htm",null,"2");
navigation[94] = new navElem(94,"gelbe Farbtöne","pi1055297123.htm",93,"21");
navigation[95] = new navElem(95,"orange Farbtöne","pi1936758653.htm",93,"211");
navigation[96] = new navElem(96,"rote Farbtöne","pi-1701339311.htm",93,"22");
navigation[97] = new navElem(97,"pink-violette Farbtöne","pi2119562847.htm",93,"23");
navigation[98] = new navElem(98,"blaue Farbtöne","pi1370567240.htm",93,"24");
navigation[99] = new navElem(99,"grüne Farbtöne","pi-128592086.htm",93,"25");
navigation[100] = new navElem(100,"beige-braune Farbtöne","pi-1042784558.htm",93,"26");
navigation[101] = new navElem(101,"weiß-grau-schwarz","pi-1898506030.htm",93,"27");
navigation[102] = new navElem(102,"Pastelltöne","pi261532420.htm",93,"28");
navigation[103] = new navElem(103,"multicolor","pi1516181941.htm",93,"30");
navigation[104] = new navElem(104,"Stoffe nach Themen","pi-259785273.htm",null,"3");
navigation[105] = new navElem(105,"Unis","pi1934965589.htm",104,"29");
navigation[106] = new navElem(106,"Basics","pi-194279114.htm",104,"31");
navigation[107] = new navElem(107,"Florale Motive","pi-1410046468.htm",104,"32");
navigation[108] = new navElem(108,"kleine Motive","pi1689670723.htm",104,"33-1");
navigation[109] = new navElem(109,"große Motive","pi144883720.htm",104,"33-2");
navigation[110] = new navElem(110,"Karos und Streifen","pi817057772.htm",104,"35");
navigation[111] = new navElem(111,"Japanische Indigos","pi-904453031.htm",104,"JP");
navigation[112] = new navElem(112,"Punkte","pi924291807.htm",104,"Punkte");
navigation[113] = new navElem(113,"Materialsets","pi-1755436311.htm",null,"4");
navigation[114] = new navElem(114,"Nähanleitungen","pi361871013.htm",null,"41");
navigation[115] = new navElem(115,"Nähanleitungen für Charmpacks","pi685319133.htm",114,"41-2");
navigation[116] = new navElem(116,"Nähanleitungen für Jelly Rolls","pi-1432101926.htm",114,"41-3");
navigation[117] = new navElem(117,"Nähanleitungen Scrapquilts","pi-1708164552.htm",114,"42");
navigation[118] = new navElem(118,"Bücher und Zeitschriften","pi10073324.htm",null,"5");
navigation[119] = new navElem(119,"Sonderangebote, Scraps, Jelly Rolls, Fat Quarter","pi1068729036.htm",null,"6");
navigation[120] = new navElem(120,"Jelly Rolls","pi-1058792727.htm",119,"6-1");
navigation[121] = new navElem(121,"Charm Packs","pi460452192.htm",119,"6-2");
navigation[122] = new navElem(122,"Zubehör","pi2058856303.htm",null,"7");
navigation[123] = new navElem(123,"Rollschneider, Schneidematten, Lineale","pi-2089408380.htm",122,"71");
navigation[124] = new navElem(124,"Vliese","pi-1281182225.htm",122,"72");

// 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"));

