/* Declare a namespace for the site */
var Site = window.Site || {};

/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function($) {
	
	//same as $(document).ready();
	$(function() {
			
		$('#schedule_list .overlay').fadeTo(0, 0.5);
		$('#schedule_list .clickthrough').fadeTo(0, 0);
		$('#schedule_list .overlay').css('display', 'block');
		
		$('#schedule_list li.fader').mouseenter(function() {
		
			$('.overlay', this).fadeTo(200, 0);
			$('a.show_info', this).css('border', 'none');
			$('.title', this).css('padding-left', '7px');
			$('.title', this).css('margin-left', '-1px');
			$('.title', this).animate({'margin-top': '-32px'}, 200);
			$('.airtime', this).fadeTo(200, 0);
			$('.presenter', this).fadeTo(200, 0);
			$('.clickthrough', this).fadeTo(200, 1);
		
		});
		
		$('#schedule_list li.fader').mouseleave(function() {
		
			$('.overlay', this).fadeTo(200, 0.5);
			$('a.show_info', this).css('border', '1px solid #000');
			$('.title', this).css('padding-left', '5px');
			$('.title', this).css('margin-left', '0');
			$('.title', this).animate({'margin-top': '-3px'}, 200);
			$('.airtime', this).fadeTo(200, 1);
			$('.presenter', this).fadeTo(200, 1);
			$('.clickthrough', this).fadeTo(100, 0);
		
		});
		
		
		$('#swapstyles').click(function() {
		
			$('#swapstyles').html('Now look at what you did... <br />Click again to switch back');
	
			if (currentTheme == 'dark') {
				//console.log('going light');
				$('.box').removeClass('dark');
				$('.banner').removeClass('dark');
				currentTheme = 'light';
			} else {
				//console.log('going dark');
				$('.box').addClass('dark');
				$('.banner').addClass('dark');
				currentTheme = 'dark';
			}
			
			return false;
		
		});
		

	});
	
	

	$(window).bind("load", function() {
		
		$('#main_content').masonry({ columnWidth: 250 });
		
	});
	
})(jQuery);
