var g_oPopupMenu = new SMPopupMenu("SMGlobalPopupMenu"), oItem = null;
with(g_oPopupMenu){
addItem("1002", "Binoculars", "/binoculars/index.htm", 1, "", 1, "");
addItem("10016", "Leica", "/binoculars/leica-special-offer/index.htm", 2, "", 1, "");
addItem("10081", "Special_20offers", "/binoculars/leica-special-offer/special-offers/index.htm", 3, "", 1, "");
addItem("1004", "Compact_20binoculars", "/binoculars/leica-special-offer/compact-binoculars/index.htm", 3, "", 1, "");
addItem("10088", "Monovid", "/binoculars/leica-special-offer/monovid/index.htm", 3, "", 1, "");
addItem("10041", "Ultravid_20BL", "/binoculars/leica-special-offer/ultravid-bl/index.htm", 3, "", 1, "");
addItem("10052", "Ultravid_20HD", "/binoculars/leica-special-offer/ultravid-hd-news/index.htm", 3, "", 1, "");
addItem("10058", "Geovid", "/binoculars/leica-special-offer/geovid/index.htm", 3, "", 1, "");
addItem("10067", "Duovid", "/binoculars/leica-special-offer/duovid/index.htm", 3, "", 1, "");
addItem("10079", "Steiner", "/binoculars/steiner-special-offer/index.htm", 2, "", 1, "");
addItem("1003", "Commander", "/binoculars/steiner-special-offer/commander/index.htm", 3, "", 1, "");
addItem("10035", "Navigator", "/binoculars/steiner-special-offer/skipper/index.htm", 3, "", 1, "");
addItem("10083", "Nighthunter_20XP", "/binoculars/steiner-special-offer/nighthunter-xp/index.htm", 3, "", 1, "");
addItem("10082", "Ranger_20Pro", "/binoculars/steiner-special-offer/ranger/index.htm", 3, "", 1, "");
addItem("10064", "Wildlife", "/binoculars/steiner-special-offer/wildlife/index.htm", 3, "", 1, "");
addItem("10071", "Safari", "/binoculars/steiner-special-offer/safari/index.htm", 3, "", 1, "");
addItem("10076", "Discovery", "/binoculars/steiner-special-offer/discovery/index.htm", 3, "", 1, "");
addItem("10074", "SkyHawk_20Pro", "/binoculars/steiner-special-offer/skyhawk/index.htm", 3, "", 1, "");
addItem("10040", "Swarovski", "/binoculars/swarovski/index.htm", 2, "", 1, "");
addItem("1006", "EL", "/binoculars/swarovski/el/index.htm", 3, "", 1, "");
addItem("10036", "SLC", "/binoculars/swarovski/slc/index.htm", 3, "", 1, "");
addItem("10049", "Pocket", "/binoculars/swarovski/pocket/index.htm", 3, "", 1, "");
addItem("10056", "Accessories", "/binoculars/swarovski/accessories/index.htm", 3, "", 1, "");
addItem("10054", "Zeiss", "/binoculars/zeiss/index.htm", 2, "", 1, "");
addItem("10019", "mono", "/binoculars/zeiss/mono/index.htm", 3, "", 1, "");
addItem("10042", "Victory", "/binoculars/zeiss/victory/index.htm", 3, "", 1, "");
addItem("10086", "Victory_20RF", "/binoculars/zeiss/victory-rf/index.htm", 3, "", 1, "");
addItem("10045", "Conquest", "/binoculars/zeiss/conquest/index.htm", 3, "", 1, "");
addItem("10057", "Classic", "/binoculars/zeiss/classic/index.htm", 3, "", 1, "");
addItem("10066", "Compact_X2binoculars", "/binoculars/zeiss/compact-binoculars/index.htm", 3, "", 1, "");
addItem("10060", "Minox", "/binoculars/minox/index.htm", 2, "", 1, "");
addItem("10018", "mono", "/binoculars/minox/mono/index.htm", 3, "", 1, "");
addItem("10032", "HG_X2binoculars", "/binoculars/minox/hg-binoculars/index.htm", 3, "", 1, "");
addItem("10093", "APO_X2HG_20binoculars", "/binoculars/minox/apo-hg-binoculars/index.htm", 3, "", 1, "");
addItem("10044", "BL_X2binoculars", "/binoculars/minox/bl-binoculars/index.htm", 3, "", 1, "");
addItem("10072", "BV_X2binoculars", "/binoculars/minox/bv-binoculars-new/index.htm", 3, "", 1, "");
addItem("10065", "Compact_X2binoculars", "/binoculars/minox/compact-binoculars/index.htm", 3, "", 1, "");
addItem("10068", "Optolyth", "/binoculars/optolyth/index.htm", 2, "", 1, "");
addItem("10094", "Monocular", "/binoculars/optolyth/monocular/index.htm", 3, "", 1, "");
addItem("1001", "ALPIN", "/binoculars/optolyth/alpin/index.htm", 3, "", 1, "");
addItem("10033", "ROYAL", "/binoculars/optolyth/royal/index.htm", 3, "", 1, "");
addItem("10095", "ViaNova", "/binoculars/optolyth/vianova/index.htm", 3, "", 1, "");
addItem("10050", "SPORTING", "/binoculars/optolyth/sporting/index.htm", 3, "", 1, "");
addItem("10073", "Docter", "/binoculars/docter/index.htm", 2, "", 1, "");
addItem("10020", "mono", "/binoculars/docter/mono/index.htm", 3, "", 1, "");
addItem("10030", "Compact", "/binoculars/docter/compact/index.htm", 3, "", 1, "");
addItem("10043", "ASPECTEM", "/binoculars/docter/aspectem/index.htm", 3, "", 1, "");
addItem("10037", "Spotting_20scopes", "/spotting-scopes/index.htm", 1, "", 1, "");
addItem("10015", "Leica", "/spotting-scopes/leica/index.htm", 2, "", 1, "");
addItem("1009", "Eyepieces", "/spotting-scopes/leica/eyepieces/index.htm", 3, "", 1, "");
addItem("10028", "Accessories", "/spotting-scopes/leica/accessories/index.htm", 3, "", 1, "");
addItem("10038", "Swarovski", "/spotting-scopes/swarovski/index.htm", 2, "", 1, "");
addItem("10010", "Eyepieces", "/spotting-scopes/swarovski/eyepieces/index.htm", 3, "", 1, "");
addItem("10026", "Accessories", "/spotting-scopes/swarovski/accessories/index.htm", 3, "", 1, "");
addItem("10055", "Zeiss", "/spotting-scopes/zeiss/index.htm", 2, "", 1, "");
addItem("1007", "Eyepieces", "/spotting-scopes/zeiss/eyepieces/index.htm", 3, "", 1, "");
addItem("10024", "Accessories", "/spotting-scopes/zeiss/accessories/index.htm", 3, "", 1, "");
addItem("10061", "Minox", "/spotting-scopes/minox/index.htm", 2, "", 1, "");
addItem("10011", "Eyepieces", "/spotting-scopes/minox/eyepieces/index.htm", 3, "", 1, "");
addItem("10089", "Special_20offers", "/spotting-scopes/minox/special-offers/index.htm", 3, "", 1, "");
addItem("10069", "Optolyth", "/spotting-scopes/optolyth/index.htm", 2, "", 1, "");
addItem("10096", "Mini_X2scopes", "/spotting-scopes/optolyth/mini-scopes/index.htm", 3, "", 1, "");
addItem("10012", "Eyepieces", "/spotting-scopes/optolyth/eyepieces/index.htm", 3, "", 1, "");
addItem("10027", "Accessories", "/spotting-scopes/optolyth/accessories/index.htm", 3, "", 1, "");
addItem("10077", "Kowa", "/spotting-scopes/kowa/index.htm", 2, "", 1, "");
addItem("1008", "Eyepieces", "/spotting-scopes/kowa/eyepieces/index.htm", 3, "", 1, "");
addItem("10013", "f_X3_20TSN_20880_20_X1_20TSN_20770", "/spotting-scopes/kowa/eyepieces/f-tsn-880-tsn-770/index.htm", 4, "", 1, "");
addItem("10031", "f_X3_20TSN_20820", "/spotting-scopes/kowa/eyepieces/f-tsn-820/index.htm", 4, "", 1, "");
addItem("10046", "f_X3_20TSN_20660_20_X1_20600", "/spotting-scopes/kowa/eyepieces/f-tsn-660-600/index.htm", 4, "", 1, "");
addItem("10025", "Accessories", "/spotting-scopes/kowa/accessories/index.htm", 3, "", 1, "");
addItem("10062", "Night_20Vision", "/night-vision/index.htm", 1, "", 1, "");
addItem("10051", "Swarovski", "/night-vision/swarovski/index.htm", 2, "", 1, "");
addItem("10059", "Minox", "/night-vision/minox/index.htm", 2, "", 1, "");
addItem("10087", "Zeiss", "/night-vision/zeiss/index.htm", 2, "", 1, "");
addItem("10070", "Rangefinder", "/rangefinder/index.htm", 1, "", 1, "");
addItem("10014", "Leica", "/rangefinder/leica/index.htm", 2, "", 1, "");
addItem("10097", "Special_20offers", "/rangefinder/leica/special-offers/index.htm", 3, "", 1, "");
addItem("10039", "Swarovski", "/rangefinder/swarovski/index.htm", 2, "", 1, "");
addItem("10053", "Zeiss", "/rangefinder/zeiss/index.htm", 2, "", 1, "");
addItem("10075", "Tripods", "/tripods/index.htm", 1, "", 1, "");
addItem("10017", "Manfrotto", "/tripods/manfrotto/index.htm", 2, "", 1, "");
addItem("10022", "Tripod_20heads", "/tripods/manfrotto/tripod-heads/index.htm", 3, "", 1, "");
addItem("10029", "Berlebach", "/tripods/berlebach/index.htm", 2, "", 1, "");
addItem("10021", "Tripod_20heads", "/tripods/berlebach/tripod-heads/index.htm", 3, "", 1, "");
addItem("10078", "Magnifier", "/magnifier/index.htm", 1, "", 1, "");
addItem("10023", "Zeiss", "/magnifier/zeiss/index.htm", 2, "", 1, "");
addItem("10034", "Schneider", "/magnifier/schneider/index.htm", 2, "", 1, "");
addItem("10080", "Weatherstations", "/weatherstations/index.htm", 1, "", 1, "");
addItem("1005", "Compass,_20Altimeter", "/weatherstations/compass-altimeter/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;
		
	};
};