var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Haarschmuck_20Braut", "/haarschmuck/index.htm", 1, "", 1, "");
addItem("1002", "Kamm", "/haarschmuck/kamm/index.htm", 2, "", 1, "");
addItem("1003", "Haarspange", "/haarschmuck/haarspange/index.htm", 2, "", 1, "");
addItem("1004", "Curlies_20_X2_20Haarspiralen", "/haarschmuck/curlies/index.htm", 2, "", 1, "");
addItem("1005", "Haarnadeln", "/haarschmuck/haarnadeln/index.htm", 2, "", 1, "");
addItem("10013", "Perlen_X2Bl_C3_BCten_20Haarnadeln", "/haarschmuck/haarnadeln/perlen-blueten-haarnadeln/index.htm", 3, "", 1, "");
addItem("10014", "Strass_20Haarnadeln", "/haarschmuck/haarnadeln/strass-haarnadeln/index.htm", 3, "", 1, "");
addItem("1007", "Diadem_X2Tiara", "/haarschmuck/diadem-tiara/index.htm", 2, "", 1, "");
addItem("10038", "Swarovski_20Diadem", "/haarschmuck/diadem-tiara/swarovski-strass-diadem/index.htm", 3, "", 1, "");
addItem("10043", "Strass_X2Diadem_20_X2_20Kr_C3_B6nchen", "/haarschmuck/diadem-tiara/strass-diadem-tiara/index.htm", 3, "", 1, "");
addItem("10036", "Perlen_X2Faden", "/haarschmuck/perlen-faden/index.htm", 2, "", 1, "");
addItem("10035", "Blumenkinder_20_X2_20Kommunion", "/haarschmuck/blumenkinder/index.htm", 2, "", 1, "");
addItem("1009", "Diverser_20Brautschmuck", "/haarschmuck/diverser-brautschmuck/index.htm", 2, "", 1, "");
addItem("10010", "Modeschmuck_20Braut", "/modeschmuck/index.htm", 1, "", 1, "");
addItem("10011", "Swarovski_20Ohrringe", "/modeschmuck/ohrschmuck/index.htm", 2, "", 1, "");
addItem("10015", "Swarovski_X2Ohrh_C3_A4nger", "/modeschmuck/ohrschmuck/haenger/index.htm", 3, "", 1, "");
addItem("10018", "14_20mm_20rund", "/modeschmuck/ohrschmuck/haenger/14-mm-rund/index.htm", 4, "", 1, "");
addItem("10019", "10_20mm_20rund", "/modeschmuck/ohrschmuck/haenger/10-mm-rund/index.htm", 4, "", 1, "");
addItem("10023", "8_20mm_20rund", "/modeschmuck/ohrschmuck/haenger/8-mm-rund/index.htm", 4, "", 1, "");
addItem("10021", "12x12mm_20eckig", "/modeschmuck/ohrschmuck/haenger/12x12mm-eckig/index.htm", 4, "", 1, "");
addItem("10016", "Swarovski_X2Ohrstecker", "/modeschmuck/ohrschmuck/ohrstecker/index.htm", 3, "", 1, "");
addItem("10029", "Chantal", "/modeschmuck/ohrschmuck/ohrstecker/chantal/index.htm", 4, "", 1, "");
addItem("10028", "8_20mm_20rund", "/modeschmuck/ohrschmuck/ohrstecker/8-mm-rund/index.htm", 4, "", 1, "");
addItem("10025", "Perlen_20Ohrringe", "/modeschmuck/perlen-ohrschmuck/index.htm", 2, "", 1, "");
addItem("10030", "Perle_X4Swarovski_X2Stecker", "/modeschmuck/perlen-ohrschmuck/perlen-stecker/index.htm", 3, "", 1, "");
addItem("10031", "Perlen_X2Clip", "/modeschmuck/perlen-ohrschmuck/perlen-clip/index.htm", 3, "", 1, "");
addItem("10034", "Perlenketten_20_7C_20Perlencollier", "/modeschmuck/perlenkette/index.htm", 2, "", 1, "");
addItem("10046", "Perlenketten_20_22Classic_22", "/modeschmuck/perlenkette/perlenkette-classic/index.htm", 3, "", 1, "");
addItem("10047", "Perlencollier_20_22Exclusiv_22", "/modeschmuck/perlenkette/perlenkette-exclusiv/index.htm", 3, "", 1, "");
addItem("10045", "Strass_X2Colliers", "/modeschmuck/colliers/index.htm", 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;
		
	};
};