var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001276", "Abverkauf_20_X4_2050_25_20OFF_20!!", "/abverkauf-50-off/index.html", 1, "", 1, "");
addItem("1001277", "DT1_X2Luftfilter", "/abverkauf-50-off/luftfilter/index.html", 2, "", 1, "");
addItem("1001278", "SUTER_X2Kupplungen", "/abverkauf-50-off/suter-kupplungen/index.html", 2, "", 1, "");
addItem("1001279", "Sonstiges", "/abverkauf-50-off/sonstiges/index.html", 2, "", 1, "");
addItem("1001280", "Kupplungsbel_C3_A4ge", "/abverkauf-50-off/kupplungsbelaege/index.html", 2, "", 1, "");
addItem("1001281", "PISTAL_X2Kolbenkits", "/abverkauf-50-off/pistal-kolbenkits/index.html", 2, "", 1, "");
addItem("1001282", "CAPIT_X2Reifenw_C3_A4rmer", "/abverkauf-50-off/capit-reifenwaermer/index.html", 2, "", 1, "");
addItem("10084", "Ducati_20Special_20Parts", "/mb2c-special-parts/index.html", 1, "", 1, "");
addItem("10087", "48_X2Zahn_20Umr_C3_BCstkit", "/mb2c-special-parts/48-zahn-umruestkit/index.html", 2, "", 1, "");
addItem("10088", "Druckplatten", "/mb2c-special-parts/druckplatten/index.html", 2, "", 1, "");
addItem("10089", "Druckplatte_20Standard", "/mb2c-special-parts/druckplatten/druckplatte-standard/index.html", 3, "", 1, "");
addItem("10090", "Druckplatte_20Racing", "/mb2c-special-parts/druckplatten/druckplatte-racing/index.html", 3, "", 1, "");
addItem("10091", "Druckplatte_20Spider", "/mb2c-special-parts/druckplatten/druckplatte-spider/index.html", 3, "", 1, "");
addItem("10092", "Nehmerzylinder", "/mb2c-special-parts/druckzylinder/index.html", 2, "", 1, "");
addItem("10093", "Rahmenschutzdeckel", "/mb2c-special-parts/rahmenschutzdeckel/index.html", 2, "", 1, "");
addItem("10094", "Gabeleinstellgriffe", "/mb2c-special-parts/gabeleinstellgriffe/index.html", 2, "", 1, "");
addItem("1001275", "Antihoppingkupplung_20CHALLENGER_201_X30", "/mb2c-special-parts/antihoppingkupplung-challenger-10/index.html", 2, "", 1, "");
addItem("10096", "Antihoppingkupplung_20IMPACT_201_X32", "/mb2c-special-parts/antihoppingkupplung-impact/index.html", 2, "", 1, "");
addItem("10080", "Ventura_20Gep_C3_A4cksysteme", "/ventura-gepaecksysteme/index.html", 1, "", 1, "");
addItem("10083", "BMW_20Special_20Parts", "/bmw-parts/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;
		
	};
};