var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10015", "Shop", "/artikel/index.html", 1, "", 1, "");
addItem("1007", "Messe_X2_20_X7_20Werbetafeln", "/artikel/messe-und-werbetafeln/index.html", 2, "", 1, "");
addItem("1008", "Poster_20_X7_20Banner", "/artikel/plakate-banner/index.html", 2, "", 1, "");
addItem("1001", "Displays_20_X7_20Theken", "/artikel/displays-theken/index.html", 2, "", 1, "");
addItem("10021", "Bannerdisplays", "/artikel/displays-theken/bannerdisplays/index.html", 3, "", 1, "");
addItem("10025", "Posterpr_C3_A4sentation", "/artikel/displays-theken/posterpraesentation/index.html", 3, "", 1, "");
addItem("10024", "Kundenstopper", "/artikel/displays-theken/kundenstopper/index.html", 3, "", 1, "");
addItem("10032", "Aufsteller", "/artikel/displays-theken/aufsteller/index.html", 3, "", 1, "");
addItem("10022", "Theken", "/artikel/displays-theken/theken/index.html", 3, "", 1, "");
addItem("10026", "Stellw_C3_A4nde", "/artikel/displays-theken/stellwaende/index.html", 3, "", 1, "");
addItem("10029", "Leuchtdisplays", "/artikel/displays-theken/leuchtdisplays/index.html", 3, "", 1, "");
addItem("10023", "Klapprahmen", "/artikel/displays-theken/klapprahmen/index.html", 3, "", 1, "");
addItem("10028", "Spannrahmen", "/artikel/displays-theken/spannrahmen/index.html", 3, "", 1, "");
addItem("10030", "Prospektdisplays", "/artikel/displays-theken/prospektdisplays/index.html", 3, "", 1, "");
addItem("10031", "Leitsysteme", "/artikel/displays-theken/leitsysteme/index.html", 3, "", 1, "");
addItem("10027", "Fahnenmasten", "/artikel/displays-theken/fahnenmasten/index.html", 3, "", 1, "");
addItem("10033", "Vitrinen", "/artikel/displays-theken/vitrinen/index.html", 3, "", 1, "");
addItem("10038", "Fahrradst_C3_A4nder", "/artikel/displays-theken/fahrradstaender/index.html", 3, "", 1, "");
addItem("10012", "Verbinder", "/artikel/verbindershop/index.html", 2, "", 1, "");
addItem("10014", "CNC_X2Fr_C3_A4sen", "/artikel/bilder-fuer-die-ewigkeit/index.html", 2, "", 1, "");
addItem("1009", "Rahmen_20_X7_20Galerie", "/artikel/rahmen-galerie/index.html", 2, "", 1, "");
addItem("1006", "Befestigung", "/artikel/materialien/index.html", 2, "", 1, "");
addItem("1002", "Beschriftungen", "/artikel/beschriftungen/index.html", 2, "", 1, "");
addItem("10035", "Materialien", "/artikel/verschiedenes/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;
		
	};
};