			function MultiSearchClass() {
				var typeSelectorVisible = false;
				var defaultString = '';
				var currentPage = 1;
				var types = new Array();
				var doHideTypeSelector = false;
				var activeType = 0;
				var defaultCityName = false;
				
				this.init = function() {
			      	this.addType(0, 'Ziemo-Suche', 'Suchbegriff...', '/images/style/icons/common/onBright/small/searchIcon.gif', 'JavaScript: multiSearch.siteSearch();');
			      	this.addType(1, 'Deine Stadt', 'Name der Stadt...', '/images/style/icons/citySmallOnBright.gif', 'JavaScript: multiSearch.citySearch();');
			      	this.addType(2, 'Personen', 'Name der Person...', '/images/style/icons/common/onBright/small/searchUserIcon.gif', '/user/');
			      	this.addType(3, 'Events', 'Name des Events...', '/images/style/icons/common/onBright/small/eventsIcon.gif', '/events/');
			      	this.addType(4, 'Eventreihen', 'Name der Eventreihe...', '/images/style/icons/common/onBright/small/eventsIcon.gif', '/events/eventlists/');
			      	this.addType(5, 'Locations', 'Name der Location...', '/images/style/icons/common/onBright/small/locationsIcon.gif', '/locations/');
			      	this.addType(6, 'Schulen', 'Name der Schule...', '/images/style/icons/common/onBright/small/schoolsIcon.gif', '/keepInTouch/');									
				}
				
				this.showTypeSelector = function() {
					doHideTypeSelector = false;
					
					if(!typeSelectorVisible) {
						typeSelectorVisible = true;
						document.getElementById("multiSearchTypeSelector").style.display = 'block';
					}
				}
				
				this.checkForHideTypeSelector = function() {
					if(typeSelectorVisible) {
						doHideTypeSelector = true;
						window.setTimeout(this.name + ".checkForHideTypeSelectorInt()", 250);
					}
				}
				
				this.checkForHideTypeSelectorInt = function() {
					headerMenuChecking = false;					
					if(doHideTypeSelector) {
						document.getElementById("multiSearchTypeSelector").style.display = 'none';
						doHideTypeSelector = false;
						typeSelectorVisible = false;
					}
				}				

				this.closeTypeSelector = function() {
					typeSelectorVisible = false;
					document.getElementById("multiSearchTypeSelector").style.display = 'none';
				}
				
				this.focusInputField = function() {
					if(document.getElementById("multiSearchInputField").value == defaultString || document.getElementById("multiSearchInputField").value == defaultCityName) {
						document.getElementById("multiSearchInputField").value = '';
					}
					
					document.getElementById("multiSearchDescription").style.display = 'none';
				}

				this.resetSearch = function() {
					document.location.href = types[activeType]["action"];
				}
				
				this.addType = function(no, name, string, iconPath, action) {
					types[no] = new Array();
					types[no]["name"] = name;
					types[no]["defaultString"] = string;
					types[no]["iconPath"] = iconPath;
					types[no]["action"] = action;
					
					var option = document.createElement("DIV");
					option.className = 'option';
					eval("option.onmouseover = function() { this.className = 'option hovered'; };");
					eval("option.onmouseout = function() { this.className = 'option'; };");
					eval("option.onclick = function() { " + this.name + ".selectType(" + no + "); };");
										
					var optionIcon = document.createElement("IMG");
					optionIcon.src = iconPath;
					optionIcon.className = 'icon';

					var optionLabel = document.createElement("DIV");
					optionLabel.className = 'label';
					optionLabel.innerHTML = name;

					option.appendChild(optionIcon);
					option.appendChild(optionLabel);
					
					document.getElementById("multiSearchTypeSelector").appendChild(option);
				}
				
				this.setSearchTerm = function(typeNo, term) {
					if(term && term != types[typeNo]["defaultString"]) {
						types[typeNo]["defaultString"] = term;
						
						document.getElementById("searchResetButton").style.display = 'block';

						if(typeNo == activeType) {
							document.getElementById("multiSearchInputField").value = term;
						}					
					}
				}
				
				this.setCityName = function(cityName) {
					defaultCityName = cityName;
				}

				this.selectType = function(no) {
					activeType = no;
					
					document.getElementById("typeSelectorIcon").src = types[no]["iconPath"];
					document.getElementById("typeSelectorLabel").innerHTML = types[no]["name"];

					document.getElementById("multiSearchInputField").value = types[no]["defaultString"];
					
					if(no==1 && defaultCityName) {
						document.getElementById("multiSearchInputField").value = defaultCityName;
					}					
					
					defaultString = types[no]["defaultString"];

					document.getElementById("multiSearchForm").action = types[no]["action"];
					document.getElementById('multiSearchResults').style.display = 'none';
					
					document.getElementById("searchResetButton").style.display = 'none';
										
					this.closeTypeSelector();		
				}

				this.citySearch = function() {
					this.closeTypeSelector();
					
					var output = new Object();
					output.searchString = encodeURIComponent(document.getElementById("multiSearchInputField").value);
					output.searchType = 'cities';
					output.limit = 20;
					output.page = currentPage;
						
					outputString = JSONstring.make(output);

					jsonPostData('json/search/search.php', escape(outputString), this.name + '.displayResults');	
				}

				this.displayResults = function(Object) {
					var showErrorMessage = true;
					document.getElementById('multiSearchResults').innerHTML = '';
					document.getElementById('multiSearchResults').style.display = 'block';
					document.getElementById("multiSearchDescription").style.display = 'none';
					
					if(Object) {
						if(Object["status"]) {
							if(Object["status"]=='ok') {
							
								if(Object["results"]) {
									if(Object["counter"]) {
							
									}
									
									showErrorMessage = false;
									
									if(Object["results"].length > 0) {
										for(resCnt = 0; resCnt <= Object["results"].length - 1; resCnt++) {
											var listContainer = document.createElement("DIV");
											listContainer.id = 'lC' + resCnt;
											listContainer.className = 'resultContainer';
											
											eval("listContainer.onmouseover = function(event) { this.className = 'resultContainer hovered'; };");
											eval("listContainer.onmouseout = function() { this.className = 'resultContainer'; };");
											eval("listContainer.onclick = function() { " + this.name + ".selectCity(" + Object["results"][resCnt]["ID"] + "); };");
																															
											listTitle = document.createElement("DIV");
											listTitle.className = 'listTitle';
											if(Object["results"][resCnt]["Title"].length > 39) {
												Object["results"][resCnt]["Title"] = Object["results"][resCnt]["Title"].slice(0, 38);
												Object["results"][resCnt]["Title"] = Object["results"][resCnt]["Title"] + '...';
											}
											listTitle.innerHTML = Object["results"][resCnt]["Title"];
											
											listSubTitle = document.createElement("DIV");
											listSubTitle.className = 'listSubTitle';
											listSubTitle.innerHTML = Object["results"][resCnt]["SubTitle"];

											listContainer.appendChild(listTitle);
											listContainer.appendChild(listSubTitle);
											
											document.getElementById('multiSearchResults').appendChild(listContainer);
										}
									}
								}
							}
						}
					}

					if(showErrorMessage) {
						var errorMessageContainer = document.createElement("DIV");
						errorMessageContainer.className = 'errorMessageContainer';

						var errorIcon = document.createElement("IMG");
						errorIcon.src = '/images/style/icons/common/onBright/big/cityIcon.gif';

						var errorMessage = document.createElement("DIV");
						errorMessage.className = 'errorMessage';
						errorMessage.innerHTML = 'Es wurde keine passende Stadt gefunden.';

						errorMessageContainer.appendChild(errorIcon);
						errorMessageContainer.appendChild(errorMessage);

						document.getElementById('multiSearchResults').appendChild(errorMessageContainer);
					}
				}

				this.selectCity = function(id) {			
					var output = new Object();
					output.cityId = id;
				
					outputString = JSONstring.make(output);

					if(id=='delete') {
						jsonPostData('jsApi/geoData/save/myLocation', escape(outputString), this.name + '.deleteCity');
					} else if(id =='changeCity') {
						output.cityId = 'delete';
						jsonPostData('jsApi/geoData/save/myLocation', escape(outputString), this.name + '.selectCityInt');
					} else {
						jsonPostData('jsApi/geoData/save/myLocation', escape(outputString), this.name + '.selectCityInt');						
					}
				}

				this.selectCityInt = function(Object) {
					var displayCitySearch = true;

					if(Object) {
						if(Object["status"]) {
							if(Object["status"]=='ok') {
								if(Object["url"]) {
									document.location.href=Object["url"];
								} else {
									location.reload();
								}
								displayCitySearch = false;
							}
						}
					}
					
					if(displayCitySearch) {
						document.getElementById("multiSearchOpt1Selector").className = 'selectorEntry left selected';
						document.getElementById("multiSearchOpt2Selector").className = 'selectorEntry right';
						
						this.selectType(1);

						document.getElementById("multiSearchInputField").value = '';
						document.getElementById("multiSearchInputField").focus();
						
						document.getElementById("multiSearchDescription").style.display = 'block';
						
						mousePointerLabel.clear();
					}
				}

				this.deleteCity = function(Object) {
					var doReload = true;
					
					if(Object) {
						if(Object["url"]) {
							document.location.href=Object["url"];
							doReload = false;
						}
					}
					
					if(doReload) {
						location.reload();
					}
				}				
				
				this.siteSearch = function() {
					document.getElementById("searchInputField").value = document.getElementById("multiSearchInputField").value;
					search();
				}
			}
