//
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 += "Amount of Products:<strong>&nbsp;" + prdCount + "</strong><br>";
	prdString += "Subtotal:<strong>&nbsp;" + TFormatCurrency(subTotal, objPriCurrency) + "</strong><br><br>";
	prdString += "<a class=\"WAGRUNAV\" href=\"orderform." + xmlConfig.fileExtension + "\">";
	prdString += "<strong>" + '<img src="assets/images/bullet.gif" width="15" height="11" alt="Bullet.gif" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">' + "Go to the Orderform</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\">Central Catalog</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="14" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcatact.gif" width="14" height="11" 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="14" height="11" 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="14" height="11" 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,"SPECIAL OFFERS","pi-1114072910.htm",null,"0");
navigation[1] = new navElem(1,"10% OFF&nbsp(4)","pi-255081326.htm",0,"01");
navigation[2] = new navElem(2,"15% OFF&nbsp(4)","pi820820395.htm",0,"02");
navigation[3] = new navElem(3,"KITCHEN","pi1766004441.htm",null,"1");
navigation[4] = new navElem(4,"Coffee things","pi1084482334.htm",3,"105");
navigation[5] = new navElem(5,"Espresso Sets&nbsp(4)","pi1281089607.htm",4,"204-001");
navigation[6] = new navElem(6,"Coffee Mugs&nbsp(19)","pi-429508996.htm",4,"204-002");
navigation[7] = new navElem(7,"Macchiato Glasses&nbsp(6)","pi-2014643251.htm",4,"204-003");
navigation[8] = new navElem(8,"Milk Mugs&nbsp(2)","pi1833622211.htm",4,"204-005");
navigation[9] = new navElem(9,"Table Tiles (coasters)&nbsp(19)","pi-1261932278.htm",4,"204-007");
navigation[10] = new navElem(10,"PICASSO Porcelain","pi562262616.htm",null,"11");
navigation[11] = new navElem(11,"Espresso sets&nbsp(3)","pi-623498887.htm",10,"209-001");
navigation[12] = new navElem(12,"Coffee services&nbsp(3)","pi-1574436794.htm",10,"209-002");
navigation[13] = new navElem(13,"Gift series&nbsp(7)","pi-1530466225.htm",10,"209-003");
navigation[14] = new navElem(14,"SNOOPY Porcelain","pi1099243405.htm",null,"12");
navigation[15] = new navElem(15,"Lots of Dots&nbsp(9)","pi1099247235.htm",14,"401-001");
navigation[16] = new navElem(16,"Classic&nbsp(9)","pi2113068808.htm",14,"401-002");
navigation[17] = new navElem(17,"Homerun&nbsp(9)","pi-233675671.htm",14,"401-003");
navigation[18] = new navElem(18,"Silver Star&nbsp(9)","pi-525206410.htm",14,"401-004");
navigation[19] = new navElem(19,"Pink Love&nbsp(9)","pi-1214552897.htm",14,"401-005");
navigation[20] = new navElem(20,"Flower Strip&nbsp(9)","pi-1751887980.htm",14,"401-006");
navigation[21] = new navElem(21,"Roccoco&nbsp(3)","pi-443484923.htm",14,"401-007");
navigation[22] = new navElem(22,"Salt & Pepper Sets&nbsp(4)","pi2050595875.htm",14,"401-008");
navigation[23] = new navElem(23,"Jugs&nbsp(4)","pi1113504831.htm",14,"401-009");
navigation[24] = new navElem(24,"MICKEY Porcelain","pi16726474.htm",null,"13");
navigation[25] = new navElem(25,"Walk of Fame&nbsp(9)","pi1790400187.htm",24,"501-001");
navigation[26] = new navElem(26,"Pretty Pink&nbsp(9)","pi-1041874720.htm",24,"501-002");
navigation[27] = new navElem(27,"Cocolat&nbsp(9)","pi-876435615.htm",24,"501-003");
navigation[28] = new navElem(28,"Good Morning&nbsp(9)","pi1725469198.htm",24,"501-004");
navigation[29] = new navElem(29,"Glamour&nbsp(9)","pi1690976375.htm",24,"501-005");
navigation[30] = new navElem(30,"Pop Star&nbsp(9)","pi2016952044.htm",24,"501-006");
navigation[31] = new navElem(31,"Purple Life&nbsp(3)","pi-915728515.htm",24,"501-007");
navigation[32] = new navElem(32,"Salt & Pepper Sets&nbsp(4)","pi-6099751.htm",24,"501-008");
navigation[33] = new navElem(33,"Jugs&nbsp(4)","pi162437158.htm",24,"501-009");
navigation[34] = new navElem(34,"LIVING ROOM","pi1060715639.htm",null,"2");
navigation[35] = new navElem(35,"Architectural Posters","pi-1809675540.htm",34,"201");
navigation[36] = new navElem(36,"Italy&nbsp(30)","pi-2030958713.htm",35,"201-001");
navigation[37] = new navElem(37,"Germany&nbsp(7)","pi-1441882948.htm",35,"201-002");
navigation[38] = new navElem(38,"Belgium&nbsp(2)","pi-2006813427.htm",35,"201-003");
navigation[39] = new navElem(39,"Various&nbsp(7)","pi-1423673367.htm",35,"201-050");
navigation[40] = new navElem(40,"Replica in glass","pi1065189599.htm",34,"203");
navigation[41] = new navElem(41,"Roman-Germanic-Museum, Cologne/Germany&nbsp(11)","pi-2069309768.htm",40,"203-001");
navigation[42] = new navElem(42,"Other German museums&nbsp(2)","pi412552793.htm",40,"203-002");
navigation[43] = new navElem(43,"British Museum, London&nbsp(4)","pi-1565426778.htm",40,"203-003");
navigation[44] = new navElem(44,"Louvre, Paris / Other French museums&nbsp(4)","pi969531439.htm",40,"203-004");
navigation[45] = new navElem(45,"Candlesticks&nbsp(11)","pi-178174835.htm",34,"204");
navigation[46] = new navElem(46,"Glassware from Malta","pi1072045368.htm",34,"205");
navigation[47] = new navElem(47,"Sunrise&nbsp(4)","pi-609276185.htm",46,"205-001");
navigation[48] = new navElem(48,"Steel&nbsp(6)","pi2024720540.htm",46,"205-003");
navigation[49] = new navElem(49,"Golden Autumn&nbsp(7)","pi1072211887.htm",46,"205-004");
navigation[50] = new navElem(50,"Twilight&nbsp(5)","pi55358404.htm",46,"205-006");
navigation[51] = new navElem(51,"Desert Wind&nbsp(4)","pi-1694649995.htm",46,"205-007");
navigation[52] = new navElem(52,"Peacock&nbsp(2)","pi4673426.htm",46,"205-008");
navigation[53] = new navElem(53,"Drinking glasses","pi-270455252.htm",34,"207");
navigation[54] = new navElem(54,"&#0034;Anastasia&#0034;&nbsp(8)","pi-1424691142.htm",53,"207-001");
navigation[55] = new navElem(55,"Martini glasses&nbsp(3)","pi1165060070.htm",53,"207-002");
navigation[56] = new navElem(56,"Schnaps glasses &#0034;Halali&#0034;&nbsp(2)","pi331868015.htm",53,"207-003");
navigation[57] = new navElem(57,"Home Accessories","pi688956861.htm",34,"208");
navigation[58] = new navElem(58,"Handmade Glass&nbsp(8)","pi1121894156.htm",57,"208-001");
navigation[59] = new navElem(59,"Figures, statues&nbsp(8)","pi1356098586.htm",57,"208-002");
navigation[60] = new navElem(60,"Other decoration&nbsp(11)","pi318135443.htm",57,"208-009");
navigation[61] = new navElem(61,"Vases/Flowerpots&nbsp(13)","pi-1477461302.htm",34,"210");
navigation[62] = new navElem(62,"Wind chimes & spirals&nbsp(7)","pi1741446429.htm",34,"211");
navigation[63] = new navElem(63,"HEARTS&nbsp(22)","pi2750306.htm",null,"20");
navigation[64] = new navElem(64,"Bavarian beer mugs","pi1096398007.htm",null,"206");
navigation[65] = new navElem(65,"&#0034;Snake&#0034;&nbsp(3)","pi1325553203.htm",64,"206-001");
navigation[66] = new navElem(66,"&#0034;Artemis&#0034;&nbsp(4)","pi-895813384.htm",64,"206-002");
navigation[67] = new navElem(67,"&#0034;Halali&#0034;&nbsp(6)","pi1055691673.htm",64,"206-003");
navigation[68] = new navElem(68,"RAVENSBURGER puzzles","pi1080420728.htm",null,"3");
navigation[69] = new navElem(69,"Puzzles","pi-408167911.htm",68,"301");
navigation[70] = new navElem(70,"Puzzleball, 240 pcs.&nbsp(5)","pi1081281696.htm",69,"301-024");
navigation[71] = new navElem(71,"Puzzleball, 540 pcs.&nbsp(5)","pi-1181681631.htm",69,"301-030");
navigation[72] = new navElem(72,"500 pcs.&nbsp(5)","pi11092942.htm",69,"301-050");
navigation[73] = new navElem(73,"1,000 pcs.&nbsp(12)","pi-1641283785.htm",69,"301-100");
navigation[74] = new navElem(74,"1,500 pcs.&nbsp(2)","pi1338459820.htm",69,"301-150");
navigation[75] = new navElem(75,"2,000 pcs.&nbsp(2)","pi1585837117.htm",69,"301-200");
navigation[76] = new navElem(76,"5,000 pcs.&nbsp(2)","pi-1791312710.htm",69,"301-500");
navigation[77] = new navElem(77,"GIFT IDEAS for &#0034;HER&#0034;","pi706906171.htm",null,"90");
navigation[78] = new navElem(78,"up to 50 USD&nbsp(17)","pi1124476984.htm",77,"901");
navigation[79] = new navElem(79,"up to 100 USD&nbsp(7)","pi1178034649.htm",77,"902");
navigation[80] = new navElem(80,">100 USD&nbsp(2)","pi125577589.htm",77,"903");
navigation[81] = new navElem(81,"GIFT IDEAS for &#0034;HIM&#0034;","pi-13159199.htm",null,"91");
navigation[82] = new navElem(82,"up to 50 USD&nbsp(9)","pi-1303222382.htm",81,"906");
navigation[83] = new navElem(83,"up to 100 USD&nbsp(3)","pi-334929749.htm",81,"907");
navigation[84] = new navElem(84,">100 USD&nbsp(6)","pi-29384688.htm",81,"908");

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

