$(document).ready(function(){

	// Create the read more table cells
	$('tr.feature_row td.feature_name').attr('rowspan', '1');
	$('tbody th').attr('colspan', '5');
	$('th.aaw_total').after('<th class="last_column"></th>');
	$('td.aaw_total').after('<td class="last_column"></td>');
	$('tr.feature_row td.last_column').append('Show more information').addClass('read_more').attr('title','Show more information');
	$('tr.feature_row').css({'cursor':'pointer'})

	// Hide the feature descriptions
	$('tr.info_row').css({'display':'none'});

	if (! $.browser.msie) {
		$('table').fixedtableheader();
	}

	last_open = false;

	// Make it possible to toggle description on features
	$('tbody .feature_row').click(function() {
		if ($.browser.msie) {
			$(this).next().css({'display':'block'});
		} else {
			$(this).next().css({'display':'table-row'});
		}
		$('td.feature_name',this).attr('rowspan', '2');
		$('td.last_column',this).attr('rowspan', '2');

		if (last_open != false) {
			$(last_open).next().css({'display':'none'});
			$('td.feature_name',last_open).attr('rowspan', '1');
			$('td.last_column',last_open).attr('rowspan', '1');
		}

		if (last_open == this) { 
			last_open = false;
		} else {
			last_open = this;
		}


	}/*, function() {}
		$(this).next().css({'display':'none'});
		$('td.feature_name',this).attr('rowspan', '1');
		$('td.last_column',this).attr('rowspan', '1');
	}*/);
});

