$(function() {
	
	$('#aside .section.events .tickets a, #main .section.events .location a').bigTarget({
		clickZone : 'tr',
		hoverClass : 'over'
	});
	
	// Make the community dropdown work on click/touch
	$('#header .nav .parent .child').hide();
	$('#header .nav .parent > span').click(function(){
		$(this).parent().find('.child').slideToggle('fast');
		return false;
	});
	
	// Placeholder
	$('input[placeholder]').placeholder();
	
	// Newsletter popup box
	$('#zippop').click(function() {
		$('#zippopupbox').fadeIn('fast');
		$('.dimbg').fadeIn('fast');
	});
	$('#zippopupbox .close').click(function() {
		$('#zippopupbox').fadeOut('fast');
		$('.dimbg').fadeOut('fast');
	});
	
	$('a[rel="fancybox"]').click(function(e) {
		e.preventDefault();
		
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'			: 640,
			'height'		: 385,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			'wmode'				: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});
	});
	
	/*
	// Adding Tonight Contest Fancyness
	$('.section.tonight.contest #videos .video .thumbnail a').click(function(){
		var id = $(this).attr('data-youtube-id'),
			source = 'http://www.youtube.com/embed/'+ id +'?rel=0';
		$('#blackout').fadeIn('normal');
		$('.section.tonight.contest #player').fadeIn('normal');
		$('.section.tonight.contest #player .video').append('<iframe width="425" height="349" src="'+ source +'" frameborder="0" allowfullscreen></iframe>');
		$('.section.tonight.contest #player .close').click(function(){
			$('.section.tonight.contest #player .video iframe').remove();
			$('.section.tonight.contest #player').hide();
			$('#blackout').fadeOut();
		});
		$('#blackout').click(function(){
			$('.section.tonight.contest #player .video iframe').remove();
			$('.section.tonight.contest #player').hide();
			$('#blackout').fadeOut();
		});
	});
	*/
});
