$(function() {
	// tabs
	$('#video-tabs, #video-tabs-info, #video-tabs-interview, #video-tabs-discuss, #video-tabs-more').tabs(); 

	// Email Signup Form Validation
	$("#emailsignup").validate();
	
	// Toggle Form Values automagically
	$("#emailsignup input[type='text']").toggleVal();
	$("#emailsignup input[type='text']").toggleVal();

	$('#btn-archive').click(function () { 
		document.location = $('#list').val();
	});
	$('#list').change(function () { 
		document.location = $('#list').val();
	});

	$("a").filter(function() {
	    return this.hostname && this.hostname !== location.hostname;
	}).attr('target', '_blank');

	$('.views-field-field-screenshot-img-fid').hover(
		function() {
			$(this).parent().find('.views-field-title, .views-field-field-byline-value, .views-field-created').hide();
			$(this).parent().find('.views-field-field-coming-soon-text-value').show();
		},
		function() {
			$(this).parent().find('.views-field-title, .views-field-field-byline-value').show();
			$(this).parent().find('.views-field-field-coming-soon-text-value').hide();
		}
	);

});

// Audio player
AudioPlayer.setup("/sites/all/themes/t21/audio-player/player.swf", {  
	width: 290,
	transparentpagebg: "yes"
});
