var schedule_tools = {
	_schedule_class:'.schedule',
	_hover_class:	'hover_class',
	_hr_class:		'current_hr',
	_same_class:	'same_as',
	_hover_fn:		function(table_id){
						$(table_id+' td').hover(
							function() {
								var name = $(this).attr('name');//.split('|');
								var hr_th = name[0].split('_');
								var hr = hr_th[1];
								var day = name[1];
								var event = $(this).html();
								var cols = ($(this).attr('colspan') ? $(this).attr('colspan') : 1);
								var rows = ($(this).attr('rowspan') ? $(this).attr('rowspan') : 1);
								$(table_id+' td:contains("'+event+'")').addClass(schedule_tools._same_class);
								$(this).toggleClass(schedule_tools._hover_class).css('opacity','0.7');
								$(table_id+' .'+hr).addClass(schedule_tools._hr_class);
								var next_col = '.'+day;
								for (var i = 0; i < cols; i++) {
									$(table_id+' '+next_col).addClass(schedule_tools._hr_class).css('opacity','0.7');
									next_col = next_col+' + th';
								}
								var next_row = '.hr_'+hr;
								for (var i = 0; i < rows; i++) {
									$(table_id+' .hr_'+hr).addClass(schedule_tools._hr_class).css('opacity','0.7');
									hr++;
								}
							},
							function () {
								var name = $(this).attr('name');//.split('|');
								var hr_th = name[0].split('_');
								var hr = hr_th[1];
								var day = name[1];
								var event = $(this).html();
								var cols = ($(this).attr('colspan') ? $(this).attr('colspan') : 1);
								var rows = ($(this).attr('rowspan') ? $(this).attr('rowspan') : 1);
								$(this).removeClass(schedule_tools._hover_class).fadeTo('slow', 1.0);
								$(table_id+' td:contains("'+event+'")').removeClass(schedule_tools._same_class);
								$(table_id+' .'+hr).removeClass(schedule_tools._hr_class).fadeTo('slow', 1.0);
								var next_col = '.'+day;
								for (var i = 0; i < cols; i++) {
									$(table_id+' '+next_col).removeClass(schedule_tools._hr_class).fadeTo('slow', 1.0);
									next_col = next_col+' + th';
								}
								var next_row = '.hr_'+hr;
								for (var i = 0; i < rows; i++) {
									$(table_id+' .hr_'+hr).removeClass(schedule_tools._hr_class).fadeTo('slow', 1.0);
									hr++;
								}
							}
						);
					},
	find_tables:	function() {
		$('table'+this._schedule_class).each(function(){
			schedule_tools._hover_fn('#'+$(this).attr('id'));
		});
	}
}