function fiximages( newdimension ) {
	
	$('#content .entry > img').each( function () {
		$(this).after('<div class=\"thumbnail\"><img src=\"'+$(this).attr('src')+'\"/></div>').remove();
	});

	$('#content .entry > .thumbnail').each( function () {

		if ( $(this).children('img').width() > $(this).children('img').height() ) {
			$(this).children('img').css ( { 'left': (($(this).children('img').width() / 2 - $(this).children('img').height() / 2)*-1), 'height':newdimension } );
			var dimensions = $(this).children('img').height();
		}
		else
		{
			$(this).children('img').css ( { 'top': (($(this).children('img').height() / 2 - $(this).children('img').width() / 2 )*-1), 'width':newdimension } );
			var dimensions = $(this).children('img').width();
		}

		if (typeof newdimension != 'undefined') dimensions = newdimension;

		$('#content .entry > .thumbnail').parent().css('min-height',dimensions);

		$(this).width(dimensions); $(this).height(dimensions);

	});
	
	$('.thumbnail').hover ( 
		function () { $(this).css({ 'overflow':'visible' }); },
		function () { $(this).css({ 'overflow':'hidden' }); }
	);

	$("#content").animate( {'opacity': '1'}, 200 );	
	$(".cat-item-11 a").attr("href","http://forum.ostava.com").attr("target","_blank");
	$(".cat-item-11 a").click ( function () {
		window.location = window.location;
	});
	$("h1 img").hide('fast');

	$(".nav li a, h1, h2 a:link, #content .post .entry a, .post h2 a, .navigation h3 a, .navigation div a, #respond #submit").click( function () {
		$("#content").animate( {'opacity': '0'}, 200 );
		$(this).css({'opacity': '0.5'});
	});

	$(".linkfacebook, .linkmyspace, .linkflickr, .linkyoutube, .entry p a, .videobox").click ( function () {
		$(this).animate ( { 'opacity': '1'}, 300, function () { 
			$("#content").css({'opacity': '1'});
			$(this).css({'opacity': '1'});
		});
	});

	$('.videobox').click( function ( event ) {
		$(this).stop();
		if ( event.stopPropagation ) event.stopPropagation(); else window.event.cancelBubble = true;
		$('body').append('<div class=\"box\"> </div>');
		$('.box').css ( 'height', $('body').height() );
		$('.box').show();
		$('.box').html ( "<object width=\"540\" height=\"320\"><param name=\"movie\" value=\""+($(this).attr('href'))+"&hl=en_US&fs=1&autoplay=1&\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\""+($(this).attr('href'))+"&hl=en_US&fs=1&&autoplay=1&\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"540\" height=\"320\"></embed></object> <a>X Close</a>" );
		
		$('.box').click( function () {
		if ( event.stopPropagation ) event.stopPropagation(); else window.event.cancelBubble = true;
			$(this).remove();
		});

		$('.box object').click( function () {
			return false;
		});			
		return false; 
	});

	$(".promo .videobox").each( function () {
		var bg =  'url(' + 'http://img.youtube.com/vi/' + $(this).attr("href").split("/")[4] + '/2.jpg)';
		$(this).css ( 'background-image', bg );
		$(this).append ( '<img src=\'' + mainpath + '/play.png\'/>' );
	});

	$("#content .videobox").each( function () {
		var bg =  'url(' + 'http://img.youtube.com/vi/' + $(this).attr("href").split("/")[4] + '/0.jpg)';
		$(this).css ( 'background-image', bg );
		$(this).append ( '<img src=\'' + mainpath + '/play.png\'/>' );
	});

	$("#content .videobox.small").each( function () {
		var bg =  'url(' + 'http://img.youtube.com/vi/' + $(this).attr("href").split("/")[4] + '/2.jpg)';
		$(this).css ( 'background-image', bg );
		$(this).append ( '<img src=\'' + mainpath + '/play.png\'/>' );
	});

	$('.cat-item-<?php if (is_single()) the_category_ID(); ?>').addClass('current-cat');
	
}

