/* Events Main Page
Created by: Amy Wong 06/22/2011

This file does the follow:
1) Add even and odd classes to the datatable
2) Removes the ability to sort on the register column 
3) Sorts date column specifically off of sort data in the hidden input
4) Customized slider code for features and functionality for controls to show upon hover
*/

$(document).ready(function(){
	$.tablesorter.addParser({
    	// set a unique id
	    id: 'date_parser',
	    is: function(s) {
	    // return false so this parser is not auto detected
	    	return false;
	    },
	    format: function(s, table, cell) {
	    // format your data for normalization
    		return $('input', cell).val();
	     },
	     // set type, either numeric or text
    	 type: 'numeric'
	});

    $(".sort").tablesorter({ 
		sortList: [[0,0]], 
        widgets: ['zebra'],  
		headers: {
			0:{sorter:'date_parser'}, //sort based on hidden input
			4:{sorter: false }
		} //disable sort for register column
      }); 
	
	$('#slider-code').tinycarousel({controls:true, animation: true, interval: true, intervaltime: 5000, rewind: false });
	$("#slider-code").hover(
		function () {
			$(".prev").fadeIn('500');
		    $(".next").fadeIn('500');	
		},
		function () {
		     $(".prev").fadeOut('500');
			 $(".next").fadeOut('500');	
 		}
	);
});			  

