$(document).ready(function(){
	
	/* show titles under the images */
	$(".entryContent img").each(function(){
		var t = $(this).attr("title");
		if (t != "") {
			$(this).after("<div class='imgTitle'>"+t+"</div>");
		} else {
			var a = $(this).attr("alt");
			if (a != "") {
				$(this).after("<div class='imgTitle'>"+a+"</div>");
			}
		}
	});
	/* end */
	
	/* resize images */
	$(".entryContent img").each(function(){
		var w = $(this).width();
		var maxWidth = 490;
		if (w > maxWidth) {
			$(this).width(maxWidth+"px");
			$(this).removeAttr("height").removeAttr("width");
		}
	});
	/* end */
	
	/* rotate images */
	$(".roundAuthor div").innerfade({ speed: 'slow', timeout: 6000, type: 'sequence', containerheight: '45px' });
	$(".authorWrap").innerfade({ speed: 'slow', timeout: 8000, type: 'sequence', containerheight: '85px' });
	/* end */
	
	/* slide out all categories */
	$(".otherCategories").click(function(){
		$(this).parents(".controls").siblings(".allCategories").slideToggle();
	})
	/* end */
	
	/*authors correct order */
	kb = $(".blog_korporacyjny .leftColumn .authors div.author:eq(1)");
	ts = $(".blog_korporacyjny .leftColumn .authors div.author:eq(2)");
	mk = $(".blog_korporacyjny .leftColumn .authors div.author:eq(5)");
	rk = $(".blog_korporacyjny .leftColumn .authors div.author:eq(7)");
	
	ts.after(kb);
	kb.after(mk);
	ts.before(rk).parent().find("div").show();
	
	pj = $(".blog_technologiczny .leftColumn .authors div.author:eq(0)");
	lt = $(".blog_technologiczny .leftColumn .authors div.author:eq(3)");
	
	lt.after(pj).parent().find("div").show();
	
	/* end */
	
	$(".blog_sportowy .rightColumn .authors .author").show();
	
	$(".addMail").click(function(){
		$(this).attr("value","").removeClass("addMail");
	});
	
});
