function map_showAddress(address, mapid, zoom) {
	if (zoom == 'undefined') zoom = 10;
	var map = null;
    var geocoder = null;

	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById(mapid));
		//map.setMapType(G_HYBRID_MAP);
		map.setMapType(G_NORMAL_MAP);
		
		geocoder = new GClientGeocoder();
		
		var mapControl = new GMapTypeControl();
//		map.addControl(mapControl);
//		map.addControl(new GLargeMapControl());
		map.addControl(new GSmallMapControl());
	
		if (geocoder) {
			geocoder.getLatLng(
				address,
				function(point) {
					if (!point) {
						alert(address + " nicht gefunden");
					} else {
						map.setCenter(point, 14);
						var marker = new GMarker(point);
						map.addOverlay(marker);
						map.setZoom(zoom);
					}
				}
			);
		}
	}
}

$(document).ready(function(){

	$("a[rel^='simplephoto']").click( function() {
		var num = $(this).parent().children('.photonum').attr('value');
		$("#photonum_"+num).click();
		return false;
	});
	
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
//	$("a[rel^='prettyPhoto']").setPage(5);
	
	
	//galerieoverhead = $(".tester").width() - 440;
	galeriecnt = Math.floor(($(".tester").width() - 4 * 108)/108);
	galeriemin = 0;
	galeriemax = galeriecnt - 1 + 1;
	galerienum = 0;
	
	if (galeriecnt >= 1) {
		$(".projekt_detail_smallimage_box_right").addClass("projekt_detail_smallimage_box_right_aktiv");
	}
	
	$('.projekt_detail_smallimage_box_right_aktiv').click(function(){
		galerienum++;
		if (galerienum >= galeriemax) {
			$(".projekt_detail_smallimage_box_right").removeClass("projekt_detail_smallimage_box_right_aktiv");
			galerienum = galeriemax;
		}
		if (galerienum > galeriemin) {
			$(".projekt_detail_smallimage_box_left").addClass("projekt_detail_smallimage_box_left_akiv");
		}
		var value = "-"+(galerienum*108)+"px";
		
		$(".projekt_detail_smallimage_box_layer").animate( { marginLeft:value } );
	});
	
	$('.projekt_detail_smallimage_box_left').click(function(){
		galerienum--;
		if (galerienum <= galeriemin) {
			galerienum = galeriemin;
			$(".projekt_detail_smallimage_box_left").removeClass("projekt_detail_smallimage_box_left_akiv");
		}
		if (galerienum < galeriemax) {
			$(".projekt_detail_smallimage_box_right").addClass("projekt_detail_smallimage_box_right_aktiv");
		}
		var value = "-"+(galerienum*108)+"px";
		$(".projekt_detail_smallimage_box_layer").animate( { marginLeft:value } );
		
	});
	
	
	$('#auswahl1').click(function(){
		$('.auswahl2000').hide();
		$('.auswahlunter2000').show();
	});
	
	$('#auswahl2').click(function(){
		$('.auswahlunter2000').hide();
		$('.auswahl2000').show();
	});
	$('#alle').click(function(){
		$('.auswahlunter2000').show();
		$('.auswahl2000').show();
	});
	
	
	
	
	// sliding menu by buk
	
	$(".slidemainmenu").each( function() {
		//alert($(this).next().height());
		$(this).animate( {marginTop:$(this).next().height()}, {duration:1000});
		//animate( { marginLeft:value }, { duration:speed } )
	});
	
	
	// akkordeon by buk
	
	$(".akkordeon").each( function() {
		// aktivieren von akkordeoneintrag
		
		$(this).children().children().children(".akkordeontitel").click( function() {
			if ($(this).next().css("display") == "none") {
				$(this).next().slideToggle();
				$(this).parent().parent().parent().children().children().children(".akkordeonabsatzoffen").slideUp();
				$(this).parent().parent().parent().children().children().children(".akkordeonabsatzoffen").removeClass("akkordeonabsatzoffen");
				$(this).next().addClass("akkordeonabsatzoffen");
			}
		});
	});
	
	
	
	$(".video_preimg").click( function() {
		$(this).hide();
		$(this).next(".video").show();
	});
	
	
	$('h2').each( function() {
		// zu große Überschriften einkürzen
		if ($(this).height() > 20) {
			$(this).addClass('small');
		}
	});
	
	
});