			switchTeaserImagesInterval = false;
			teaserImageCounter = 1;
			teaserImagesScrolling = false;

			function init() {
				if(window.location.hash && window.location.hash.search(/tabId/) >= 0) {
		 
				} else {
					appManager = new AppManagerClass();
					appManager.init();		
					
					tabEventHandler = new tabEventHandlerClass();
					
					tabController = new TabControllerClass();
					tabController.id = "moreEventsTabContainer";
					tabController.name = "tabController";
					tabController.eventHandler = tabEventHandler;
					tabController.editable = false;
					tabController.addSpacer = true;
					tabController.init();
				
					tabController.addTab(0, '&Uuml;bersicht');			
					tabController.addTab(1, 'Parties');	
					tabController.addTab(2, 'Konzerte');
					tabController.addTab(3, 'Sport');
					tabController.addTab(4, 'Theater');
					tabController.addTab(5, 'Feste');
					
					tabController.setActiveTab(selectedTabId);		
									
					
					initMainTabs();
					
					
					now = new Date();
					
					calendarHandler = new calendarHandlerClass();
					
					if(topEvents) {
						startTeaserImageScroll();
					}																
				}
			}

			function eventPhotosInit() {
				if(window.location.hash && window.location.hash.search(/tabId/) >= 0) {
		 
				} else {
					appManager = new AppManagerClass();
					appManager.init();		
								
					initMainTabs();
				}
			}

			function initMainTabs() {
				mainTabEventHandler = new mainTabEventHandlerClass();
					
				mainTabController = new TabControllerClass();
				mainTabController.id = "tabBar";
				mainTabController.name = "mainTabController";
				mainTabController.eventHandler = mainTabEventHandler;
				mainTabController.editable = false;
				mainTabController.addSpacer = true;
				mainTabController.init();

				mainTabController.addTab(0, 'Events');	
				mainTabController.addTab(1, 'Eventfotos');
				mainTabController.addTab(2, 'Eventreihen');
				mainTabController.addTab(3, 'Pre- &amp; Reviews');
				mainTabController.addTab(4, 'Event-Locations');
																																			
				mainTabController.setActiveTab(selectedMainTabId);			
			}
			
			function startTeaserImageScroll() {
				if(!teaserImagesScrolling && topEvents) {
					switchTeaserImagesInterval = window.setInterval("switchTeaserImages()", 2000);
					teaserImagesScrolling = true;
				}	
			}
			
			function stopTeaserImageScroll() {
				window.clearInterval(switchTeaserImagesInterval);
				teaserImagesScrolling = false;
			}
			
			function switchTeaserImages() {
				if(topEvents) {
					if(teaserImageCounter >= topEvents.length) {
						teaserImageCounter = 0;
					}
					document.getElementById("topEventImage").src = topEvents[teaserImageCounter]["imagePath"];
					teaserImageCounter++;
				}
			}
			
			function clickOnTeaserImage() {
				window.location.href = basePath + '/' + topEvents[teaserImageCounter - 1]["id"];
			}	
			
			function calendarHandlerClass() {
				this.selectedDate = function(startDate, stopDate) {
					if(startDate) {
						startDateString = startDate["Day"] + "-" + startDate["Month"] + "-" + startDate["Year"];
						urlString = basePath + 'category/' + categoryId + '/';
	
						urlString = urlString + 'date/' + startDateString;
						
						if(stopDate) {
							stopDateString = stopDate["Day"] + "-" + stopDate["Month"] + "-" + stopDate["Year"];
							urlString = urlString + '/to/' + stopDateString;
						}
						
						if(searchTerm) {
							urlString = urlString + '/?search=' + searchTerm;
						}
						
						window.location.href = urlString;
					}
				}
				
				this.resetCalendar = function() {
					eventCalendar.reset();
				}			
			} 
			
			function hoverOverEvent(box, imagePath) {
				box.className = 'topEventContainer hovered';
				if(imagePath && imagePath!='false') {
					stopTeaserImageScroll();
					document.getElementById("topEventImage").src = imagePath;
				}
			}
			
			function unHoverEvent(box) {
				startTeaserImageScroll();
				box.className = 'topEventContainer';
			}
			
			function scrollDownTopEventList() {
				if(!disableScrollDownTopEventList && topEventListCurrentPage < lastPage) {
					topEventListCurrentPage++;
					startMoveBoxEffect(document.getElementById('topEventInnerScrollContainer'), 'up', (topEventListCurrentPage - 1) * -288, 30, false);	
					disableScrollUpTopEventList = false;				
					document.getElementById('topEventListScrollUpBar').className = 'topEventListScrollUpBar';
					
					if(topEventListCurrentPage >= lastPage) {
						disableScrollDownTopEventList = true;
						document.getElementById('topEventListScrollDownBar').className = 'topEventListScrollDownBar inactive';
					}
				}
			}		

			function scrollUpTopEventList() {
				if(!disableScrollUpTopEventList) {
					topEventListCurrentPage--;
					startMoveBoxEffect(document.getElementById('topEventInnerScrollContainer'), 'down', (topEventListCurrentPage - 1) * -288, 30, false);
					
					disableScrollDownTopEventList = false;
					document.getElementById('topEventListScrollDownBar').className = 'topEventListScrollDownBar';
					
					if(topEventListCurrentPage==1) {
						disableScrollUpTopEventList = true;
						document.getElementById('topEventListScrollUpBar').className = 'topEventListScrollUpBar inactive';
					}	
				}			
			}	
		
			function tabEventHandlerClass() {
				var activeTab = 0;
				var activeTabId = false;
				
				this.tabSelected = function(tabId) {
					if(activeTabId) {
						if(tabId==0) {
							urlString = basePath + 'category/event' + dateString;
						} else if(tabId==1) {
							urlString = basePath + 'category/F5DF15D4F564D65F456D4F56F' + dateString;
						} else if(tabId==2) {
							urlString = basePath + 'category/F65D1F5456D4F54D56F456D56' + dateString;
						} else if(tabId==3) {
							urlString = basePath + 'category/FD4F56D4F564D5F4564F' + dateString;
						} else if(tabId==4) {
							urlString = basePath + 'category/4F5D61F21D5F456DF566D54' + dateString;
						} else if(tabId==5) {
							urlString = basePath + 'category/F1D5F45D4F564D56F456F4' + dateString;
						}
						
						if(searchTerm) {
							urlString = urlString + '/?search=' + searchTerm;
						}
						
						document.location.href = urlString;
					} else {
						activeTabId = 1;
					}
				}
			}
			
			function mainTabEventHandlerClass() {
				var activeTab = 0;
				var activeTabId = false;
				
				this.tabSelected = function(tabId) {
					if(activeTabId) {
						if(tabId==0) {
							window.location.href = '/events';
						} else if(tabId==1) {
							window.location.href = '/events/eventphotos';
						} else if(tabId==2) {
							window.location.href = '/events/eventlists';
						} else if(tabId==3) {
							window.location.href = '/events/reviews';
						} else if(tabId==4) {
							window.location.href = '/events/eventLocations';
						}
					} else {
						activeTabId = 1;
					}
				}
			}				
			
			function categorySelected() {
				window.location.href = basePath + 'category/' + document.getElementById("otherEventsCategorySelector").value + dateString;
			}

			function citySelected() {
				cityName = document.getElementById("citySelectorInputField").value;
				if(cityName!=0) {
					if(cityName != defaultCityString) {
						if(GBrowserIsCompatible()) {			
							geocoder = new GClientGeocoder();	
							eval("geocoder.getLatLng('" + cityName + "', function(point) { foundCityLocation(point); });");
						}	
					}
				}
			}				
			
			function foundCityLocation(location) {
				if(location) {
					var cityCoordString = location.toUrlValue(13);
			
					var coords = cityCoordString.split(",");		
			
					var latitude = coords[0];
					var longitude = coords[1];

					window.location.href = basePath + '?city=' + escape(cityName) + '&lat=' + escape(latitude) + '&long=' + escape(longitude);
				}	
			}
			
			function focusOnCityInput() {
				var cityName = document.getElementById("city").value;
				if(cityName == defaultCityString) {	
					document.getElementById("city").value = '';
				}		
			}
			
			function deleteCityData() {
				window.location.href = basePath + '?deleteCity=true';			
			}
			
			function createEventSeries() {
				if(userLoggedIn) {
					appManager.addApp('MYEVENTSERIESAPP');							
					appManager.startApp('MYEVENTSERIESAPP');									
				} else {
					messageWindow = new MessageWindowClass();
					messageWindow.className = 'photoUploadMessageWindow';
					messageWindow.title = 'Bitte melde dich an...';
					messageWindow.message = 'Du musst dich anmelden um eine Event-Reihe anlegen zu k&ouml;nnen. <br /><br /><li><a href="/login/">Zur Anmeldung &raquo;</a></li>';
					messageWindow.name = 'messageWindow';
					messageWindow.displayCurtain = false;
					messageWindow.display();					
				}
			}
