 $(document).ready(function(){
	// Put click event to toggle forgot password box
   $('#pwlink').click(function(event){
		$('#pwform').toggle();
		return false;
		});
   // Hide table rows containing details
   //$('.details').toggle();
   $('.details').css('display', 'none');
   // Put click events on table rows with details to toggle next (hidden) table row
   $('.details_trigger').click(function(event){
		// If they click the same item, they want to close it. Use this var to decide.
		var closeclick = false;
		//if ($(this).next().is(':visible'))
		// Changed the above to line below and line 8 - didn't work properly in IE7 - always returned true
		if ($(this).next('tr.details').css('display') != 'none')
		{
			closeclick = true;
		}
		
		$('.details').hide();
		if (closeclick == false)
		{
			$(this).next().toggle();
			// Reset all of the links to "View" before setting this one to read "Hide"
			$('#dgStatus > tbody > tr.details_trigger').children('td:nth-child(3)').text('View');
			$(this).children('td:nth-child(3)').text('Hide');
		}
		else
		{
			$(this).children('td:nth-child(3)').text('View');
		}
		return false;
		});
	// Add striped bg to table rows in Current Status table
	$('#dgStatus > tbody > tr:not(.details):odd').addClass('striped');

	// Hilight the current mouseover row, reset on mouseout
	$('.details_trigger').hover(
		function(){					
			$(this).css("background-color", "#FFFF99");
		},
		function(){					
			$('#dgStatus > tbody > tr:not(.details):odd').css("background-color", "#F5F5F5");
			$('#dgStatus > tbody > tr:not(.details):even:gt(0)').css("background-color", "#FFFFFF");
	});
 });
