var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10040", "New_20(1)", "/news/index.html", 1, "", 1, "");
addItem("1006", "Crystals_20(18)", "/crystals/index.html", 1, "", 1, "");
addItem("1004", "Pendants", "/pendants/index.html", 1, "", 1, "");
addItem("10039", "All_20pendants_20(34)", "/pendants/all-pendants2/index.html", 2, "", 1, "");
addItem("10030", "Circle_20of_20Light_20_20pendants_20(21)", "/pendants/crystal-pendants/index.html", 2, "", 1, "");
addItem("10036", "Highest_20Protection_20(2)", "/pendants/highest-protection/index.html", 2, "", 1, "");
addItem("10037", "Healing_20pendants_20(1)", "/pendants/healing-pedants/index.html", 2, "", 1, "");
addItem("10031", "Circle_20of_20Grace_20_20pendants_20(8)", "/pendants/gemstone-pendants/index.html", 2, "", 1, "");
addItem("10041", "Love_20and_20Gratitude_20(3)", "/pendants/love-and-gratitude/index.html", 2, "", 1, "");
addItem("10042", "Sisterhood_20of_20the_20Wise_20Women_20(3)", "/pendants/sisterhood-of-the-wise-women/index.html", 2, "", 1, "");
addItem("10026", "Oils_20and_20Essences_20(73)", "/tinctures-oils/index.html", 1, "", 1, "");
addItem("10017", "Meditation", "/meditation-and-conscoiusness/index.html", 1, "", 1, "");
addItem("10028", "Methods_20of_20meditation_20(4)", "/meditation-and-conscoiusness/methods-of-meditation/index.html", 2, "", 1, "");
addItem("10029", "Tools_20supporting_20meditation", "/meditation-and-conscoiusness/tools-supporting-meditation/index.html", 2, "", 1, "");
addItem("10018", "energized_20crystals_20(13)", "/meditation-and-conscoiusness/tools-supporting-meditation/crystals/index.html", 3, "", 1, "");
addItem("10019", "energized_20pendants_20(26)", "/meditation-and-conscoiusness/tools-supporting-meditation/energized-pendants/index.html", 3, "", 1, "");
addItem("10023", "Environment_20(17)", "/environment/index.html", 1, "", 1, "");
addItem("10020", "Healing_20and_20Wellness_20(38)", "/healing-and-wellness/index.html", 1, "", 1, "");
addItem("10025", "Seminars,_20Sessions_20(2)", "/sessions-and-groups/index.html", 1, "", 1, "");
addItem("10024", "Art", "/art/index.html", 1, "", 1, "");
addItem("10033", "Bamboo_20Painting_20by_20Teerth_20(1)", "/art/bamboo-painting-by-teerth/index.html", 2, "", 1, "");
addItem("10034", "Art_20for_20Awakening,_20by_20Sampatti_20(22)", "/art/vibrational-art-by-sampatti/index.html", 2, "", 1, "");
addItem("10035", "Giri_60s_20Art_20(3)", "/art/giris-art/index.html", 2, "", 1, "");
addItem("10032", "Links", "/links/index.html", 1, "", 1, "");
addItem("10049", "Music_20and_20Sound", "/music-and-sound/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;
		
	};
};