var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1008", "Gillette_20Rasierklingen_20(26)", "/gillette-rasierklingen/index.html", 1, "", 1, "");
addItem("10017", "Fusion_20Power_20Rasierklingen_20(2)", "/gillette-rasierklingen/fusion-power-rasierklingen/index.html", 2, "", 1, "");
addItem("10016", "Gillette_20Fusion_20(2)", "/gillette-rasierklingen/gillette-fusion/index.html", 2, "", 1, "");
addItem("10012", "Gillette_20M3_20Power_20(2)", "/gillette-rasierklingen/gillette-m3-power/index.html", 2, "", 1, "");
addItem("10011", "Mach_203_20Turbo_20(4)", "/gillette-rasierklingen/mach-3-turbo/index.html", 2, "", 1, "");
addItem("10010", "Gillette_20Mach_203_20(4)", "/gillette-rasierklingen/gillette-mach-3/index.html", 2, "", 1, "");
addItem("10014", "Sensor_20Excel_20Rasierklingen_20(2)", "/gillette-rasierklingen/sensor-excel-rasierklingen/index.html", 2, "", 1, "");
addItem("10015", "Sensor_203_20Rasierklingen_20(2)", "/gillette-rasierklingen/sensor-3-rasierklingen/index.html", 2, "", 1, "");
addItem("10013", "Gillette_20Sensor_20(2)", "/gillette-rasierklingen/gillette-sensor/index.html", 2, "", 1, "");
addItem("10018", "Venus_20Gillette_20(6)", "/gillette-rasierklingen/venus-gillette/index.html", 2, "", 1, "");
addItem("10019", "Gillette_20Nassrasierer", "/gillette-nassrasierer/index.html", 1, "", 1, "");
addItem("1009", "Wilkinson_20Rasierklingen", "/wilkinson-rasierklingen/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;
		
	};
};