var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1009", "Digital_20Receiver", "/pi9/index.html", 1, "", 1, "");
addItem("10037", "Dreambox", "/pi9/pi38/index.html", 2, "", 1, "");
addItem("10058", "Dreambox_20DeLuxe", "/pi9/pi59/index.html", 2, "", 1, "");
addItem("10031", "Ferguson", "/pi9/pi32/index.html", 2, "", 1, "");
addItem("10057", "Opticum_20_X4_20Globo_20_X4_20Orton", "/pi9/pi58/index.html", 2, "", 1, "");
addItem("10033", "Zubeh_C3_B6r", "/pi34/index.html", 1, "", 1, "");
addItem("10014", "CI_20Module", "/pi14/index.html", 1, "", 1, "");
addItem("10046", "Pay_X2TV", "/pi47/index.html", 1, "", 1, "");
addItem("10056", "Telewizja_20na_20Karte", "/pi47/pi57/index.html", 2, "", 1, "");
addItem("10059", "Telewizja_20na_20Karte_20HD", "/pi47/pi60/index.html", 2, "", 1, "");
addItem("10047", "Telewizja_20na_20Karte_20Aufladen", "/pi47/pi48/index.html", 2, "", 1, "");
addItem("10055", "PolSat", "/pi47/pi56/index.html", 2, "", 1, "");
addItem("10052", "Cyfra_X1", "/pi47/pi53/index.html", 2, "", 1, "");
addItem("10060", "TOP_20Angebote_20(_20B_X2Ware_20)", "/pi61/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;
		
	};
};