$(document).ready(function() {
	$("a").bind("focus",function(){if(this.blur)this.blur();});
	$("#toggle").toggle(function() {
		$('#loginbox').animate({height:30}, {duration: 500, easing: 'easeOutBounce'});
	},function(){
		$('#loginbox').animate({height:0}, {duration: 500, easing: 'easeOutBounce'});
	});
	
	$("img.bildunterschrift").each(function(){
	  var dertext ="";
	  var richtung = "";
	  
	if($(this).css("float") != "none"){
		richtung = $(this).css("float");
		$(this).css("float","none");
		}
	// Tinyschwäche alle margin entfernen 
	$(this).css("margin","0");
	
	if($(this).attr("alt") != ""){
		dertext = $(this).attr("alt");
		}else{
			if($(this).attr("title") != ""){
				dertext = $(this).attr("title");
			}
		}
	  if(dertext != ""){
		$(this).wrap("<div></div>").after("<p class='bildunterschrift_sm'>"+dertext+"</p>");
		if(richtung != ""){
			$(this).parent("div").css("float",richtung);
			if(richtung == "left"){ $(this).parent("div").css("margin","0px 5px 5px 0px"); }else{ $(this).parent("div").css("margin","0px 0px 5px 5px"); }
		}
		$(this).parent("div").css("width",$(this).attr("width")+5);
	  }		
    });  
});