//
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,"Paperweight","pi-1850295638.htm",11,"11-GP20");
navigation[15] = new navElem(15,"Spools","pi1652856150.htm",11,"11-GP34");
navigation[16] = new navElem(16,"Islands","pi-523732492.htm",11,"11-GP49");
navigation[17] = new navElem(17,"Organic Dots","pi-2102579704.htm",11,"11-GP53");
navigation[18] = new navElem(18,"Paper Fans","pi778395998.htm",11,"11-GP57");
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,"Suzani","pi121838975.htm",23,"11-GP105");
navigation[28] = new navElem(28,"Sprays","pi282046373.htm",23,"11-GP107");
navigation[29] = new navElem(29,"Rustic Floral","pi1747882925.htm",23,"11-GP108");
navigation[30] = new navElem(30,"Plink","pi-2043548658.htm",23,"11-GP109");
navigation[31] = new navElem(31,"Cogs","pi1616527913.htm",23,"11-GP110");
navigation[32] = new navElem(32,"Lotus Leaf","pi1933825094.htm",23,"11-GP29");
navigation[33] = new navElem(33,"Kimono","pi-2091885961.htm",23,"11-GP33");
navigation[34] = new navElem(34,"Fan Flower","pi587363463.htm",23,"11-GP36");
navigation[35] = new navElem(35,"Cloisonna ","pi1880676873.htm",23,"11-GP46");
navigation[36] = new navElem(36,"Burnt Wood Rose","pi1309697328.htm",23,"11-GP47");
navigation[37] = new navElem(37,"Flower Basket","pi-347207335.htm",23,"11-GP48");
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,"Cabbage Patch","pi-1639540362.htm",23,"11-GP94");
navigation[55] = new navElem(55,"Russian Rose","pi819993832.htm",23,"11-GP95");
navigation[56] = new navElem(56,"Henna","pi-692323012.htm",23,"11-GP96");
navigation[57] = new navElem(57,"Bubble Flower","pi-419970068.htm",23,"11-GP97");
navigation[58] = new navElem(58,"Wood Ear","pi1635854161.htm",23,"11-GP99");
navigation[59] = new navElem(59,"Brokade Floral","pi1193365556.htm",23,"GP68");
navigation[60] = new navElem(60,"Bekah","pi1199201299.htm",23,"GP69");
navigation[61] = new navElem(61,"Streifendrucke","pi1856492320.htm",2,"115");
navigation[62] = new navElem(62,"Floral Stripe","pi1193467032.htm",61,"11-GP62");
navigation[63] = new navElem(63,"Chevron Stripes","pi-539215685.htm",61,"11-GP90-OC");
navigation[64] = new navElem(64,"Organic Stripe","pi1664015521.htm",61,"GP21");
navigation[65] = new navElem(65,"Swiggle Stripe","pi1286958670.htm",61,"GP22");
navigation[66] = new navElem(66,"Jungle Stripe","pi-1219019502.htm",61,"GP65");
navigation[67] = new navElem(67,"Unis","pi-458798148.htm",2,"116");
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,"Feather","pi1287461392.htm",68,"SIF");
navigation[71] = new navElem(71,"Wash","pi863506298.htm",68,"SIW");
navigation[72] = new navElem(72,"Multicolor","pi1594410154.htm",2,"118");
navigation[73] = new navElem(73,"Beach Balls","pi-306491933.htm",72,"11-GP37");
navigation[74] = new navElem(74,"Targets","pi-1825522713.htm",72,"11-GP67");
navigation[75] = new navElem(75,"Clouds","pi1327156523.htm",72,"11-GP86");
navigation[76] = new navElem(76,"Rowan","pi-168159122.htm",1,"11A");
navigation[77] = new navElem(77,"Chicken Scratch","pi1684610903.htm",76,"RO-MO5");
navigation[78] = new navElem(78,"Jinny Beyer","pi823712809.htm",1,"12");
navigation[79] = new navElem(79,"Amy Butler","pi1178036647.htm",1,"13");
navigation[80] = new navElem(80,"Debbie Mumm","pi1064218385.htm",1,"14");
navigation[81] = new navElem(81,"Gardener&#0039;s Journal","pi1065020679.htm",80,"141");
navigation[82] = new navElem(82,"Classic Collection","pi-128977860.htm",80,"142");
navigation[83] = new navElem(83,"Printconcepts","pi1067370603.htm",1,"15");
navigation[84] = new navElem(84,"Sonstige","pi-1880658373.htm",1,"16");
navigation[85] = new navElem(85,"Moda","pi1202045684.htm",1,"17");
navigation[86] = new navElem(86,"Heather Baily","pi-661443422.htm",1,"HB");
navigation[87] = new navElem(87,"Tutorials","pi1267118827.htm",null,"10");
navigation[88] = new navElem(88,"Tipps und Tricks","pi-713698434.htm",87,"10-1");
navigation[89] = new navElem(89,"Stoffe nach Farben","pi-252076925.htm",null,"2");
navigation[90] = new navElem(90,"gelbe Farbtöne","pi1055297123.htm",89,"21");
navigation[91] = new navElem(91,"orange Farbtöne","pi1936758653.htm",89,"211");
navigation[92] = new navElem(92,"rote Farbtöne","pi-1701339311.htm",89,"22");
navigation[93] = new navElem(93,"pink-violette Farbtöne","pi2119562847.htm",89,"23");
navigation[94] = new navElem(94,"blaue Farbtöne","pi1370567240.htm",89,"24");
navigation[95] = new navElem(95,"grüne Farbtöne","pi-128592086.htm",89,"25");
navigation[96] = new navElem(96,"beige-braune Farbtöne","pi-1042784558.htm",89,"26");
navigation[97] = new navElem(97,"weiß-grau-schwarz","pi-1898506030.htm",89,"27");
navigation[98] = new navElem(98,"Pastelltöne","pi261532420.htm",89,"28");
navigation[99] = new navElem(99,"multicolor","pi1516181941.htm",89,"30");
navigation[100] = new navElem(100,"Stoffe nach Themen","pi-259785273.htm",null,"3");
navigation[101] = new navElem(101,"Unis","pi1934965589.htm",100,"29");
navigation[102] = new navElem(102,"Basics","pi-194279114.htm",100,"31");
navigation[103] = new navElem(103,"Florale Motive","pi-1410046468.htm",100,"32");
navigation[104] = new navElem(104,"kleine Motive","pi1689670723.htm",100,"33-1");
navigation[105] = new navElem(105,"große Motive","pi144883720.htm",100,"33-2");
navigation[106] = new navElem(106,"Karos und Streifen","pi817057772.htm",100,"35");
navigation[107] = new navElem(107,"Japanische Indigos","pi-904453031.htm",100,"JP");
navigation[108] = new navElem(108,"Punkte","pi924291807.htm",100,"Punkte");
navigation[109] = new navElem(109,"Materialsets","pi-1755436311.htm",null,"4");
navigation[110] = new navElem(110,"Nähanleitungen","pi361871013.htm",null,"41");
navigation[111] = new navElem(111,"Nähanleitungen für Charmpacks","pi685319133.htm",110,"41-2");
navigation[112] = new navElem(112,"Nähanleitungen für Jelly Rolls","pi-1432101926.htm",110,"41-3");
navigation[113] = new navElem(113,"Nähanleitungen Scrapquilts","pi-1708164552.htm",110,"42");
navigation[114] = new navElem(114,"Bücher und Zeitschriften","pi10073324.htm",null,"5");
navigation[115] = new navElem(115,"Sonderangebote, Scraps, Jelly Rolls, Fat Quarter","pi1068729036.htm",null,"6");
navigation[116] = new navElem(116,"Jelly Rolls","pi-1058792727.htm",115,"6-1");
navigation[117] = new navElem(117,"Charm Packs","pi460452192.htm",115,"6-2");
navigation[118] = new navElem(118,"Zubehör","pi2058856303.htm",null,"7");
navigation[119] = new navElem(119,"Rollschneider, Schneidematten, Lineale","pi-2089408380.htm",118,"71");

// 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"));

