var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10032", "Briefkasten_20Wandmontage", "/briefkasten-wandmontage/index.html", 1, "", 1, "");
addItem("10033", "Briefkasten_20freistehend", "/briefkasten-freistehend/index.html", 1, "", 1, "");
addItem("10046", "Standard_20Briefkasten", "/standart-briefkasten/index.html", 1, "", 1, "");
addItem("10036", "Edelstahl_20Briefkasten", "/edelstahl-briefkasten/index.html", 1, "", 1, "");
addItem("10034", "Standbriefkasten", "/standbriefkasten/index.html", 1, "", 1, "");
addItem("10035", "Nostalgischer_20Briefkasten", "/nostalgischer-briefkasten/index.html", 1, "", 1, "");
addItem("10037", "Firmen_20Briefkasten", "/firmen-briefkasten/index.html", 1, "", 1, "");
addItem("10038", "Grossraumbriefkasten", "/grossraumbriefkasten/index.html", 1, "", 1, "");
addItem("10047", "Kunststoff_20Briefkasten", "/kunststoff-briefkasten/index.html", 1, "", 1, "");
addItem("10039", "Designer_20Briefkasten", "/designer-briefkasten/index.html", 1, "", 1, "");
addItem("10040", "Briefkastenanlage", "/briefkastenanlage/index.html", 1, "", 1, "");
addItem("10041", "Zaunbriefkasten", "/zaunbriefkasten/index.html", 1, "", 1, "");
addItem("10043", "Marken_20Briefkasten", "/marken-briefkasten/index.html", 1, "", 1, "");
addItem("10044", "Transparenter_20Briefkasten", "/transparenter-briefkasten/index.html", 1, "", 1, "");
addItem("10045", "Postkasten", "/postkasten/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;
		
	};
};