var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "E_X2BOOKS", "/http://www.fliegenpilzwerkstatt.de/pi1/index.html", 1, "", 1, "");
addItem("10023", "Liebe_20Monster", "/http://www.fliegenpilzwerkstatt.de/safedataframe.html?fsrc=http://www.fliegenpilzwerkstatt.de/pi23/", 1, "", 1, "");
addItem("1009", "70er_20Jahre_20Stoffe", "/http://www.fliegenpilzwerkstatt.de/pi9/index.html", 1, "", 1, "");
addItem("10020", "Freebooks", "/http://www.fliegenpilzwerkstatt.de/safedataframe.html?fsrc=http://www.fliegenpilzwerkstatt.de/pi20/", 1, "", 1, "");
addItem("10024", "Bunter_20Wohnen", "/http://www.fliegenpilzwerkstatt.de/pi24/index.html", 1, "", 1, "");
addItem("10025", "Papiert_C3_BCten_X4Sticker", "/http://www.fliegenpilzwerkstatt.de/pi25/index.html", 1, "", 1, "");
addItem("10026", "Aufn_C3_A4her_X4H_C3_A4kelteile", "/http://www.fliegenpilzwerkstatt.de/pi26/index.html", 1, "", 1, "");
addItem("10027", "Stickdateien", "/http://www.fliegenpilzwerkstatt.de/pi27/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;
		
	};
};