var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1001", "Ferienhaus_20_X4_20Ferienwohnungen", "/pi1/index.htm", 1, "", 1, "");
addItem("1007", "Wohnbereich", "/pi7/index.htm", 1, "", 1, "");
addItem("1008", "G_C3_A4stezimmer", "/pi8/index.htm", 1, "", 1, "");
addItem("10010", "G_C3_A4stezimmer_202", "/pi10/index.htm", 1, "", 1, "");
addItem("10019", "Rent_20_X2_20A_20_X2_20CAR", "/pi19/index.htm", 1, "", 1, "");
addItem("10014", "Costa_20de_20la_20Luz", "/pi14/index.htm", 1, "", 1, "");
addItem("10013", "Anreise", "/pi13/index.htm", 1, "", 1, "");
addItem("10015", "Tarifa_20Bilder_20_X1_20Fotos", "/pi15/index.htm", 1, "", 1, "");
addItem("10012", "Preise", "/pi12/index.htm", 1, "", 1, "");
addItem("10011", "Belegungsplan_202010_20und_202011", "/pi11/index.htm", 1, "", 1, "");
addItem("10016", "Tarifa_X2_20Stadtplan", "/pi16/index.htm", 1, "", 1, "");
addItem("10017", "G_C3_A4stebuch", "/pi17/index.htm", 1, "", 1, "");
addItem("10018", "Tarifa_20Infos", "/pi18/index.htm", 1, "", 1, "");
addItem("10021", "Tarifa_20Wettervorhersage", "/pi21/index.htm", 1, "", 1, "");
addItem("10020", "Kiten_20_X1_20Surfen_20_X1_20Segeln_20_X1_20Mountainbiken", "/pi20/index.htm", 1, "", 1, "");
addItem("1002", "Kiteschule_20in_20Tarifa", "/pi20/pi2/index.htm", 2, "", 1, "");
addItem("10027", "Surfen_20bei_20Tarifa", "/pi20/pi27/index.htm", 2, "", 1, "");
addItem("1005", "Tarifa_20Segeln_20in_20der_20Meerenge_20von_20Gibraltar", "/pi20/pi5/index.htm", 2, "", 1, "");
addItem("1009", "Mountainbiken", "/pi20/pi9/index.htm", 2, "", 1, "");
addItem("10023", "Satellit_20_X1_20Karte_20von_20Tarifa", "/http://maps.google.de/maps?hl=de&q=Calle%20de%20Guzm%C3%A1n%20%27El%20Bueno%27%2C%2011380%2C%20Tarifa%2C%20Spanien&ie=UTF-8&sa=N&tab=il", 1, "", 1, "");
addItem("10026", "Impressum", "/pi26/index.htm", 1, "", 1, "");
addItem("10024", "Tarifa_20Webcam_20_X4_20Webcams", "/pi24/index.htm", 1, "", 1, "");
addItem("1003", "Webcam_20Hafen_20Tarifa", "/pi24/pi3/index.htm", 2, "", 1, "");
addItem("1006", "Webcams_20Strand", "/pi24/pi6/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;
		
	};
};