$(function() { 

	if($.browser.msie && $.browser.version < 9) { 
		var width = $(this).width();
		if(width <= 1010) { 
			$('html').addClass('small');
		}
	}	
	
	$('.gallery a.thickbox:not(:has(img))').hide();
	$('.gallery a.thickbox').addClass('js').each(function() {
		var $this = $(this);
		var $img  = $('img', $this);
		var imgHeight = $img.height();
		var aHeight = 55;
			
		if(imgHeight < aHeight) { 
			$img.css({ marginTop: -(imgHeight/2) });
		} else { 
			$img.css({ top: 0 });
		}
		
	});
	$('.gallery a.thickbox').addClass('js').colorbox({
		slideshow: true,
		close: 'schlie&szlig;en',
		current: "Bild {current} von {total}",
		previous: "<big><strong>&laquo;</strong></big>",
		next: "<big><strong>&raquo;</strong></big>",
		slideshowStart: "Slideshow starten",
		slideshowStop: "Slideshow anhalten",
		speed: 600,
		slideshowSpeed: 4000
	});	
	
	$('blockquote.klappfunktion').each(function() { 
		var $c = $(this).hide();
		$('<a class="toggler" title="mehr" href="#">mehr</a>')
			.insertAfter($c)
			.wrap('<div class="tcont"></div>')
			.click(function(e) { 
				var $a = $(this);
				$c.slideToggle(600, function() { 				
					if($c.is(':visible')) { 
						$a.addClass('auf').attr({ title: 'weniger' }).text('weniger');
					} else {
						$a.removeClass('auf').attr({ title: 'mehr' }).text('mehr');
					}
				});
				e.preventDefault();
			});
	});

});
