var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1005", "B_C3_BCcher", "/pi4/index.html", 1, "", 1, "");
addItem("1001", "Kristallbilder", "/pi1/index.html", 1, "", 1, "");
addItem("1002", "Engelbilder,_20Engelkarten", "/pi2/index.html", 1, "", 1, "");
addItem("1003", "FENG_20SHUI_20Accessoires", "/pi3/index.html", 1, "", 1, "");
addItem("10010", "Bereich_20Wohlstand", "/pi3/pi10/index.html", 2, "", 1, "");
addItem("10011", "Bereich_20Ruhm", "/pi3/pi11/index.html", 2, "", 1, "");
addItem("10012", "Bereich_20Partnerschaft", "/pi3/pi12/index.html", 2, "", 1, "");
addItem("10013", "Bereich_20Kinder_20Kreativit_C3_A4t", "/pi3/pi13/index.html", 2, "", 1, "");
addItem("10014", "Bereich_20Hilfreiche_20Freunde", "/pi3/pi14/index.html", 2, "", 1, "");
addItem("10015", "Bereich_20Karriere_20Lebensweg", "/pi3/pi15/index.html", 2, "", 1, "");
addItem("10016", "Bereich_20Wissen", "/pi3/pi16/index.html", 2, "", 1, "");
addItem("10017", "Bereich_20Familie_20Gesundheit", "/pi3/pi17/index.html", 2, "", 1, "");
addItem("10018", "Bereich_20Tai_20Chi_20Mitte", "/pi3/pi18/index.html", 2, "", 1, "");
addItem("1004", "QI_X2Verst_C3_A4rker,_20Schutz", "/pi4/pi4.html", 1, "", 1, "");
addItem("1006", "Kristalle,_20Steine", "/pi6/index.html", 1, "", 1, "");
addItem("1007", "D_C3_BCfte", "/pi7/index.html", 1, "", 1, "");
addItem("1008", "Werkzeug", "/pi8/index.html", 1, "", 1, "");
addItem("10019", "Brunnen", "/pi19/index.html", 1, "", 1, "");
addItem("10020", "Skulpturen", "/pi20/index.html", 1, "", 1, "");
addItem("10021", "Kerzen", "/pi21/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;
		
	};
};