//
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="11" height="14" 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\"></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="10" 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="13" 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/pfeil-gut.gif" width="10" height="8" alt="BulletCat1stCls.gif" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/pfeil-gut.gif" width="10" height="8" 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-1824724380.htm",null,"00001");
navigation[1] = new navElem(1,"Living + Furnishing","pi1486399407.htm",null,"001");
navigation[2] = new navElem(2,"Shoji Screens","pi1022073750.htm",1,"001-2-1");
navigation[3] = new navElem(3,"Examples of Use","pi169919025.htm",2,"0001...");
navigation[4] = new navElem(4,"Cupboards","pi1112807045.htm",2,"001-1");
navigation[5] = new navElem(5,"Product Details","pi1204974238.htm",2,"001-2-001");
navigation[6] = new navElem(6,"Price List","pi-916185956.htm",2,"001-2-1-2");
navigation[7] = new navElem(7,"Sample &#0034;YUKI&#0034;","pi32683875.htm",2,"001-2-1-4");
navigation[8] = new navElem(8,"Sample 1","pi-1842532760.htm",2,"001-2-1-5");
navigation[9] = new navElem(9,"Sample 2","pi1120039985.htm",2,"001-2-6");
navigation[10] = new navElem(10,"Sample 3","pi-998762041.htm",2,"001-2-7");
navigation[11] = new navElem(11,"Sample 4","pi1121070971.htm",2,"1-1-8");
navigation[12] = new navElem(12,"Shoji Paper","pi1096802945.htm",2,"1-1-9");
navigation[13] = new navElem(13,"Wall Coverings from natural materials","pi-716481139.htm",1,"001-2-3");
navigation[14] = new navElem(14,"Tatami","pi-1226476404.htm",1,"001-3");
navigation[15] = new navElem(15,"Light","pi-1274329955.htm",1,"001-4");
navigation[16] = new navElem(16,"Lamps Japanese Style","pi1035035491.htm",15,"001-4-1");
navigation[17] = new navElem(17,"Original japanese Lamps","pi343357349.htm",15,"001-4-111");
navigation[18] = new navElem(18,"Table Lamps","pi-168779764.htm",15,"001-4-2");
navigation[19] = new navElem(19,"Ceiling Fixtures","pi486830080.htm",15,"001-4-5");
navigation[20] = new navElem(20,"Floor Lamps","pi-510412535.htm",15,"001-4-6");
navigation[21] = new navElem(21,"Wall Fixtures","pi1075386641.htm",15,"001-4-7");
navigation[22] = new navElem(22,"Pendant Lamps","pi1948580375.htm",15,"004-1-4");
navigation[23] = new navElem(23,"Inside","pi-867998376.htm",1,"005");
navigation[24] = new navElem(24,"Furniture","pi1089962203.htm",23,"005-1");
navigation[25] = new navElem(25,"Japanese Door Curtains","pi-371619710.htm",23,"005-2");
navigation[26] = new navElem(26,"Accessoires","pi-253649260.htm",23,"005-3");
navigation[27] = new navElem(27,"Blinds","pi1631152744.htm",23,"005-4");
navigation[28] = new navElem(28,"Paravent","pi-367057274.htm",23,"005-5");
navigation[29] = new navElem(29,"Sitting","pi1345687344.htm",23,"005-6");
navigation[30] = new navElem(30,"Tables","pi1027593870.htm",23,"005-7");
navigation[31] = new navElem(31,"Textiles","pi1129718267.htm",1,"005-1-1");
navigation[32] = new navElem(32,"Collections","pi1225973898.htm",1,"006-22");
navigation[33] = new navElem(33,"UZUME","pi-1098025917.htm",32,"koll1");
navigation[34] = new navElem(34,"TORI","pi-1760452152.htm",32,"koll2");
navigation[35] = new navElem(35,"COSMIC","pi-277667799.htm",32,"koll3");
navigation[36] = new navElem(36,"SUSANOH","pi-2090762954.htm",32,"koll4");
navigation[37] = new navElem(37,"FIGO","pi1847690879.htm",32,"koll5");
navigation[38] = new navElem(38,"MIKADO","pi-545604012.htm",32,"koll6");
navigation[39] = new navElem(39,"Sleep + Dream","pi-1121020458.htm",null,"006");
navigation[40] = new navElem(40,"Beds","pi-1645044251.htm",39,"006-1");
navigation[41] = new navElem(41,"Beds-instant delivery","pi-19601428.htm",39,"006-1-1");
navigation[42] = new navElem(42,"Futons","pi1618741236.htm",39,"006-2");
navigation[43] = new navElem(43,"Cotton","pi1062576051.htm",42,"006-2-1");
navigation[44] = new navElem(44,"Cotton Coconut Fibre","pi-1119361928.htm",42,"006-2-2");
navigation[45] = new navElem(45,"Wool Coconut Fibre","pi-1561921255.htm",42,"006-2-3");
navigation[46] = new navElem(46,"Sandwich","pi-1348059290.htm",42,"006-2-4");
navigation[47] = new navElem(47,"Comfort","pi-1733375761.htm",42,"006-2-5");
navigation[48] = new navElem(48,"Hemp","pi-994100676.htm",42,"006-2-6");
navigation[49] = new navElem(49,"Kobe- Futon Lounge Chair","pi1238149701.htm",42,"006-2-8");
navigation[50] = new navElem(50,"Futon Covers","pi1925893245.htm",39,"006-21");
navigation[51] = new navElem(51,"Wall Futons","pi1203178693.htm",39,"006-2-6-1");
navigation[52] = new navElem(52,"Futons-instant delivery","pi1109706772.htm",39,"006-2-7");
navigation[53] = new navElem(53,"Daybeds","pi1035294840.htm",39,"006-3");
navigation[54] = new navElem(54,"Duckboards","pi1010896278.htm",39,"006-4");
navigation[55] = new navElem(55,"Wear","pi1068560713.htm",null,"007");
navigation[56] = new navElem(56,"Kimonos","pi37110412.htm",55,"007-1");
navigation[57] = new navElem(57,"Yukata","pi-909281671.htm",55,"007-2");
navigation[58] = new navElem(58,"Japanese Sandals","pi-72453258.htm",55,"007-4");
navigation[59] = new navElem(59,"T-Shirt","pi-961575090.htm",55,"007-5");
navigation[60] = new navElem(60,"Sensual Pleasure","pi317055097.htm",null,"008");
navigation[61] = new navElem(61,"Japanese Teas","pi1532308294.htm",60,"008-1");
navigation[62] = new navElem(62,"Japanese Table Wear","pi-1898161436.htm",60,"008-2");
navigation[63] = new navElem(63,"Sounds of Asia","pi1097137021.htm",60,"008-3");
navigation[64] = new navElem(64,"Japanese Calligraphie","pi1108203422.htm",60,"008-4");
navigation[65] = new navElem(65,"Services","pi-434978348.htm",null,"009");
navigation[66] = new navElem(66,"Store","pi1132838974.htm",null,"009-1");
navigation[67] = new navElem(67,"Reference Objects","pi1158068801.htm",null,"009-2");

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

