var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "SKI_20ALPIN", "/ski-alpin/index.html", 1, "", 1, "");
addItem("1002", "Profi_20Race_20Carver_20nach_20FIS", "/ski-alpin/race-carver/index.html", 2, "", 1, "");
addItem("1003", "Top_20Power_20Carver", "/ski-alpin/performance-carver/index.html", 2, "", 1, "");
addItem("1004", "Freizeit_X2_X4Genuss_X2Allrounder", "/ski-alpin/cross-carver/index.html", 2, "", 1, "");
addItem("1005", "Lady_20Carver", "/ski-alpin/lady-carver/index.html", 2, "", 1, "");
addItem("10044", "Einsteiger_20Carver", "/ski-alpin/kinder-carver/index.html", 2, "", 1, "");
addItem("1006", "FreeStyle_X2_X4FreeRide_20Carver", "/ski-alpin/allround-carver/index.html", 2, "", 1, "");
addItem("1007", "Blades,_20FunCarver,_20Miniski", "/ski-alpin/blades-und-funcarver/index.html", 2, "", 1, "");
addItem("1008", "Junioren_X2_20_X4_20Kinder_X2_20_X4_20Baby_X2Ski", "/ski-alpin/kinder-carver/index2.html", 2, "", 1, "");
addItem("10026", "Zubeh_C3_B6r:_20Bindungen,_20Platten,_20St_C3_B6cke,_X3_X3", "/ski-alpin/bindungen-platten-stoecke-zubehoer/index.html", 2, "", 1, "");
addItem("10046", "Sonderangebote", "/ski-alpin/sonderangebote2/index.html", 2, "", 1, "");
addItem("1009", "LANGLAUFSKI_20_X4_20CROSS_20COUNTRY_20SKI", "/langlaufski/index.html", 1, "", 1, "");
addItem("10010", "LL_X2Profi_X2Racer", "/langlaufski/ll-racer/index.html", 2, "", 1, "");
addItem("10011", "LL_X2Power_X2Racer", "/langlaufski/ll-sport-racer/index.html", 2, "", 1, "");
addItem("10017", "LL_X2Nordic_20Cruiser", "/langlaufski/nordic-cruiser/index.html", 2, "", 1, "");
addItem("10018", "LL_X2Allround", "/langlaufski/ll-allround/index.html", 2, "", 1, "");
addItem("10019", "LL_X2Back_20Country", "/langlaufski/ll-back-country/index.html", 2, "", 1, "");
addItem("10027", "LL_X2Schuhe", "/langlaufski/ll-schuhe/index.html", 2, "", 1, "");
addItem("10028", "Bindungen,_20St_C3_B6cke,_20Zubeh_C3_B6r", "/langlaufski/bindungen-stoecke-zubehoer/index.html", 2, "", 1, "");
addItem("10021", "SNOWBOARDS", "/snowboards/index.html", 1, "", 1, "");
addItem("10022", "FreeStyle", "/snowboards/freestyle/index.html", 2, "", 1, "");
addItem("10023", "FreeRide", "/snowboards/freeride/index.html", 2, "", 1, "");
addItem("10029", "Bindungen", "/snowboards/bindungen/index.html", 2, "", 1, "");
addItem("10024", "TOUREN_20_X7_20OUTDOOR", "/outdoor/index.html", 1, "", 1, "");
addItem("10025", "Schneeschuhe", "/outdoor/schneeschuhe/index.html", 2, "", 1, "");
addItem("10038", "SKI_20TOOLS", "/skiservice-skiverleih-tools/index.html", 1, "", 1, "");
addItem("10040", "Bindungseinstellger_C3_A4te", "/skiservice-skiverleih-tools/bindungseinstellgeraete/index.html", 2, "", 1, "");
addItem("10041", "Ski_20Aufbewahrung", "/skiservice-skiverleih-tools/ski-aufbewahrung/index.html", 2, "", 1, "");
addItem("10031", "BOOTE", "/boote/index.html", 1, "", 1, "");
addItem("10032", "Angelboote,_20Beiboote,_20Motorboote", "/boote/angelboote/index.html", 2, "", 1, "");
addItem("10033", "Kanus", "/boote/kanus/index.html", 2, "", 1, "");
addItem("10034", "TENNIS", "/tennis/index.html", 1, "", 1, "");
addItem("10036", "Ballwurfmaschinen", "/tennis/ballwurfmaschinen/index.html", 2, "", 1, "");
addItem("10037", "Analyse_20Computer", "/tennis/analyse-computer/index.html", 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;
		
	};
};