//
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/bullet.gif" width="13" height="10" 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="0" 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="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="10" 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="10" 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="10" 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 = true;
		this.categoryId = categoryId;
		};
// navigation
var navigation = new Array();
//
navigation[0] = new navElem(0,"PC-Corner","pi82703847.htm",null,"26");
navigation[1] = new navElem(1,"Steckverbinder&nbsp(3)","pi-590905157.htm",0,"33");
navigation[2] = new navElem(2,"Lüfter","pi-730225952.htm",0,"34");
navigation[3] = new navElem(3,"Medien","pi-181515852.htm",0,"48");
navigation[4] = new navElem(4,"Kostenloses&nbsp(1)","pi1078493606.htm",null,"49");
navigation[5] = new navElem(5,"Car & Hifi","pi739288789.htm",null,"55");
navigation[6] = new navElem(6,"Tuning&nbsp(4)","pi-1490633149.htm",5,"59");
navigation[7] = new navElem(7,"Car-Hifi&nbsp(5)","pi17871218.htm",5,"56");
navigation[8] = new navElem(8,"Car-Video&nbsp(3)","pi-1570793935.htm",5,"57");
navigation[9] = new navElem(9,"Kabel und Leitungen&nbsp(8)","pi-610312800.htm",5,"60");
navigation[10] = new navElem(10,"Spannungswandler&nbsp(4)","pi1828905740.htm",5,"61");
navigation[11] = new navElem(11,"Electronic & Components","pi1091779236.htm",null,"54");
navigation[12] = new navElem(12,"Reste und Einzelstücke&nbsp(1)","pi-895957670.htm",11,"38");
navigation[13] = new navElem(13,"Zubehör und Werkzeug","pi-1339004646.htm",11,"28");
navigation[14] = new navElem(14,"Meßtechnik&nbsp(1)","pi2048414036.htm",13,"39");
navigation[15] = new navElem(15,"Leiterplatten/Platinen&nbsp(2)","pi48516280.htm",13,"31");
navigation[16] = new navElem(16,"Vorwiderstände&nbsp(3)","pi1555713242.htm",13,"20");
navigation[17] = new navElem(17,"Schaltlitze&nbsp(5)","pi1036522177.htm",13,"19");
navigation[18] = new navElem(18,"Werkzeuge&nbsp(1)","pi1296087884.htm",13,"16");
navigation[19] = new navElem(19,"Montagematerial&nbsp(10)","pi-1150298733.htm",13,"29");
navigation[20] = new navElem(20,"Netzteile u. Batterien&nbsp(7)","pi-360139295.htm",13,"30");
navigation[21] = new navElem(21,"Schalter&nbsp(6)","pi2015702458.htm",13,"37");
navigation[22] = new navElem(22,"Löten und Kleben&nbsp(4)","pi33407867.htm",13,"40");
navigation[23] = new navElem(23,"Steckdosenleisten","pi-2083425932.htm",13,"51");
navigation[24] = new navElem(24,"CCFL und Neon-Wire","pi-595807539.htm",11,"25");
navigation[25] = new navElem(25,"Neon-Wire","pi-1882743225.htm",24,"41");
navigation[26] = new navElem(26,"100mm CCFL&nbsp(2)","pi218799228.htm",24,"42");
navigation[27] = new navElem(27,"300mm CCFL&nbsp(2)","pi-2039158323.htm",24,"43");
navigation[28] = new navElem(28,"Spezielle LEDs&nbsp(2)","pi-1092639109.htm",11,"36");
navigation[29] = new navElem(29,"LED-Produkte u. Leuchten&nbsp(6)","pi1694187592.htm",11,"3");
navigation[30] = new navElem(30,"LEDs","pi-720284987.htm",11,"17");
navigation[31] = new navElem(31,"3mm&nbsp(4)","pi-1525706599.htm",30,"53");
navigation[32] = new navElem(32,"Luxeon&#0039;s LUMILEDs&nbsp(6)","pi1037556605.htm",30,"22");
navigation[33] = new navElem(33,"SMD-LEDs&nbsp(15)","pi1039348900.htm",30,"23");
navigation[34] = new navElem(34,"Super Flux LEDs&nbsp(6)","pi-155671844.htm",30,"32");
navigation[35] = new navElem(35,"5mm","pi1327303160.htm",30,"52");
navigation[36] = new navElem(36,"Ultraviolette LEDs&nbsp(1)","pi505842317.htm",35,"11");
navigation[37] = new navElem(37,"Gelbe LEDs&nbsp(1)","pi589529351.htm",35,"9");
navigation[38] = new navElem(38,"Grüne LEDs&nbsp(1)","pi-1551395536.htm",35,"6");
navigation[39] = new navElem(39,"Rote LEDs&nbsp(1)","pi1029865035.htm",35,"5");
navigation[40] = new navElem(40,"Blaue LEDs&nbsp(5)","pi-354526863.htm",35,"7");
navigation[41] = new navElem(41,"Weiße LEDs&nbsp(2)","pi-189710626.htm",35,"8");

// 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"));


