var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "DSL", "/dsl/index.html", 1, "", 1, "");
addItem("1002", "DSL_20Telefon_20Flat", "/dsl/dsl-telefon-flat/index.html", 2, "", 1, "");
addItem("1003", "3_20DSL", "/dsl/3-dsl/index.html", 2, "", 1, "");
addItem("1004", "DSL_20Flatrate_20Telefon", "/dsl/dsl-flatrate-telefon/index.html", 2, "", 1, "");
addItem("1005", "DSL_20Geschwindigkeit", "/dsl/dsl-geschwindigkeit/index.html", 2, "", 1, "");
addItem("1006", "DSL_20Anschluss", "/dsl/dsl-anschluss/index.html", 2, "", 1, "");
addItem("1007", "DSL_20Wechsel", "/dsl/dsl-wechsel/index.html", 2, "", 1, "");
addItem("1008", "DSL_20Light", "/dsl/dsl-light/index.html", 2, "", 1, "");
addItem("1009", "DSL_20Speedcheck", "/dsl/dsl-speedcheck/index.html", 2, "", 1, "");
addItem("10010", "DSL_20Problem_20Deutschland", "/dsl/dsl-problem-deutschland/index.html", 2, "", 1, "");
addItem("10011", "DSL_20Flat_20Tarife", "/dsl/dsl-flat-tarife/index.html", 2, "", 1, "");
addItem("10012", "DSL_20Geschwindigkeit_20pr_C3_BCfen", "/dsl/dsl-geschwindigkeit-pruefen/index.html", 2, "", 1, "");
addItem("10013", "DSL_20und_20Telefon", "/dsl/dsl-und-telefon/index.html", 2, "", 1, "");
addItem("10014", "DSL_20Geschwindigkeit_20Test", "/dsl/dsl-geschwindigkeit-test/index.html", 2, "", 1, "");
addItem("10015", "DSL_20Speedtester", "/dsl/dsl-speedtester/index.html", 2, "", 1, "");
addItem("10016", "DSL_20Speed_20messen", "/dsl/dsl-speed-messen/index.html", 2, "", 1, "");
addItem("10017", "DSL_20ohne_20Festnetz", "/dsl/dsl-ohne-festnetz/index.html", 2, "", 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;
		
	};
};