			function sndInit() {
				appManager = new AppManagerClass();
				appManager.init();		
					
				tabEventHandler = new tabEventHandlerClass();
					
				tabController = new TabControllerClass();
				tabController.id = "tabBar";
				tabController.name = "tabController";
				tabController.eventHandler = tabEventHandler;
				tabController.editable = false;
				tabController.addSpacer = true;
				tabController.init();
				
				tabController.addTab(0, 'Alle Locations');			
				tabController.addTab(1, 'Nachtleben');	
				tabController.addTab(2, 'Fun');
				tabController.addTab(3, 'Kinos');
				tabController.addTab(4, 'Kultur');
				tabController.addTab(5, 'Essen & Trinken');
																
				tabController.setActiveTab(selectedTabId);						

				if(topLocationsPoints) {				
					topLocationMap = new GMap2(document.getElementById("mapContainer"));
					topLocationMap.setCenter(new GLatLng(12.080314, 10.1025034), 15);
			
					zoomMapToFit(topLocationsPoints);			
				}
					
				if(doEditUserPosition) {
					messageWindow  = new MessageWindowClass();
					messageWindow.className = 'photoUploadMessageWindow';
					messageWindow.title = 'Gebe deine Position an...';
					messageWindow.message = 'Wir konnten deine Position nicht finden. Um in deiner Umgebung zu suchen, gebe bitte deinen Standort an:<br /><br /><li><a href="Javascript:editMyPosition(); messageWindow.close();">Meinen Standort angeben &raquo;</a></li>';
					messageWindow.name = 'messageWindow';
					messageWindow.displayCancelButton = true;
					messageWindow.displayCurtain = false;
					messageWindow.display();
				}
			}

			function selectSuggestedCategory(categoryId, containerId) {
				if(selectedSuggestedCategoryContainer) {
					document.getElementById(selectedSuggestedCategoryContainer).className = 'suggestedCategory';
				}
				
				document.getElementById('suggestedCategory' + containerId).className = 'suggestedCategory selected';
				selectedSuggestedCategoryContainer = 'suggestedCategory' + containerId;
				
				selectedSuggestedCategory = categoryId;
				checkSelectedSuggestions();
			}
			
			function selectSuggestedCity(cityName, containerId) {
				if(selectedSuggestedCityContainer) {
					document.getElementById(selectedSuggestedCityContainer).className = 'suggestedCity';
				}
				
				document.getElementById('suggestedCity' + containerId).className = 'suggestedCategory selected';
				selectedSuggestedCityContainer = 'suggestedCity' + containerId;
							
				selectedSuggestedCity = cityName;
				checkSelectedSuggestions();
			}			

			function checkSelectedSuggestions() {
				if(selectedSuggestedCategory && selectedSuggestedCity) {
					window.location.href = '/locations/category/' + selectedSuggestedCategory + '/?city=' + escape(selectedSuggestedCity);
				}
			}

			function zoomMapToFit(points) {
			   var bounds = new GLatLngBounds();
			   for (var i=0; i< points.length; i++) {
			      bounds.extend(points[i]);
			      marker = new GMarker(points[i]);
			      topLocationMap.addOverlay(marker); 
			   }
			   topLocationMap.setZoom(topLocationMap.getBoundsZoomLevel(bounds));
			   topLocationMap.setCenter(bounds.getCenter());
			}
						
			function scrollDownTopLocationsList() {
				if(!disableScrollDownTopLocationsList && topLocationsListCurrentPage < lastPage) {
					topLocationsListCurrentPage++;
					startMoveBoxEffect(document.getElementById('topLocationInnerScrollContainer'), 'up', (topLocationsListCurrentPage - 1) * -237, 30, false);	
					disableScrollUpTopLocationsList = false;				
					document.getElementById('topLocationsListScrollUpBar').className = 'scrollBar up';
					
					if(topLocationsListCurrentPage >= lastPage) {
						disableScrollDownTopLocationsList = true;
						document.getElementById('topLocationsListScrollDownBar').className = 'scrollBar down inactive';
					}
				}
			}		

			function scrollUpTopLocationsList() {
				if(!disableScrollUpTopLocationsList) {
					topLocationsListCurrentPage--;
					startMoveBoxEffect(document.getElementById('topLocationInnerScrollContainer'), 'down', (topLocationsListCurrentPage - 1) * -237, 30, false);
					
					disableScrollDownTopLocationsList = false;
					document.getElementById('topLocationsListScrollDownBar').className = 'scrollBar down';
					
					if(topLocationsListCurrentPage==1) {
						disableScrollUpTopLocationsList = true;
						document.getElementById('topLocationsListScrollUpBar').className = 'scrollBar up inactive';
					}	
				}			
			}	
		
			function tabEventHandlerClass() {
				var activeTab = 0;
				var activeTabId = false;
				
				this.tabSelected = function(tabId) {
					if(activeTabId) {
						if(tabId==0) {
							window.location.href='/locations/category/location/?search=' + escape(searchTerm);
						} else if(tabId==1) {
							window.location.href='/locations/category/GD21G1DG132DG2/?search=' + escape(searchTerm);							
						} else if(tabId==2) {
							window.location.href='/locations/category/FD46F46D4F4D56F4D5/?search=' + escape(searchTerm);							
						} else if(tabId==3) {
							window.location.href='/locations/category/4F5D45F4D64F5D5D64F5DF5F/?search=' + escape(searchTerm);						
						} else if(tabId==4) {
							window.location.href='/locations/category/HFDJHFJKJFHDJHFK5DFDF/?search=' + escape(searchTerm);						
						} else if(tabId==5) {
							window.location.href='/locations/category/D4F4D4F4FDF5D44F/?search=' + escape(searchTerm);							
						} else if(tabId==6) {
							window.location.href='/locations/category/F5D45DF456D4F4DF4/?search=' + escape(searchTerm);						
						}
					} else {
						activeTabId = 1;
					}
				}
			}	
			
			function categorySelected() {
				categoryId = document.getElementById("otherLocationsCategorySelector").value;
				window.location.href='/locations/category/' + categoryId + '/?search=' + escape(searchTerm);
			}
			
			function searchLocation() {
				searchTerm = document.getElementById("locationSearchInputField").value;
				window.location.href='/locations/?search=' + escape(searchTerm);
			}
			
			function editMyPosition() {
				if(userLoggedIn) {
					if(mapApp) {
						mapApp.type = 'setUserPosition';
						mapApp.init();
					} else {
						appManager.addApp('MYMAPAPP', false, 'editMyPositionInt');
						appManager.startApp('MYMAPAPP');
					}
				} else {
					messageWindow  = new MessageWindowClass();
					messageWindow.className = 'photoUploadMessageWindow';
					messageWindow.title = 'Bitte melde dich an...';
					messageWindow.message = 'Du musst dich anmelden um deine Position angeben zu k&ouml;nnen.<br /><br /><li><a href="/login/">Zur Anmeldung &raquo;</a></li>';
					messageWindow.name = 'messageWindow';
					messageWindow.displayCurtain = false;
					messageWindow.display();					
				}			
			}

			function editMyPositionInt() {
				mapApp = new MapAppClass();
				mapApp.id = 'profileMapApp';
				mapApp.type = 'setUserPosition';
				mapApp.objectId = false;
				mapApp.objectName = false;
				mapApp.name = 'mapApp';
				mapApp.init();
			}
			
			function foundCoordinatesForSearchTerm(location) {
				if(location) {
					var cityCoordString = location.toUrlValue(13);
			
					var coords = cityCoordString.split(",");		
			
					var latitude = coords[0];
					var longitude = coords[1];

					window.location.href='/locations/?search=' + escape(searchTerm) + '&lat=' + escape(latitude) + '&long=' + escape(longitude);
				} else {
					window.location.href='/locations/?search=' + escape(searchTerm);
				}
			}
			
			function focusOnSearchInputField() {
				if(document.getElementById("locationSearchInputField").value == defaultSearchTerm) {	
					document.getElementById("locationSearchInputField").value = '';
				}
			}
			
			function deleteCityData() {
				window.location.href='/locations/?deleteCity=true';			
			}
			
