$(function(){
	
	
	//apply inline styles (height) for later use
	$('th.heading, th.show, th.channel').each(function(){
		if ($.browser.mozilla) {
			$(this).height( $(this).outerHeight() );
		} else {
			$(this).height( $(this).height() );
		}
	});

	//clone table
	var $scheduleTable = $('#schedule table');
	$scheduleTable
		.addClass('origTable')
		.before( $scheduleTable.clone().removeClass('origTable').addClass('newTable') );

	//remove everything except the locked columns
	$('.newTable')
		.find('td')
		.remove()
			.end()
		.find('.dateBar th:not(.heading)')
		.remove()
			.end()
		.find('th')
		.width( $('.origTable th.heading').outerWidth() ) //set TH widths to match original TH widths
			.end()
		.width( $('.origTable th.heading').outerWidth() * 2 ); //set cloned TABLE width
	
	
	
	
	//arrows for scrolling
	$('.scrollLeft').click(function(){
		$('#scheduleInner').stop().scrollTo('-=214px',600);
		return false;
	});

	$('.scrollRight').click(function(){
		$('#scheduleInner').stop().scrollTo({top:'-=100px', left:'+=214'},600);
		return false;
	});
	
});
