var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "B_C3_BCcher", "/pi1/index.html", 1, "", 1, "");
addItem("1004", "Fotos", "/pi4/index.html", 1, "", 1, "");
addItem("1006", "Berliner_20Mauer", "/pi4/pi6/index.html", 2, "", 1, "");
addItem("1005", "Berliner_20Mauerkunst", "/pi4/pi5/index.html", 2, "", 1, "");
addItem("1007", "Berliner_20Mauer_20_X2_20Heute", "/pi4/pi7/index.html", 2, "", 1, "");
addItem("10014", "Wilhelm_X2Kuhr_X2Stra_C3_9Fe", "/pi4/pi7/pi14/index.html", 3, "", 1, "");
addItem("10011", "Wendezeitgraffiti", "/pi4/pi11/index.html", 2, "", 1, "");
addItem("10013", "Wendezeit", "/pi4/pi13/index.html", 2, "", 1, "");
addItem("1002", "Audio_X2CDs", "/pi2/index.html", 1, "", 1, "");
addItem("1009", "CD_X2ROMs", "/pi9/index.html", 1, "", 1, "");
addItem("10010", "DVDs", "/pi10/index.html", 1, "", 1, "");
addItem("10017", "LPs", "/pi17/index.html", 1, "", 1, "");
addItem("10012", "Bruchst_C3_BCcke_20Berliner_20Mauer", "/pi12/index.html", 1, "", 1, "");
addItem("10016", "Antiquariat", "/pi16/index.html", 1, "", 1, "");
addItem("10019", "Wall_X2StreetGallery", "/pi19/index.html", 1, "", 1, "");
addItem("10015", "Uhren", "/pi15/index.html", 1, "", 1, "");
addItem("10020", "Das_20besondere_20Buch", "/pi20/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;
		
	};
};