//
function NavLinkedDropDownList(){
	return(TNavDropDownList(true));
	};
//
function NavDropDownList(){
	return(TNavDropDownList(false));
	};
//
function storeSearchParameters(optionValueArray){
var xmlSearchEngine = xmlConfig.getFirstItem("SearchEngine");
	if(optionValueArray[0]!="null"){
		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=\"null;;start.htm;;null\">Produktcatalogus</option>";
	for(var i=0; i<navigation.length; i++){
		if(navigation[i].parentID==null){
			rString += TNavDropDownItem(navigation[i], "");
			for(var j=0; j<navigation.length; j++){
				if(navigation[j].parentID==navigation[i].id) rString += TNavDropDownItem(navigation[j], "...");
				};
			};
		};
	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>";
	return(rString);	
	};
//

// TNavLinkList Vertical
function TNavLinkList(){
	var myNavIndex = xmlConfig.navIndex
	if(!(myNavIndex=="null"||myNavIndex=="")){
		navigation[parseInt(myNavIndex)].active = true;
		if(navigation[parseInt(myNavIndex)].parentID!=null) navigation[navigation[parseInt(myNavIndex)].parentID].open = true;
		};
	var rString = '<TABLE class="CATLINKS1STPARENT" width="100%" border="0" cellpadding="1" cellspacing="1" >';
	for(var i=0;i<navigation.length;i++) if(navigation[i].parentID==null){
		rString += navigation[i].print();
		if(navigation[i].active==true||navigation[i].open==true){
			rString += "</TABLE>"
			rString += '<TABLE class="CATLINKS2NDPARENT" width="100%" border="0" cellpadding="1" cellspacing="1" ><TR valign="top">';
			for(var j=0;j<navigation.length;j++) if(navigation[j].parentID==navigation[i].id){
				rString += navigation[j].print();
				};
			rString += "</TABLE>"
			rString += '<TABLE class="CATLINKS1STPARENT" width="100%" border="0" cellpadding="1" cellspacing="1" >';
			};
		};
		rString += "</TABLE>"
	return(rString);
	};
// TNavLinkItem
function TNavLinkItem(){
	var rString = '<TR valign="top">';
	with(this){
		if(active){
			if(parentID!=null) rString += '<TD class="ACTIVECATEGORY"><IMG SRC="assets/images/spacer.gif" width="13" height="1"></TD>'
			rString += '<TD class="ACTIVECATEGORY"><img src="assets/images/bulletcatact.gif" width="13" height="13" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></TD>'
			}
		else{
			if(parentID!=null){
				rString += '<TD class="CATLINKS2NDBULLET"><IMG SRC="assets/images/spacer.gif" width="13" height="1"></TD>';
				rString += '<TD class="CATLINKS2NDBULLET"><img src="assets/images/bulletcat2nd.gif" width="12" height="12" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></TD>';
				}
			else{
				rString += '<TD class="CATLINKS1STBULLET">';
				if(!open) rString += '<img src="assets/images/bulletcat1st.gif" width="12" height="12" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></TD>'
				else rString += '<img src="assets/images/bulletcat1stcls.gif" width="13" height="13" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></TD>';
				};
			};
		if(active) rString += '<TD class="ACTIVECATEGORY" width="100%">'
		else{
			if(parentID!=null) rString += '<TD class="CATLINKS2NDCAPTION" width="100%">'
			else rString += '<TD colspan="2" class="CATLINKS1STCAPTION" width="100%">'
			};
		rString += "<a href=\"javascript: changeLoc(" + this.id + ",'" + this.linkUrl + "')\" class=\"WAGRUNAV\">";
		rString += caption;
		rString += "</a>";
		rString += "</TD>"
		rString += "</TR>";
		};
	return rString; 
	};

//

// navElem
function navElem(id,caption,linkUrl,parentID, categoryID){
	this.id = id;
	this.caption = caption;
	this.linkUrl = linkUrl;
	this.parentID = parentID;
	this.print = TNavLinkItem;
	this.active = false;
	this.open = false;
	this.categoryID = categoryID;
	};
// navigation
var navigation = new Array();
//
navigation[0] = new navElem(0,"Satelliet","pi-531159839.html",null,"100");
navigation[1] = new navElem(1,"Schotels","pi-1537085890.html",0,"102");
navigation[2] = new navElem(2,"LNB","pi-1161653017.html",0,"103");
navigation[3] = new navElem(3,"Modules","pi-412883008.html",0,"105");
navigation[4] = new navElem(4,"XXX Erotiek","pi1192796228.html",0,"50");
navigation[5] = new navElem(5,"Beveiliging & observatie","pi1173533138.html",null,"130");
navigation[6] = new navElem(6,"Camera&#0039;s","pi837545451.html",5,"131");
navigation[7] = new navElem(7,"Monitoren","pi-503712688.html",5,"132");
navigation[8] = new navElem(8,"Recording","pi-831532527.html",5,"133");
navigation[9] = new navElem(9,"Diversen","pi1174653428.html",5,"134");
navigation[10] = new navElem(10,"Systemen","pi1190792172.html",5,"136");
navigation[11] = new navElem(11,"Afstandsbedieningen","pi1747440166.html",null,"140");
navigation[12] = new navElem(12,"Kabel & Stekkers","pi1071946321.html",null,"150");
navigation[13] = new navElem(13,"Scart Kabels","pi-1357099462.html",12,"151");
navigation[14] = new navElem(14,"High-End","pi1072647544.html",12,"152");
navigation[15] = new navElem(15,"High-End (Gold & Silverline)","pi1071614424.html",12,"153");
navigation[16] = new navElem(16,"A/V Kabels","pi1073336173.html",12,"154");
navigation[17] = new navElem(17,"Satelliet & TV","pi-1505151501.html",12,"155");
navigation[18] = new navElem(18,"Computer","pi520653326.html",12,"156");
navigation[19] = new navElem(19,"Stekkers/Adapters","pi583130163.html",12,"157");
navigation[20] = new navElem(20,"Diversen","pi370596991.html",12,"158");
navigation[21] = new navElem(21,"Digitale ontvangers","pi557245738.html",null,"4");
navigation[22] = new navElem(22,"DVB-T","pi1515706988.html",21,"110");
navigation[23] = new navElem(23,"DVB-C","pi-1851704073.html",21,"115");
navigation[24] = new navElem(24,"SAB","pi1938041064.html",21,"145");
navigation[25] = new navElem(25,"Philips","pi1192799203.html",21,"15");
navigation[26] = new navElem(26,"MaxDigital","pi-2062960795.html",21,"445");
navigation[27] = new navElem(27,"Inverto","pi1341118806.html",21,"454");
navigation[28] = new navElem(28,"Dreambox","pi-1309902817.html",21,"455");
navigation[29] = new navElem(29,"Clarke-Tech","pi2026383040.html",21,"477");
navigation[30] = new navElem(30,"Topfield","pi-1124359991.html",21,"4856");
navigation[31] = new navElem(31,"Gaming","pi-1227708538.html",null,"413");
navigation[32] = new navElem(32,"Nintendo","pi1016712536.html",31,"9555");
navigation[33] = new navElem(33,"PC","pi1938172025.html",31,"9556");
navigation[34] = new navElem(34,"Playstation","pi1479660358.html",31,"9557");
navigation[35] = new navElem(35,"Universeel","pi940771151.html",31,"9558");
navigation[36] = new navElem(36,"Xbox","pi1088002581.html",31,"9559");
navigation[37] = new navElem(37,"GSM & Scanners","pi-1796256039.html",null,"414");
navigation[38] = new navElem(38,"Pagers","pi1040063623.html",37,"951");
navigation[39] = new navElem(39,"Toebehoren","pi-679780325.html",null,"415");
navigation[40] = new navElem(40,"Antennes en draadloos","pi309933497.html",39,"412");
navigation[41] = new navElem(41,"Montage","pi-1414294054.html",39,"451");
navigation[42] = new navElem(42,"Motoren en Positioners","pi-221746450.html",39,"478");
navigation[43] = new navElem(43,"Smartcards","pi-609876515.html",39,"485");
navigation[44] = new navElem(44,"Disecq Switches","pi1389141975.html",39,"488");
navigation[45] = new navElem(45,"Gereedschap en meetapparatuur","pi1001599827.html",39,"489");
navigation[46] = new navElem(46,"Schotel toebehoren","pi1750287052.html",39,"874");
navigation[47] = new navElem(47,"De Pompers","pi1632507055.html",null,"998");

// 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){
	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;
	};
