var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("10055", "Home", "/index.html", 1, "", 1, "");
addItem("10062", "1_X2Leiner", "/http://www.trickkite.de/pi17/index.html", 1, "", 1, "_blank");
addItem("10057", "Trickkites", "/http://www.trickkite.de", 1, "", 1, "_blank");
addItem("1003", "2_X2Leiner", "/pi3/index.html", 1, "", 1, "");
addItem("10038", "Einsteiger", "/pi38/index.html", 1, "", 1, "");
addItem("10039", "Allrounder", "/pi39/index.html", 1, "", 1, "");
addItem("10042", "Hochleister", "/pi42/index.html", 1, "", 1, "");
addItem("10041", "Depower", "/pi41/index.html", 1, "", 1, "");
addItem("10059", "Transportation", "/pi59/index.html", 1, "", 1, "");
addItem("10037", "ATB_X9s", "/pi59/pi37/index.html", 2, "", 1, "");
addItem("10047", "Wake_X2Boards", "/pi59/pi47/index.html", 2, "", 1, "");
addItem("10035", "Buggys", "/pi59/pi35/index.html", 2, "", 1, "");
addItem("10048", "Equipment", "/pi48/index.html", 1, "", 1, "");
addItem("10061", "Trapeze", "/pi48/pi61/index.html", 2, "", 1, "");
addItem("10052", "Leinen", "/pi48/pi52/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;
		
	};
};