var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10018", "Sorglospakete", "/sorglospackete/index.html", 1, "", 1, "");
addItem("10020", "Slim_20Sorglospakete", "/sorglospackete/slim-sorglospakete/index.html", 2, "", 1, "");
addItem("10021", "Basic_20Sorglospakete", "/sorglospackete/big-sorglospakete/index.html", 2, "", 1, "");
addItem("10022", "Elite_20Sorglospakete", "/sorglospackete/elite-sorglospakete/index.html", 2, "", 1, "");
addItem("10023", "Extreme_20Sorglospakete", "/sorglospackete/extreme-sorglospakete/index.html", 2, "", 1, "");
addItem("10019", "Bullis_X2Smoker_20Grundger_C3_A4te", "/bullis2/index.html", 1, "", 1, "");
addItem("1001", "Bulli_20Slim", "/bullis2/bullis/index.html", 2, "", 1, "");
addItem("1003", "Bulli_20Elite", "/bullis2/bulli-elite/index.html", 2, "", 1, "");
addItem("1004", "Bulli_20Basic", "/bullis2/bulli-big/index.html", 2, "", 1, "");
addItem("1005", "Bulli_20Extreme", "/bullis2/bulli-extreme/index.html", 2, "", 1, "");
addItem("10015", "Bulli_20Ringdesign", "/bullis2/bulli-ringdesign/index.html", 2, "", 1, "");
addItem("10016", "Verdampfer_20Atomizer", "/verdampfer-atomizer/index.html", 1, "", 1, "");
addItem("10029", "Bulli_X2Smoker_20Liquid", "/bulli-smoker-liquid/index.html", 1, "", 1, "");
addItem("10024", "Leerdepots", "/leerdepots/index.html", 1, "", 1, "");
addItem("10027", "Zubeh_C3_B6r", "/zubehoer2/index.html", 1, "", 1, "");
addItem("10031", "A1_20zubeh_C3_B6r", "/zubehoer2/a1-zubehoer/index.html", 2, "", 1, "");
addItem("1009", "Akkus", "/zubehoer2/akkus/index.html", 2, "", 1, "");
addItem("10010", "Adapter", "/zubehoer2/zubehoer/index.html", 2, "", 1, "");
addItem("10012", "Ladeger_C3_A4t", "/zubehoer2/ladegeraet/index.html", 2, "", 1, "");
addItem("10032", "USB_X2UNI", "/zubehoer2/usb-uni/index.html", 2, "", 1, "");
addItem("10033", "ON_X2Off_20Drehschalter", "/zubehoer2/on-off-drehschalter2/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;
		
	};
};