	// Eventdetailpage Google Maps
	function initialize(address) {
		if (GBrowserIsCompatible()) {
			var  geocoder = new GClientGeocoder();
			var map = new GMap2(document.getElementById("map_canvas"));

			geocoder.getLatLng(address, function(latlng) {
				if (!latlng) {
					alert(address + ' not found');
				} else {
					map.setCenter(latlng, 13);
					map.addOverlay(new GMarker(latlng));
				}
			});

			map.setUIToDefault();
		}
	}

	// close or open a div-window
	function windowFunc(i) {
		$(i).toggle(500);
	}
	
	$(document).ready(function() {
		$('#addressInput').focus(function(){
			$(window).keypress(function(e) {					
				if(e.keyCode == 13) {
					searchLocations();
				}
			});					
		});	
		
		// clear the searchfield
		$('.clearField').clearField();
		
		// not the best way
		// if no topnews is there, hide the div-container	
		if(document.getElementById('topNews') != null) {			
			var topNews = $('.newsTop').html();
			var countTopNews = topNews.length;
			
			if(countTopNews < 20 ) {
				$('.newsTop').css('display','none');
			}
		}
		
		
	});
	
	// reset the contactform fields
	function resetForm(form) {
	  $(':input', $(form)).each(function(i, item) {
		switch(item.tagName.toLowerCase()) {
		  case 'input':
			switch(item.type.toLowerCase()) {
			  case 'text':
				item.value = '';
			  break;
			}
		  break;
		  case 'textarea':
			item.value = '';
		  break;
		}
	  });
	}		