	Cufon.replace('h1'); // Works without a selector engine
	Cufon.replace('#ctrl');
	Cufon.replace('#navbar'); // Requires a selector engine for IE 6-7, see above

	$(document).ready(function() {
	
	
	

		$(".main").click(function(){ $(".sub").toggle(); });
		$(".anfahrt").click(function(e) { window.open("google.html", "Anfahrt", "width=450,height=390,scrollbars=0"); e.preventDefault(); return false; });
		$(".zeiten").click(function(){ $(".subzeiten").toggle(); });
		
		
		
		var clickState = 0;
		var imgLength = $('#thumbs a').length-1;
		
		$('a.forward').click(function(){
			if (clickState < imgLength) 
			{
				clickState++;
				// DEBUG: console.log(clickState);
				$('#thumbs a:nth('+clickState+')').click();
			}
			else 
			{
				// DEBUG: console.log('!0!');
				clickState = 0;
				$('#thumbs a:nth('+clickState+')').click();
			}
		});
		$('a.back').click(function(){
			if (clickState > 0)
			{
				clickState--;
				$('#thumbs a:nth('+clickState+')').click();
			}
			else
			{
				clickState = imgLength;
				$('#thumbs a:nth('+clickState+')').click();
			}
		});	
	});
