/*
** Registration.js
** Copyright Ronningen Design, LLC (http://www.websitesthatdostuff.com)
** Subcontracted to Substratal Code LLC (http://www.substratalcode.com)
** Tampered with by Way Short of Heaven (http://www.wayshortofheaven.com)
**
*/

$(document).ready(function() {
	// Hide the last column
	$('#waitlist td:nth-child(4)').hide();1
	// Truncate the first column:
	$('#waitlist td:nth-child(1)').truncate('1', {
		trail:'.'
	}).addClass('fname');
	// Add classes to the other columns.
	$('#waitlist td:nth-child(2)').addClass('lname');
	$('#waitlist td:nth-child(3)').addClass('date');
	
	// Add odd classes to the rows:
	$('#waitlist tr:odd').addClass('odd');
	
	// Set up the option to click the 
	$("#waitListOption").change(function() {
		if( $("#waitListOption").val() != '' ) {
			// Show the table:
			$('#waitListWrapper').show();
			$('#waitListHeader').show();
			$("#lastUpdated").show();
			
			$.uiTableFilter( $('#waitlist'), $("#waitListOption").val(), 'Grade' );
		} else {
			$('#waitListWrapper').hide();
			$('#waitListHeader').hide();
			$("#lastUpdated").hide();
		}

	});
});
