$(document).ready(function(){
	// put the damn rounded corners
	//$('table tr:first-child td:first.cat').each(function(){
	//	$(this).append('<img src="/forum/styles/rc_left.png" style="position: absolute; left: '+$(this).offset().left+'px; top: '+$(this).offset().top+'px;">');
	//});
	//$('table tr:first-child td:last-child.cat').each(function(){
	//	$(this).append('<img src="/forum/styles/rc_right.png" style="position: absolute; left: '+($(this).offset().left+$(this).innerWidth()-5)+'px; top: '+$(this).offset().top+'px;">');
	//});
	$('table tr:first-child th:first').each(function(){
		$(this).append('<img src="/forum/styles/trc_left.png" style="position: absolute; left: '+($(this).offset().left-1)+'px; top: '+($(this).offset().top-1)+'px;">');
	});
	$('table tr:first-child th:last').each(function(){
		$(this).append('<img src="/forum/styles/trc_right.png" style="position: absolute; left: '+($(this).offset().left+$(this).innerWidth()-5)+'px; top: '+($(this).offset().top-1)+'px;">');
	});
	//, table tr:first-child th


	$('img.msover').attr('rel', function(){
		if($(this).attr('src').match(/_on.png$/))
			return $(this).attr('src');
		else
			return $(this).attr('src').replace(/\.png$/, '_on.png');
	});
	$('img.msover').mouseover(
		function(){
			var tmp=$(this).attr('src');
			$(this).attr('src', $(this).attr('rel'));
			$(this).attr('rel', tmp);
		}
	);
	$('img.msover').mouseout(function(){ $(this).mouseover(); });

	if($('#footer').offset().top<$(window).height()-$('#footer').innerHeight())
		$('#footer').css('margin-top', ($(window).height()-$('#footer').offset().top-$('#footer').innerHeight()+$('#content').height()-1)+'px');
	else
		$('#footer').css('margin-top', '20px');
});
