$(function() {
    var $reports = $('#reports');

	$('tr:odd', $reports).filter(':has("td")').addClass('odd');
	$('th:first-child, td:first-child', $reports).addClass('firstCell');
	$('th:last-child, td:last-child', $reports).addClass('lastCell');

	$('tr', $reports).filter(':has("td")').click(function() { var link=$(this).find('a').attr('href'); window.location.href=link; });
	$('.info').mouseover(function() { $(this).addClass('spanOver');  })
			  .mouseout(function() { $(this).removeClass('spanOver'); })
	if(($.browser.msie) && ($.browser.version==6)) {
		$('#reports tr').mouseover(function() { $(this).addClass('over'); }).mouseout(function() { $(this).removeClass('over'); })
	}
	$(':submit').addClass('submit');
	$(':text, :password').addClass('textInput');
	$(':radio, :checkbox').addClass('check');
	$('.logoutLink').click(function() { $('#logout input[type=submit]').click(); });
	$('#add_location').click(function() { $('#report_form').submit(); });
	$('.onChangeSubmit').change(function() {
		if ($('#report_form').length > 0) { $('#report_form').submit(); }
		if ($('#preselect_form').length > 0) { $('#preselect_form').submit(); }
	});
	$('.onClickSubmit').click(function() {
		if ($('#report_form').length > 0) { $('#report_form').submit(); }
		if ($('#preselect_form').length > 0) { $('#preselect_form').submit(); }
	});
	$('.onChangeSubmitUrgency').change(function() {
		if ($('#report_form').length > 0) { $('#report_form').submit(); }
	});
});
