// Find alt of Image, put into title of wrapping a tag
$(document).ready(function(){
  	$("div.wp-caption a").each(function() {
  		var imgAlt = $(this).find('img').attr("alt");
  		$(this).attr('title', imgAlt);
  	});
  	
  	$("div.cat-image").each(function() {
  		var imgAlt = $(this).find('a img').attr("alt");
		$(this).find('.gallery-caption').append(imgAlt);
  	});
});
 
jQuery(document).ready(function($){	
	var select = $('a[href$=".bmp"], a[href$=".gif"], a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"], a[href$=".BMP"], a[href$=".GIF"], a[href$=".JPG"], a[href$=".JPEG"], a[href$=".PNG"]');
	select.slimbox({
		overlayOpacity: 0.5,
		loop: true,
		overlayFadeDuration: 800,
		captionAnimationDuration: 150,
		counterText: "Bild {x} von {y}"
	});
});
    
// berechne groessen fŸr die startseite
$(document).ready(function() {
    var rotatorWidth = $("#rotator").find('.entry p:first img').width();
    var rotator = rotatorWidth - 0;
	$("#rotator").css("width",rotator);
	
	var rotatorHeight = $("#rotator").find('.entry p:first img').height();
	$("#rotator .entry p:first").css("height",rotatorHeight).css("border-bottom-style","solid").css("border-bottom-width","1px").css("border-bottom-color","#ff9900").css("padding","0");
	
	var bildbreite = 490 - rotatorWidth;
    //$(".feature").css("width",bildbreite);
});

// Einstellungen Diashow Startseite
$(document).ready(function() {
	$('#rotator .entry p:first').cycle({ 
    	delay:  2000, 
    	speed:  1000
	}); 
});

// Alle PDF Links mit Icon versehen 
jQuery(document).ready(function($){	
	var select = $('a[href$=".pdf"], a[href$=".PDF"]');
	select.addClass('pdf');
});