var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1003", "Digitalreceiver", "/digitalreceiver/index.html", 1, "", 1, "");
addItem("1002", "DBox2_20_X2_20Cable", "/digitalreceiver/dbox2-cable/index.html", 2, "", 1, "");
addItem("1006", "DBox2_20_X2_20Sat", "/digitalreceiver/dbox2-sat/index.html", 2, "", 1, "");
addItem("1007", "DBox2_X2Tuning", "/dbox2-tuning/index.html", 1, "", 1, "");
addItem("10011", "IDE_X2Interface", "/ide-interface/index.html", 1, "", 1, "");
addItem("10027", "Hard_20Disk_20Drives", "/hard-disk-drives/index.html", 1, "", 1, "");
addItem("10028", "2_X35_22_20IDE", "/hard-disk-drives/25-ide/index.html", 2, "", 1, "");
addItem("10029", "2_X35_22_20SATA", "/hard-disk-drives/25-sata/index.html", 2, "", 1, "");
addItem("10015", "Accessories", "/accessories/index.html", 1, "", 1, "");
addItem("1001", "Cables", "/accessories/cables/index.html", 2, "", 1, "");
addItem("10030", "Network_20Accessories", "/accessories/network-accessories/index.html", 2, "", 1, "");
addItem("10020", "Tools", "/accessories/tools/index.html", 2, "", 1, "");
addItem("10019", "Spare_20parts", "/spare-parts/index.html", 1, "", 1, "");
addItem("1004", "Displays_X4LCD_X9s", "/spare-parts/displayslcds/index.html", 2, "", 1, "");
addItem("10010", "Remote_20Controls", "/spare-parts/remote-controls/index.html", 2, "", 1, "");
addItem("10014", "Tuner", "/spare-parts/tuner/index.html", 2, "", 1, "");
addItem("10016", "Caseparts", "/spare-parts/caseparts/index.html", 2, "", 1, "");
addItem("10021", "Power_20supply", "/spare-parts/power-supply/index.html", 2, "", 1, "");
addItem("10025", "various_20Chip_X9s_20and_20IC's", "/spare-parts/various-chips-and-ics/index.html", 2, "", 1, "");
addItem("10026", "Cables", "/spare-parts/cables/index.html", 2, "", 1, "");
addItem("10022", "Repair", "/repair/index.html", 1, "", 1, "");
addItem("10024", "Residual_20item", "/residual-item/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;
		
	};
};