jQuery(document).ready(function($) {
	$('.fix tr.comp').each(function(i) {
		$(this).children('td').prepend('<img src="../../images/minus.gif" alt="hide" /> ');
		if ($(this).hasClass('archived')) {
			tog(this,i);
		}

		$(this).click(function() {
			tog(this,i);
		});
	});
	
	function tog (obj,i) {
		$(obj).nextAll('tr.c' + (i + 1)).toggle();
		chr = $(obj).nextAll('tr.c' + (i + 1)).is(':visible') ? 'minus' : 'plus';
		$(obj).children('td').children('img').replaceWith('<img src="../../images/' + chr + '.gif" alt="hide" /> ');
	}
});

