$(document).ready(function() {
			$.history.init(loadHash);
			$('.link').hover(function() {
			        $(this).stop().animate({backgroundColor:'#333333'}, 300);
			        }, function () {
			        $(this).stop().animate({backgroundColor:'#E95E0F'}, 900);
			    });
			$('.buttonMain').hover(function() {
			        $(this).stop().animate({backgroundColor:'#333333'}, 300);
			        }, function () {
			        $(this).stop().animate({backgroundColor:'#E95E0F'}, 900);
			    });
			$('.link').click(function() {
				var href = $(this).attr("href");
				$(this).css("background-color","white");
				$(this).stop().animate({backgroundColor:'#3C4FFF'}, 2700);
				$.history.load(href);
				return false;
			});
			$('.gebieteLink').click(function() {
				var href = $(this).attr("href");
				$.history.load(href);
				return false;
			});
			$('.cbulinkor').click(function() {
				var href = $(this).attr("href");
				$.history.load(href);
				return false;
			});

		});

//Synch laden

function loadHash(hash) {
	if (hash.length>0) {
		loadSite(hash);
	} else {
		$.history.load("home.html");
	}
}

function loadSite(site) {
	$('#loading').show("slow");
	$('#loaded').slideUp("slow", function() {
		$.get(site,function(data2) {
			$('#loading').hide('slow');	 
			$('#loaded').html(data2);
			$('#loaded').slideDown("slow");
			$('a.foto').lightBox();
			$('a.bildtabelle').lightBox();
		});
	});
}

function suchen() {
	var namE = $( 'input:text[name=Name]' ).val();
	var gebieT = $( 'input:text[name=Gebiet]' ).val();
	var bnamE = $( 'input:text[name=Bez]' ).val();
	var blanD = $( 'select[name=Bland]' ).val();
	
	$.get('suche.php',{Name : namE, Gebiet : gebieT, Bez : bnamE, Bundesland : blanD, Suchen : true }, function(data2) {
		$('#loading').hide('slow');	 
		$('#loaded').html(data2);
		$('#loaded').slideDown("slow");
		$('a.foto').lightBox();
		$('a.bildtabelle').lightBox();
	});
}

//Anzeigen von Untermenüs

function Anzeigen(dat) {
	document.getElementById(dat).style.visibility='visible';
}

function NotAnzeigen(dat) {
	document.getElementById(dat).style.visibility='hidden';
}

//Anezigen der Unterpunkte

function AnzeigenPunkt(dat) {
	document.getElementById(dat).style.visibility='visible';
	document.getElementById(dat).style.height='100%';
}

function NotAnzeigenAnzeigenPunkt(dat) {
	document.getElementById(dat).style.visibility='hidden';
	document.getElementById(dat).style.height='0px';
}

//W3C Bar

function Gross() {
	document.getElementById('barid').style.fontSize='130%';
}

function Mittel() {
	document.getElementById('barid').style.fontSize='100%';
}

function Klein() {
	document.getElementById('barid').style.fontSize='75%';
}

