
function restaurantSuche() {
	if ($('#restaurants').length>0) {
		// Karte einf�gen
		$('#restaurants li').hide();
		$('#restaurants').before('<img src="/images/layout/sachsen.gif" alt="" id="sachsen" usemap="#regionen">');
		$('#sachsen').after('<map name="regionen"><area shape="poly" coords="72,60,89,61,128,63,128,73,81,74,71,73,69,66" id="leipzig" href="#"><area shape="poly" coords="139,188,151,186,203,190,206,198,147,200,136,198" id="chemnitz" href="#"><area shape="poly" coords="216,123,258,124,272,129,277,137,266,142,248,132,217,132" id="dresden" href="#"><area shape="poly" coords="53,30,46,75,56,125,106,161,82,182,99,196,115,181,171,173,191,139,182,55,162,9,112,12" id="burgen-und-heideland" href="#"><area shape="poly" coords="16,231,66,221,86,245,95,272,60,320,15,285,7,247" href="#" id="vogtland"><area shape="poly" coords="75,179,51,194,66,217,101,272,284,204,262,159,234,136,192,147,176,178,113,188,91,202" href="#" id="erzgebirge"><area shape="poly" coords="190,62,215,55,269,70,266,112,288,136,267,156,236,135,192,146" href="#" id="elbland"><area shape="poly" coords="274,69,270,113,289,134,366,142,383,176,407,183,432,81,387,28,309,40" href="#" id="oberlausitz"><area shape="poly" coords="269,160,292,138,334,142,349,169,286,195" href="#" id="saechsische-schweiz"></map>');
		// hover, click
		$.each( $('area'), function(key,obj) {
			$(obj).click( function() {
				// show Google Maps
				showMap($(obj).attr('id'));
				$('#sachsen').attr('src','/images/layout/'+$(obj).attr('id')+'.gif');
				$('#restaurants li').hide();
				$.each( $('#restaurants li.'+$(obj).attr('id')), function(key1,obj1) {
					$(obj1).show();
					if ($(obj1).find('span.number').length==0)
						$(obj1).prepend('<span class="number">'+(key1+1)+'</span>');
					// details
					$(obj1).find('p.details').hide();
					if ($(obj1).find('p:first a').length==0) {
						$(obj1).find('p:first').append(' · <a href="#">Details</a>');
						$(obj1).find('p:first a').toggle( function() {
							$(this).parent().siblings('p.details').show();
						}, function() {
							$(this).parent().siblings('p.details').hide();
						});
					}
				});
				return false;
			});
		});
	}
}

// call functions
$(document).ready(function() {
	restaurantSuche();
	// external links
	$('a[rel=external]').attr('target','_blank');
	// fieldset legend => h5
	$.each( $('fieldset legend'), function(key,obj) {
		$(obj).after('<h5>'+$(obj).html()+'</h5>');
	});
	// rezepte: table
	$('.rezept table tr td:first-child').addClass('menge');
	// anmeldung
	$('#anmeldung-gastro').submit(function() {
		if ($('#bestaetigt:checked').val()=='1')
			return true;
		else {
			alert('Bitte bestätigen Sie die Teilnahme-Kriterien!');
			return false;
		}
	});
});

$(window).load(function() {
	navPos = $('#main-menu').offset();
	aktPos = $('#aktuelles').offset();
	contentPos = $('#content').offset();
	navBottom = navPos.top+$('#main-menu').height();
	aktBottom = aktPos.top+$('#aktuelles').height();
	if (navBottom>aktBottom) bottom = navBottom;
	else bottom = aktBottom;
	if (($('#content').height()+contentPos.top)<bottom)
		$('#footer').css('margin-top',$('#content').height()+140+'px');
});

// IE 6 and below
/////////////////
/*@cc_on
	@if (@_jscript_version < 5.7)

	@end
@*/