$(window).load(function() {
	$('.entryBox').each(function() {
		var $this = $(this);
		
		if ($('div#FlashContainer', $this).length > 0) return;
		if ($('div#img_view_general', $this).length > 0) return;

		$('a[class!="inactive"]', $('div:not(.spacer):first', $this)).each(function() {
			var $this = $(this);
			$this.contents().appendTo($this.parent());
			$this.remove();
		});
		
		$('div', $this).each(function() {
			var $element = $(this);
			if (!$element.hasClass('administration') && !$element.hasClass('inactive') && !$element.parent().hasClass('inactive')) {
				$element.appendTo($('> a:first', $this));	
			}
		});
		
		$('> a[class!="inactive"]:eq(1), div.spacer a', $this).remove();
		
		if ($('div.spacer', $this).length > 0) {
			$('> a[class!="inactive"]:eq(1)', $this).remove();
		}
	});
});
