var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Navigatie", "/navigatie/index.html", 1, "", 1, "");
addItem("10021", "GPS_20handheld", "/navigatie/gps/index.html", 2, "", 1, "");
addItem("100151", "Navigatie_20Systeem", "/navigatie/navigatie-systeem/index.html", 2, "", 1, "");
addItem("100157", "Snelheidscontrole", "/navigatie/snelheidscontrole/index.html", 2, "", 1, "");
addItem("100158", "Tracking_20systeem", "/navigatie/tracking-systeem/index.html", 2, "", 1, "");
addItem("1002", "Televisie", "/televisie/index.html", 1, "", 1, "");
addItem("10018", "Satelliet_20TV", "/televisie/televisie/index.html", 2, "", 1, "");
addItem("100149", "LCD_204:3", "/televisie/lcd-43/index.html", 2, "", 1, "");
addItem("100150", "LCD_2016:9", "/televisie/lcd-169/index.html", 2, "", 1, "");
addItem("1003", "Stroom", "/stroom/index.html", 1, "", 1, "");
addItem("10012", "Acculader", "/stroom/acculader/index.html", 2, "", 1, "");
addItem("10011", "Omvormer", "/stroom/omvormer/index.html", 2, "", 1, "");
addItem("10045", "Omvormer_20lader", "/stroom/omvormer-lader/index.html", 2, "", 1, "");
addItem("100104", "Stroom_20toebehoren", "/stroom/stroom-toebehoren/index.html", 2, "", 1, "");
addItem("100105", "DC_X2DC_20converters", "/stroom/dc-dc-converters/index.html", 2, "", 1, "");
addItem("10090", "Accu_20Start_X4Licht", "/stroom/startlicht-accu/index.html", 2, "", 1, "");
addItem("10091", "Accu_20GEL", "/stroom/gel-accu/index.html", 2, "", 1, "");
addItem("10092", "Accu_20AGM", "/stroom/agm-accu/index.html", 2, "", 1, "");
addItem("10093", "Accu_20Semi_X2tractie", "/stroom/semi-traktie/index.html", 2, "", 1, "");
addItem("100114", "Optima", "/stroom/optima/index.html", 2, "", 1, "");
addItem("100111", "Energie", "/energie/index.html", 1, "", 1, "");
addItem("10066", "Generator", "/energie/generator/index.html", 2, "", 1, "");
addItem("100110", "Zonnepaneel", "/energie/zonnepaneel/index.html", 2, "", 1, "");
addItem("100113", "Brandstofcel", "/energie/brandstofcel/index.html", 2, "", 1, "");
addItem("10046", "Klimaat", "/klimaat/index.html", 1, "", 1, "");
addItem("10049", "Verwarmen", "/klimaat/verwarmen/index.html", 2, "", 1, "");
addItem("10050", "Koelen", "/klimaat/koelen/index.html", 2, "", 1, "");
addItem("100119", "Boiler", "/klimaat/boiler/index.html", 2, "", 1, "");
addItem("100121", "Hydrofoor", "/klimaat/hydrofoor/index.html", 2, "", 1, "");
addItem("100140", "Airco", "/klimaat/airco/index.html", 2, "", 1, "");
addItem("100147", "Geiser", "/klimaat/geiser/index.html", 2, "", 1, "");
addItem("100142", "Veiligheid", "/veiligheid/index.html", 1, "", 1, "");
addItem("100145", "Detector", "/veiligheid/gasdetector/index.html", 2, "", 1, "");
addItem("100152", "Alarm_20systeem", "/veiligheid/alarm-systeem/index.html", 2, "", 1, "");
addItem("100156", "Hoezen", "/veiligheid/hoezen/index.html", 2, "", 1, "");
addItem("100143", "Comfort", "/comfort/index.html", 1, "", 1, "");
addItem("100146", "Caravan_20Mover", "/comfort/mover/index.html", 2, "", 1, "");
addItem("100148", "Koken", "/comfort/koken/index.html", 2, "", 1, "");
addItem("100153", "Dakdrager", "/comfort/dakdrager/index.html", 2, "", 1, "");
addItem("100154", "Dakkoffer", "/comfort/dakkoffer/index.html", 2, "", 1, "");
addItem("10030", "2dehands", "/2dehands/index.html", 1, "", 1, "");
addItem("10033", "Stroom", "/2dehands/stroomvoorziening/index.html", 2, "", 1, "");
addItem("10034", "Comfort", "/2dehands/comfort/index.html", 2, "", 1, "");
addItem("10035", "Veiligheid", "/2dehands/veiligheid/index.html", 2, "", 1, "");
addItem("10065", "Nieuws", "/nieuws/index.html", 1, "", 1, "");
addItem("10069", "Info_20en_20prijzen", "/info-en-prijzen/index.html", 1, "", 1, "");
};

var m_sSelectedOptionValue = '0';
function printCatnavDropdown(){
	document.write('<select id="catdropdown" style="width:100%"></select>');
	SMShop.base.addMember("CatnavDropdown");
};

function CatnavDropdown_windowOnLoad(args){
	var oItems = g_oPopupMenu.selectItems(0, true);
	var selCatDropDown = $('catdropdown'),oOption = null, sDepth = '';

	if(m_sSelectedOptionValue == '0'){
		oOption = selCatDropDown[selCatDropDown.length] = new Option();
		with(oOption){
			selected='selected';
			text='<Warengruppen>';
			value = '0';
		}
	};

	oItems.each(function(oItem) {
		sDepth = ''; for(var i=1;i<parseInt(oItem.depth);i++) sDepth += '-';
		oOption = selCatDropDown[selCatDropDown.length] = new Option();
		with(oOption){
			if(oItem.id == m_sSelectedOptionValue) selected = 'selected';
			text = sDepth + ' ' + oItem.caption;
			value = oItem.id;
		}}
	);

	selCatDropDown.onchange = function(){
		var oItem = g_oPopupMenu.selectSingleItem(this.value);
		
		location.href = SMOMAbsoluteRootURL + oItem.url;
		
	};
};