$(document).ready(function() {
	// call the tablesorter plugin
	$.tablesorter.addWidget({
		// give the widget a id
		id: "removeTr",
		// format is called when the on init and when a sorting has finished
	
		format: function(table) {
			var now =  new Date();
			year=now.getFullYear(); month=now.getMonth()+1; day=now.getDate();
			if(month<10) month = "0"+month;
			if(day<10) day = "0"+day;
			date = year+'-'+month+'-'+day;
			//alert(date);
			for(var i=0; i < table.tBodies[0].rows.length; i++) {
					//alert($("tbody tr:eq(" + i + ") td:eq(0)",table).text());
					if(date > $("tbody tr:eq(" + i + ") td:eq(0)",table).text() ){
						$("tbody tr:eq(" + i + ")",table).remove();
					}
			}
		
			
		}
	});
	$(".tablesorter").tablesorter({widgets: ['zebra','removeTr']});	
	//$.tablesorter.defaults.sortList = [[0,0]]; 
	//$(".tablesorter").tablesorter();  
	$(".tablesorter tr").mouseout( function() { this.style.background = "#FFFFFF"; } ); 
	$(".tablesorter tr").mouseover( function() { this.style.background = "#D2DCF8"; } ); 
	//$(".tablesorter").tablesorterPager({container: $("#pager")});	
	//$(".tablesorter").tablesorter({headers: { 6: {sorter: false} }} );	
	$(".tablesorter").tablesorterPager({container: $("#pager")});
});