$(document).ready(function() {
	$(".newsdigest").has('.newsimage').each(function() {
		$(".newsdigestitem").each(function() {
			if ($(this).children(':first-child').attr('class') != 'newsimage') {
				$(this).prepend('<div class="newsimage"></div>');
				
			}
		});
	});
	
/*	$(".event_icons img").mouseover(function() {
		console.log($(this).parent());
	    $(this).parent().append('<div class="event_icon_info_window">Foo</div>');
	}).mouseout(function() { 
	    $(".event_icon_info_window").remove();
	});
	
	$(".event_icons img").mouseover(function() {
	    $(this).parent().append('<div class="event_icon_info_window">Foo</div>');
	});

	$(".event_icons img").mouseout(function() { 
	    $(".event_icon_info_window").remove();
	});
*/

});

$('.frontpage, .secondfrontpage').ready(function() {
	$('.frontpage .lowerleft .content table .content_image, .secondfrontpage .centerblock .p4table .content_image').each(function(){
		var ahref = $(this).find('a').attr('href');
		
		var text = $(this).find('.content_image_caption').text();
		$(this).find('.content_image_caption').html('<a href="' + ahref + '">' + text +'</a>');
	});
	
});

