//
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,"Bachata","pi70890870.htm",null,"10");
navigation[1] = new navElem(1,"Neuheiten&nbsp(14)","pi1065684182.htm",0,"10.1");
navigation[2] = new navElem(2,"Top 10&nbsp(6)","pi996902303.htm",0,"10.2");
navigation[3] = new navElem(3,"Sampler&nbsp(39)","pi-1733077260.htm",0,"10.3");
navigation[4] = new navElem(4,"A bis Z&nbsp(120)","pi-257589019.htm",0,"10.4");
navigation[5] = new navElem(5,"Aktionen&nbsp(31)","pi1068488990.htm",0,"10.5");
navigation[6] = new navElem(6,"Latin House","pi455520404.htm",null,"13");
navigation[7] = new navElem(7,"Sampler","pi-1281287293.htm",6,"13.3");
navigation[8] = new navElem(8,"A bis Z&nbsp(3)","pi1862535212.htm",6,"13.4");
navigation[9] = new navElem(9,"Aktionen&nbsp(2)","pi1376581565.htm",6,"13.6");
navigation[10] = new navElem(10,"Latin Jazz","pi1023720415.htm",null,"14");
navigation[11] = new navElem(11,"A bis Z&nbsp(2)","pi1913583998.htm",10,"14.4");
navigation[12] = new navElem(12,"Latin Pop","pi-839766391.htm",null,"15");
navigation[13] = new navElem(13,"Neuheiten&nbsp(17)","pi1071040609.htm",12,"15.1");
navigation[14] = new navElem(14,"Top 10&nbsp(5)","pi1165014771.htm",12,"15.2");
navigation[15] = new navElem(15,"Sampler&nbsp(8)","pi1046219770.htm",12,"15.3");
navigation[16] = new navElem(16,"A bis Z&nbsp(86)","pi-276769812.htm",12,"15.4");
navigation[17] = new navElem(17,"Aktionen&nbsp(20)","pi1743475975.htm",12,"15.5");
navigation[18] = new navElem(18,"Merengue","pi366846313.htm",null,"17");
navigation[19] = new navElem(19,"Neuheiten&nbsp(15)","pi1235062382.htm",18,"17.1");
navigation[20] = new navElem(20,"Top 10&nbsp(4)","pi80417356.htm",18,"17.2");
navigation[21] = new navElem(21,"Sampler&nbsp(28)","pi1629650781.htm",18,"17.3");
navigation[22] = new navElem(22,"A bis Z&nbsp(133)","pi-675417766.htm",18,"17.4");
navigation[23] = new navElem(23,"Aktionen&nbsp(53)","pi1618615879.htm",18,"17.5");
navigation[24] = new navElem(24,"Mexican","pi-938455849.htm",null,"18");
navigation[25] = new navElem(25,"Neuheiten&nbsp(8)","pi1072611042.htm",24,"18.1");
navigation[26] = new navElem(26,"Sampler&nbsp(3)","pi-1715494303.htm",24,"18.3");
navigation[27] = new navElem(27,"A bis Z&nbsp(15)","pi-1963550277.htm",24,"18.4");
navigation[28] = new navElem(28,"Aktionen&nbsp(3)","pi452530763.htm",24,"18.5");
navigation[29] = new navElem(29,"Reggaeton","pi1042690056.htm",null,"19");
navigation[30] = new navElem(30,"Neuheiten&nbsp(36)","pi-1480963885.htm",29,"19.1");
navigation[31] = new navElem(31,"Top 10&nbsp(3)","pi787242776.htm",29,"19.2");
navigation[32] = new navElem(32,"Sampler&nbsp(89)","pi-352565447.htm",29,"19.3");
navigation[33] = new navElem(33,"A bis Z&nbsp(274)","pi1737865990.htm",29,"19.4");
navigation[34] = new navElem(34,"Aktionen&nbsp(43)","pi460004476.htm",29,"19.5");
navigation[35] = new navElem(35,"Religion&nbsp(5)","pi-415588418.htm",null,"20");
navigation[36] = new navElem(36,"Salsa","pi648866239.htm",null,"21");
navigation[37] = new navElem(37,"Neuheiten&nbsp(16)","pi2133157442.htm",36,"21.1");
navigation[38] = new navElem(38,"Top 10&nbsp(2)","pi-1175304805.htm",36,"21.2");
navigation[39] = new navElem(39,"Sampler&nbsp(23)","pi-102793664.htm",36,"21.3");
navigation[40] = new navElem(40,"A bis Z&nbsp(172)","pi129413441.htm",36,"21.4");
navigation[41] = new navElem(41,"Aktionen&nbsp(28)","pi-1066702387.htm",36,"21.5");
navigation[42] = new navElem(42,"Tipico","pi-1421381971.htm",null,"22");
navigation[43] = new navElem(43,"Neuheiten&nbsp(4)","pi-1085082822.htm",42,"22.1");
navigation[44] = new navElem(44,"Top 10&nbsp(8)","pi1419435315.htm",42,"22.2");
navigation[45] = new navElem(45,"Sampler&nbsp(2)","pi-1883982856.htm",42,"22.3");
navigation[46] = new navElem(46,"A bis Z&nbsp(23)","pi-1032555879.htm",42,"22.4");
navigation[47] = new navElem(47,"Aktionen&nbsp(4)","pi-483797606.htm",42,"22.5");
navigation[48] = new navElem(48,"Tropical&nbsp(19)","pi1990305842.htm",null,"23");
navigation[49] = new navElem(49,"DVDs","pi1119938629.htm",null,"25");
navigation[50] = new navElem(50,"Reggaeton&nbsp(10)","pi-2066296286.htm",49,"25.1");
navigation[51] = new navElem(51,"Salsa&nbsp(3)","pi529628385.htm",49,"25.3");
navigation[52] = new navElem(52,"Gutscheine&nbsp(3)","pi1134391390.htm",null,"26");

// 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"));

